Skip to content

Instantly share code, notes, and snippets.

@abhishekmurthy
Created December 2, 2015 08:20
Show Gist options
  • Save abhishekmurthy/64f03ebb7b53e3a946c9 to your computer and use it in GitHub Desktop.
Save abhishekmurthy/64f03ebb7b53e3a946c9 to your computer and use it in GitHub Desktop.
set encoding=utf-8
" tab stuff
set tabstop=4 " tab = 4
set shiftwidth=4 " indentation width
set softtabstop=4 " makes spaces feel like tabs
set expandtab " inserts softtabstop number of spaces
autocmd FileType make setlocal noexpandtab " make files must use tabs
" search stuff
set hlsearch " highlight the text matching the search pattern
set incsearch " incremental search (as you type results)
" Disable highlight when <leader><cr> is pressed
map <silent> <leader><cr> :noh<cr>
set autoread " automatically read updated files
set history=700 " long command history
set nowrap " dont wrap text at screen width
syntax on " color highlighting on
set wildmenu " tab completion for commands behaviour
set wildignore=*.o,*~,*.pyc " Ignore compiled files
set showmatch " when inserting a bracket, jump to the matching
set mat=2 " time for the jump i .1 seconds
" Turn backup off
set nobackup
set nowritebackup
set noswapfile
" edit new file without saving
set hidden
" enabling forever undo in fixed directory
if has("persistent_undo")
set undodir=~/.vim/undo/
set undofile
endif
" delete trailing white space when saving
autocmd FileType * autocmd BufWritePre <buffer> :%s/\s\+$//e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment