add vim keybindings
This commit is contained in:
parent
aca0eba96e
commit
905217ab20
1 changed files with 14 additions and 6 deletions
20
vim/.vimrc
20
vim/.vimrc
|
@ -207,11 +207,14 @@ nmap <silent> <space>w<space>w :call mkdir(strftime("diary/%Y/%m"), "p", 0755) \
|
||||||
"" Keymappings
|
"" Keymappings
|
||||||
""
|
""
|
||||||
|
|
||||||
" Other key mappings
|
|
||||||
map <C-n> :NERDTreeToggle<CR>
|
|
||||||
nmap <leader>N :NERDTreeFocus<CR>
|
|
||||||
" Removes trailing whitespaces
|
" Removes trailing whitespaces
|
||||||
nnoremap <leader>s :keeppattern %s/\s\+$//<CR>
|
nnoremap <leader>s :keeppattern %s/\s\+$//<CR>
|
||||||
|
nnoremap <A-Down> :m .+1<CR>==
|
||||||
|
nnoremap <A-Up> :m .-2<CR>==
|
||||||
|
inoremap <A-Down> <Esc>:m .+1<CR>==gi
|
||||||
|
inoremap <A-Up> <Esc>:m .-2<CR>==gi
|
||||||
|
vnoremap <A-Down> :m '>+1<CR>gv=gv
|
||||||
|
vnoremap <A-Up> :m '<-2<CR>gv=gv
|
||||||
|
|
||||||
" Quickfix and location lists key mappings
|
" Quickfix and location lists key mappings
|
||||||
nmap <space>cf :cfirst<CR>
|
nmap <space>cf :cfirst<CR>
|
||||||
|
@ -227,6 +230,14 @@ nmap <space>lc :lclose<CR>
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.tmpl set syntax=gohtmltmpl
|
autocmd BufNewFile,BufRead *.tmpl set syntax=gohtmltmpl
|
||||||
|
|
||||||
|
" Easier to exit terminal insert mode with Esc
|
||||||
|
tnoremap <Esc> <C-\><C-n>
|
||||||
|
|
||||||
|
|
||||||
|
" Nerdtree mappings
|
||||||
|
map <C-n> :NERDTreeToggle<CR>
|
||||||
|
nmap <leader>N :NERDTreeFocus<CR>
|
||||||
|
|
||||||
" Coc mappings
|
" Coc mappings
|
||||||
nmap <silent> gd <Plug>(coc-definition)
|
nmap <silent> gd <Plug>(coc-definition)
|
||||||
nmap <silent> gy <Plug>(coc-type-definition)
|
nmap <silent> gy <Plug>(coc-type-definition)
|
||||||
|
@ -296,6 +307,3 @@ if has("autocmd")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
nmap <space>w :w<CR>
|
nmap <space>w :w<CR>
|
||||||
|
|
||||||
" Easier to exit terminal insert mode with Esc
|
|
||||||
tnoremap <Esc> <C-\><C-n>
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue