vimrc/mapping.vim

49 lines
2 KiB
VimL
Raw Normal View History

" quickly clear Syntastic info
nmap <F4> :SyntasticReset<CR>
" toggle gundo's display
2021-09-16 22:25:31 +00:00
nmap <F5> :UndotreeToggle<CR>
" quickly toggle a left, vsplit for an insanely powerful file explorer
nmap <F8> :NERDTreeToggle<CR>
" open tree to current buffer
nmap <S-F8> :NERDTreeFind<CR>
2019-05-15 16:19:45 +00:00
" use similar key, esc, to exit terminal mode
tnoremap <C-Space><Esc> <C-\><C-n>
2021-09-06 20:57:07 +00:00
" from: https://sharksforarms.dev/posts/neovim-rust/
" Code navigation shortcuts
nnoremap <silent> <c-]> <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
nnoremap <silent> gD <cmd>lua vim.lsp.buf.implementation()<CR>
nnoremap <silent> <c-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
nnoremap <silent> 1gD <cmd>lua vim.lsp.buf.type_definition()<CR>
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR>
nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR>
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR>
2021-09-16 22:18:44 +00:00
nnoremap <silent> <Leader>rn <cmd>lua vim.lsp.buf.rename()<CR>
2021-09-06 20:57:07 +00:00
" Goto previous/next diagnostic warning/error
2022-04-17 16:54:36 +00:00
nnoremap <silent> g[ <cmd>lua vim.diagnostic.goto_prev()<CR>
nnoremap <silent> g] <cmd>lua vim.diagnostic.goto_next()<CR>
2022-04-20 20:40:41 +00:00
nnoremap <silent> gE <cmd>lua vim.diagnostic.setloclist()<CR>
2022-07-27 16:59:17 +00:00
" work with Trouble to view lists of diagnostic warnings/errors
nnoremap <leader>xx <cmd>TroubleToggle<cr>
nnoremap <leader>xw <cmd>TroubleToggle workspace_diagnostics<cr>
nnoremap <leader>xd <cmd>TroubleToggle document_diagnostics<cr>
nnoremap <leader>xq <cmd>TroubleToggle quickfix<cr>
nnoremap <leader>xl <cmd>TroubleToggle loclist<cr>
2022-07-27 16:59:17 +00:00
nnoremap gR <cmd>TroubleToggle lsp_references<cr>
nnoremap <leader>t <cmd>e ~/Documents/Wiki/tags.md<cr>
nnoremap <leader>tr <cmd>VimwikiRebuildTags<cr>
nnoremap <leader>tg <cmd>VimwikiGenerateTagLinks<cr>
function! VimwikiFindAllIncompleteTasks()
lvimgrep /- \[ \]/ *
lopen
endfunction
nmap <Leader>wa :call VimwikiFindAllIncompleteTasks()<CR>