Skip to content

Instantly share code, notes, and snippets.

@bmmalone
Last active May 10, 2017 00:07
Show Gist options
  • Save bmmalone/e7cb77d6c39022ac25598467c3d4a349 to your computer and use it in GitHub Desktop.
Save bmmalone/e7cb77d6c39022ac25598467c3d4a349 to your computer and use it in GitHub Desktop.
Example vim config file
syntax on
set autoindent
set number
" try to handle tabs in makefiles correctly
filetype plugin on
" change to the directory of the current file by default
" workaround. see: https://github.com/vim/vim/issues/704
autocmd VimEnter * set autochdir
set shiftwidth=4
set softtabstop=4
set expandtab
set undodir=~/.vim/.undo//
set backupdir=~/.vim/.backup//
set directory=~/.vim/.swp//
" cut/copy/paste to the system clipboard
set clipboard=unnamed
vmap <C-x> "+c<ESC>i
vmap <C-c> "+yi
vmap <C-v> c<ESC>"+p<Right>
imap <C-v> <Esc>"+pi<Right>
" Tab and Shift-Tab to (un)indent
vmap <Tab> >><Esc><Esc>
vmap <S-Tab> <<<Esc><Esc>
imap <S-Tab> <Esc><c-g>1<<i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment