Skip to content

Instantly share code, notes, and snippets.

@nakhli
Last active August 29, 2015 14:04
Show Gist options
  • Save nakhli/e6dbe6da6a744c41f692 to your computer and use it in GitHub Desktop.
Save nakhli/e6dbe6da6a744c41f692 to your computer and use it in GitHub Desktop.
.vimrc
"Show trailing whitespaces and tabs
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$\|\t\+/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$\|\t\+/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$\|\t\+/
autocmd InsertLeave * match ExtraWhitespace /\s\+$\|\t\+/
autocmd BufWinLeave * call clearmatches()
" Show line numbers
set number
if exists('+colorcolumn')
set colorcolumn=100
end
" Always show current position
set ruler
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers
set incsearch
" Show matching brackets when text indicator is over them
set showmatch
" How many tenths of a second to blink when matching brackets
set mat=2
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Use spaces instead of tabs
set expandtab
" Be smart when using tabs ;)
set smarttab
" 1 tab == 2 spaces
set shiftwidth=2
set tabstop=2
" Linebreak on 500 characters
set lbr
set tw=500
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
set pastetoggle=<F2>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment