2019-02-22 15:50:11 +00:00
|
|
|
" key mappings
|
|
|
|
let mapleader = ","
|
2019-02-24 12:54:41 +00:00
|
|
|
nmap <Leader>s :update<CR>
|
2019-02-22 15:50:11 +00:00
|
|
|
nmap <leader>p :set paste!<CR>
|
|
|
|
nmap <leader>h :set hlsearch!<CR>
|
|
|
|
nmap <leader>t :wa <bar> :Make test<CR>
|
|
|
|
|
|
|
|
" navigate buffers by ctrl-b
|
|
|
|
nmap <C-b> :bprevious<CR>
|
2019-02-22 16:08:40 +00:00
|
|
|
nmap <C-B> :bnext<CR>
|
2019-02-22 15:50:11 +00:00
|
|
|
|
|
|
|
nnoremap ; :
|
|
|
|
|
|
|
|
" no cheating !
|
|
|
|
map <up> <nop>
|
|
|
|
map <down> <nop>
|
|
|
|
map <left> <nop>
|
|
|
|
map <right> <nop>
|
|
|
|
|
|
|
|
" for damaged keyboards
|
|
|
|
map <F1> <Esc>
|
|
|
|
imap <F1> <Esc>
|
|
|
|
|
|
|
|
" special chars
|
|
|
|
nmap <leader>l :set list!<CR>
|
|
|
|
|
2019-02-24 12:54:41 +00:00
|
|
|
" search/navigate project structure
|
|
|
|
nmap <leader>/ :LspWorkspaceSymbol<CR>
|
|
|
|
nmap <leader>r :LspReferences<CR>
|
|
|
|
nmap <leader>d :LspDeclaration<CR>
|
|
|
|
nmap <leader>D :LspDefinition<CR>
|
2019-02-24 13:17:49 +00:00
|
|
|
nmap <leader>e :LspNextError<CR>
|
2019-02-24 12:54:41 +00:00
|
|
|
nmap <leader><CR> :LspCodeAction<CR>
|
2019-02-25 16:12:27 +00:00
|
|
|
nmap <leader>f :Rg
|
2019-02-22 16:08:40 +00:00
|
|
|
" tree
|
|
|
|
map <leader>n :NERDTreeToggle<CR>
|
2019-02-23 09:15:44 +00:00
|
|
|
|
2019-02-24 12:54:41 +00:00
|
|
|
" quickfix
|
|
|
|
nmap <leader>q <Plug>window:quickfix:toggle
|
2019-02-23 09:15:44 +00:00
|
|
|
|
2019-02-24 12:54:41 +00:00
|
|
|
" completion
|
2019-02-23 09:15:44 +00:00
|
|
|
function! s:check_back_space() abort
|
|
|
|
let col = col('.') - 1
|
|
|
|
return !col || getline('.')[col - 1] =~ '\s'
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
inoremap <silent><expr> <TAB>
|
|
|
|
\ pumvisible() ? "\<C-n>" :
|
|
|
|
\ <SID>check_back_space() ? "\<TAB>" :
|
|
|
|
\ asyncomplete#force_refresh()
|
2019-02-24 12:54:41 +00:00
|
|
|
|
|
|
|
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
|
|
|
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
|
|
|
|
|
|
|
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>"
|
|
|
|
imap <c-space> <Plug>(asyncomplete_force_refresh)
|