Skip to content

Instantly share code, notes, and snippets.

@FelipeCortez
Last active August 29, 2015 14:00
Show Gist options
  • Save FelipeCortez/11070118 to your computer and use it in GitHub Desktop.
Save FelipeCortez/11070118 to your computer and use it in GitHub Desktop.
Simplified .vimrc
syntax on
filetype plugin indent on
set encoding=utf-8
set showcmd
set relativenumber
set noswapfile
set undofile
set undodir=~/.vim/undo
set undolevels=1000
set undoreload=10000
" Show dots on trailing whitespace
set list
set listchars=tab:>.,trail:.,extends:#,nbsp:.
" Whitespace
set nowrap
set textwidth=79
set expandtab
set tabstop=8
set shiftwidth=4
set softtabstop=4
set shiftround
set backspace=indent,eol,start
set autoindent
set copyindent
set hlsearch
set incsearch
set ignorecase
set smartcase
" Folding
set foldmethod=indent
set foldlevel=99
" zsh-like tab completion
set wildmenu
set wildmode=full
" Maps space to folds
nnoremap <Space> za
vnoremap <Space> za
" Maps leaderspace to nohlsearch
nnoremap <leader><space> :noh<cr>
function! TrimWhiteSpace()
%s/\s\+$//e
endfunction
nmap <leader>w :call TrimWhiteSpace()<cr>
" Reloads vimrc automatically
augroup myvimrc
au!
au BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc so $MYVIMRC | if has('gui_running') | endif
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment