X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/0ab90df02f6d6585faa686fd715a41be044769b1..ba37fa63e8cdedbe958ab51a6aaddcfa4ed2f65d:/vimrc?ds=inline diff --git a/vimrc b/vimrc index 77ebad0..db95efe 100644 --- a/vimrc +++ b/vimrc @@ -3,10 +3,25 @@ " Author: Samir Benmendil " -filetype plugin indent on +filetype off +set rtp+=~/.vim/bundle/vundle/ +call vundle#rc() + +Bundle 'gmarik/vundle' +Bundle 'wincent/Command-T' +Bundle 'bling/vim-airline' +Bundle 'ctrlp.vim' +Bundle 'fugitive.vim' +Bundle 'Gundo' +Bundle 'The-NERD-tree' +Bundle 'surround.vim' +Bundle 'Syntastic' +Bundle 'Tagbar' +Bundle 'tComment' +Bundle 'Valloric/YouCompleteMe' +Bundle 'elzr/vim-json' -" pathogen.vim runtime path manipulation -silent! call pathogen#infect() +filetype plugin indent on " moving around, searching and patterns {{{1 set incsearch " show match for partly typed search command @@ -18,6 +33,17 @@ set hlsearch " highlight all matches for the last used search nmap n :silent nohl " use leader-# to display the number of matches for the last search nmap # :%s:/::gn +" center cursor after search +nnoremap n nzz +" disable arrows +inoremap +inoremap +inoremap +inoremap +noremap +noremap +noremap +noremap set nostartofline " don't move the cursor to the first non-blank char of a line set path=.,** " current + subdirectory search for :find, :grep:, ... @@ -107,6 +133,18 @@ set nrformats=hex " number formats recognized for CTRL-A and CTRL- " whether to use a popup menu for Insert mode completion set completeopt=longest,menuone,preview +" Indent if we're at the beginning of a line. Else, do completion. +function! InsertTabWrapper() + let col = col('.') - 1 + if !col || getline('.')[col - 1] !~ '\k' + return "\" + else + return "\" +endif +endfunction +inoremap =InsertTabWrapper() +inoremap + " fix legacy vi inconsistency map Y y$ @@ -159,11 +197,14 @@ set writebackup " write a backup file before overwriting a file set backup " keep a backup after owerwriting a file set backupdir=$HOME/.vim/backupdir -set undofile " persistent undo history +set undofile " persistent undo history set undodir=$HOME/.vim/backupdir set autowrite " automatically write a file when leaving a modified buffer +" save with sudo +cmap w!! w !sudo tee % > /dev/null + " command line editing {{{1 set history=500 " how many command lines are remembered set wildmode=longest:full " specifies how command line completion works @@ -219,6 +260,12 @@ let g:tagbar_autoshowtag = 1 let g:tagbar_width = 25 let g:tagbar_iconchars = ['+', '-'] +" YouCompleteMe {{{2 +let g:ycm_extra_conf_globlist = ['/mnt/data/src/*'] + +" vim-json {{{2 +let g:vim_json_syntax_conceal = 0 + " functions {{{1 " Convenient command to see the difference between the current buffer and the " file it was loaded from, thus the changes you made. @@ -227,4 +274,3 @@ if !exists(":DiffOrig") command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis \ | wincmd p | diffthis endif -