📝 Edit page
➕ Add page
Vim
Guide to using the
vim
editor
Vim is a text editor program for Unix, cloned from Vi.
Configure
Try out a config and if you like it, set it in the config so it is set up whenever you open a file.
Once-off
- Press
esc
. - Type
:MY COMMAND
. e.g.:set number
. - Press enter.
Set in config
- Open the vim config. You may have to create it.
$ open ~/.vimrc
- Add your command. e.g.
set number
- Save the file.
Config options
Set these using one of the approaches above.
See Vim config files here for more options than the ones covered below. You can also follow the installation instructions there if you want to have your configs managed for you.
Enable line numbers in gutter
set number
Or
:setnumber
Enable syntax highlighting
:syntax on
Execute code
Python
Execute Python code from inside vim. Alternatives here.
:w !python