48 lines
2 KiB
VimL
48 lines
2 KiB
VimL
" quickly clear Syntastic info
|
|
nmap <F4> :SyntasticReset<CR>
|
|
" toggle gundo's display
|
|
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 <F9> :NERDTreeFind<CR>
|
|
" use similar key, esc, to exit terminal mode
|
|
tnoremap <C-Space><Esc> <C-\><C-n>
|
|
|
|
" 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>
|
|
nnoremap <silent> <Leader>rn <cmd>lua vim.lsp.buf.rename()<CR>
|
|
|
|
" Goto previous/next diagnostic warning/error
|
|
nnoremap <silent> g[ <cmd>lua vim.diagnostic.goto_prev()<CR>
|
|
nnoremap <silent> g] <cmd>lua vim.diagnostic.goto_next()<CR>
|
|
nnoremap <silent> gE <cmd>lua vim.diagnostic.setloclist()<CR>
|
|
|
|
" 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>
|
|
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>
|