diff options
Diffstat (limited to 'vimrc')
| -rw-r--r-- | vimrc | 94 |
1 files changed, 94 insertions, 0 deletions
@@ -0,0 +1,94 @@ +" vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 + +if &compatible + set nocompatible +endif + +" Paths +set directory=$XDG_CACHE_HOME/vim,~/,/tmp +set backupdir=$XDG_CACHE_HOME/vim,~/,/tmp +set viminfo+=n$XDG_CACHE_HOME/vim/viminfo +set runtimepath=$XDG_CONFIG_HOME/vim,$XDG_CONFIG_HOME/vim/after,$VIM,$VIMRUNTIME +let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" + +" Plugins +" After plugins changes remember to run :call dein#install() +set runtimepath+=~/.vim/dein/repos/github.com/Shougo/dein.vim +call dein#begin(expand('~/.vim/dein')) +call dein#add('Shougo/dein.vim') +call dein#add('majutsushi/tagbar') +call dein#add('scrooloose/nerdtree', + \{'on_cmd': 'NERDTreeToggle'}) +call dein#add('justmao945/vim-clang', + \{'on_ft': ['c', 'cpp']}) +call dein#end() + +filetype plugin indent on +syntax enable + +" Plugins config +let g:clang_c_options = '-std=gnu11' +let g_clang_cpp_options = '-std=c++11 -stdlib=libc++' + +" Encoding +set encoding=utf-8 +set fileencoding=utf-8 +set termencoding=utf-8 + +" Misc +set paste " setting good paste +set colorcolumn=79 " highlight 80 characters limit + +" Whitespace +set nowrap " don't wrap lines +set tabstop=4 shiftwidth=4 " a tab is four spaces +set expandtab " use spaces instead of tabs +set backspace=indent,eol,start " backspace through everything in insert mode + +" Style +colorscheme tomorrow_night " set color scheme +set relativenumber " setting line numbers +set ruler " show column number +set laststatus=2 " always show the status line + +" Searching +set hlsearch " highlight matches +set incsearch " incremental searching +set ignorecase " search are case-insensitive +set smartcase " enable case-sensitivity if the pattern + " contains a capital letter + +" Key bindings +nmap <F2> :NERDTreeToggle<CR> " toggle file browser with F2 +nmap <F8> :TagbarToggle<CR> " toggle tags browser with F8 + +" Highlight extra whitespaces +highlight ExtraWhitespace ctermbg=red +autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ + +" Python files +autocmd BufRead,BufNewFile *.py :setlocal + \ tabstop=4 + \ softtabstop=4 + \ shiftwidth=4 + \ textwidth=79 + \ expandtab + \ autoindent + \ fileformat=unix + +" Shell scripts +autocmd BufRead,BufNewFile *.sh,*.ksh,*.csh :setlocal + \ tabstop=2 + \ softtabstop=2 + \ shiftwidth=2 + \ textwidth=79 + \ expandtab + \ autoindent + \ fileformat=unix + +" Web files: JavaScript, HTML and CSS +autocmd BufRead,BufNewFile *.js,*.html,*.css :setlocal + \ tabstop=2 + \ softtabstop=2 + \ shiftwidth=2 + \ expandtab |
