nmap <silent> <Leader>n :silent nohl<CR>
" use leader-# to display the number of matches for the last search
nmap <Leader># :%s:<C-R>/::gn<CR>
+" center cursor after search
+nnoremap n nzz
+" disable arrows
+inoremap <Up> <NOP>
+inoremap <Down> <NOP>
+inoremap <Left> <NOP>
+inoremap <Right> <NOP>
+noremap <Up> <NOP>
+noremap <Down> <NOP>
+noremap <Left> <NOP>
+noremap <Right> <NOP>
set nostartofline " don't move the cursor to the first non-blank char of a line
set path=.,** " current + subdirectory search for :find, :grep:, ...
" 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 "\<Tab>"
+ else
+ return "\<C-N>"
+endif
+endfunction
+inoremap <Tab> <C-R>=InsertTabWrapper()<CR>
+inoremap <S-Tab> <C-P>
+
" fix legacy vi inconsistency
map Y y$
let g:tagbar_width = 25
let g:tagbar_iconchars = ['+', '-']
+" YouCompleteMe {{{2
+let g:ycm_extra_conf_globlist = ['/mnt/data/src/*']
+
" functions {{{1
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
-
-" Indent if we're at the beginning of a line. Else, do completion0.
-function! InsertTabWrapper()
- let col = col('.') - 1
- if !col || getline('.')[col - 1] !~ '\k'
- return "\<tab>"
- else
- return "\<c-p>"
-endif
-endfunction
-inoremap <tab> <c-r>=InsertTabWrapper()<cr>
-inoremap <s-tab> <c-n>