Skip to content

Instantly share code, notes, and snippets.

@DavidBrower
Created July 20, 2018 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidBrower/01bd4854fcb7eea4b53e620df1e04415 to your computer and use it in GitHub Desktop.
Save DavidBrower/01bd4854fcb7eea4b53e620df1e04415 to your computer and use it in GitHub Desktop.
vimrc file
" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
set wildmenu
set wildmode=full
let mapleader = ","
" toggle on whether to show line numbers
nmap <leader>n :set number!<CR>
" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
" so that you can undo CTRL-U after inserting a line break.
inoremap <C-U> <C-G>u<C-U>
set number
set linebreak
set shiftwidth=4
set softtabstop=4
set expandtab
set formatprg=par\ -w60
set clipboard=unnamed
" Spelling settings
nmap <silent> <leader>s :set spell!<CR>
set spelllang=en_gb "Set language to British English
set listchars=tab:▸\ ,eol:¬
set guifont=Andale\ Mono:h15
set noundofile "Don't have those .swp files lying cluttering up the place
" toggle on whether to show invisibles
nmap <leader>l :set list!<CR>
"Remove all trailing whitespace by pressing F5
nnoremap <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment