My .vimrc file

This page is managed by StJohn Piano.

My .vimrc file


If you have any questions, comments, corrections, or suggestions - please contact StJohn Piano on Tela:
tela.app/id/stjohn_piano/7c51a6


To disable auto-comment when pasting this into vim, run this command first:
:set formatoptions-=cro

""" START NOTES

" A line starting with a double quotation mark (") is a comment.

" When in vim, to reload the .vimrc file, without restarting or leaving vim, run this command:
" :source ~/.vimrc

" If you are using putty to connect to a screen session on another machine, the function key effects in this file won't work unless the TERM environment variable on the remote machine is set to 'putty'. 
" To set this while in Bash: Run the commmand { $ TERM=putty }
" To set this while in screen: Run the command { :set term=putty }

""" END NOTES



""" START OPTIONAL VIM CONFIGURATION

" When you're using a Spanish keyboard:

" Allows the use of the circumflex ^ in vim when making a git commit.
"set encoding=utf-8

""" END OPTIONAL VIM CONFIGURATION



""" START VIM CONFIGURATION

" Keep the existing indentation level when pressing enter to move to the next line. 
set autoindent

" Defines number of spaces per tab. Existing tabs will be shown as this number of spaces.
set tabstop=4

" Insert spaces when tab is pressed.
set expandtab

" When using '>' or '<' to indent, use 2 spaces width.
set shiftwidth=4

" Backspace will delete to the appropriate level of indentation.
set softtabstop=4

" Show line numbers.
set number

" Pressing the space bar will now allow the insertion of a single character while in command mode.
:nnoremap <Space> i_<Esc>r

" Auto-remove trailing spaces when saving.
" autocmd BufWritePre * %s/\s\+$//e

" Make F2 key into a set paste / nopaste toggle, with visual feedback shown in the status line.
nnoremap <F2> :set invpaste paste?<CR>
set pastetoggle=<F2>
set showmode
" Setting the 'paste' toggle turns off vim's automatic addition of indentation, which is good if you are pasting in multi-line text that already contains its own indentation (i.e. various tabs and spaces).

" Make F3 key into a set number / nonumber toggle, with visual feedback shown in the status line.
" nnoremap line is for command mode, inoremap line is for insert mode.
nnoremap <F3> :set invnumber<CR>
inoremap <F3> <C-O>:set invnumber<CR>

""" END VIM CONFIGURATION