" ======================================================= " Vim configuration file " Author: Florent Demuynck " Homepage: https://www.demuynck.fr " ~/.vimrc " ======================================================= set nocompatible " be iMproved " ======================================================= " General " ======================================================= " Sets how many lines of history VIM has to remember set history=500 " Enable filetype plugins filetype plugin on filetype indent on " Set to auto read when a file is changed from the outside set autoread au FocusGained,BufEnter * checktime " :W sudo saves the file " (useful for handling the permission-denied error) command! W execute 'w !sudo tee % > /dev/null' edit! " Automatically reload instances config on vimrc change if has("autocmd") autocmd! bufwritepost .vimrc source ~/.vimrc endif " ======================================================= " VIM user interface " ======================================================= " Set 7 lines to the cursor - when moving vertically using j/k set so=7 " Turn on the Wild menu set wildmenu "Always show current position set ruler " Height of the command bar set cmdheight=1 " A buffer becomes hidden when it is abandoned set hid " Configure backspace so it acts as it should act set backspace=eol,start,indent set whichwrap+=<,>,h,l " Ignore case when searching set ignorecase " When searching try to be smart about cases set smartcase " Highlight search results set hlsearch " Makes search act like search in modern browsers set incsearch " Use to clear the highlighting of :set hlsearch. if maparg('', 'n') ==# '' nnoremap :nohlsearch=has('diff')?'diffupdate':'' endif " For regular expressions turn magic on set magic " 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 " No annoying sound on errors set noerrorbells set novisualbell set t_vb= set tm=500 " Add a bit extra margin to the left "set foldcolumn=1 " Show line numbers set number " ======================================================= " Colors and Fonts " ======================================================= " Enable syntax highlighting syntax enable "colorscheme molokai colorscheme monokai "colorscheme holokai set background=dark " Set utf8 as standard encoding and en_US as the standard language set encoding=utf8 " ======================================================= " Files, backups and undo " ======================================================= " Turn backup off, since most stuff is in SVN, git etc. anyway... set nobackup set nowb set noswapfile " ======================================================= " Text, tab and indent related " ======================================================= " Use spaces instead of tabs set expandtab " Be smart when using tabs ;) set smarttab " 1 tab == 4 spaces set shiftwidth=4 set tabstop=4 " Linebreak on 500 characters set lbr set tw=500 set ai "Auto indent set si "Smart indent set wrap "Wrap lines " ======================================================= " Plugins specific " ======================================================= " airline: integrate with powerline fonts let g:airline_powerline_fonts = 1 " airline: theme let g:airline_theme='deus' "let g:airline_theme='powerlineish' "let g:airline_theme='molokai' "let g:airline_theme='bubblegum' "let g:airline_theme='minimalist' " nerdtree: open using CTRL+n map :NERDTreeToggle " ======================================================= " Misc " ======================================================= " Disable VIM matching parenthesis highlighting "let loaded_matchparen = 1 " Automatically removing all trailing whitespace autocmd BufWritePre * %s/\s\+$//e " vim:set ft=vim et sw=2: