Restructure vim config

This commit is contained in:
2016-07-05 21:29:27 +01:00
parent 5465bef85d
commit e26b13c742
6 changed files with 334 additions and 299 deletions

59
plugin/mappings.vim Normal file
View File

@@ -0,0 +1,59 @@
" YouCompleteMe
nnoremap <leader>fx :YcmCompleter FixIt<CR>
nnoremap <leader>jd :YcmCompleter GoTo<CR>
nnoremap <leader>gt :YcmCompleter GetType<CR>
nnoremap <leader>gp :YcmCompleter GetParent<CR>
nnoremap <leader>gd :YcmCompleter GetDoc<CR>
nnoremap <leader>sd :YcmShowDetailedDiagnostic<CR>
" DoxygenToolkit
nnoremap <leader>d :Dox<CR>
" Treat long lines as line containing breaks
nnoremap j gj
nnoremap k gk
" Quick write
map <leader>w :w!<CR>
" Switch panes
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Quick tabs
exec "nmap <leader>tn :tabnew "
nmap <leader>tc :tabclose<CR>
nmap <leader>to :tabonly<CR>
exec "nmap <leader>tm :tabmove "
" Clear search highlights
map <leader><Space> :noh<CR>
" Quick clipboard yank/put
map <leader>y "+y
map <leader>Y "+Y
map <leader>p "+p
map <leader>P "+P
" Jump to current location list item
nmap <leader>ll :ll<CR>
" Jump to next location list item
nmap <leader>ln :lnext<CR>
" Jump to previous location list item
nmap <leader>lp :lprevious<CR>
" Quickly access spelling menu
imap <C-s> <C-g>u<C-X>s
nmap <C-s> i<C-g>u<C-X>s
" Disable 'Q' from opening Ex mode
nmap Q <nop>
" Disable 'K' from loading man pages in normal mode
nmap K <nop>
" Disable 'K' from loading man pages in visual mode
vmap K <nop>
" Split line at the cursor
nnoremap [j i<CR><Esc>
nnoremap ]j a<CR><Esc>