chore(nvim): update mappings
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Rob Watson 2025-01-10 06:19:59 +01:00
parent 6b8bfad38d
commit 8d45a4cc6e
2 changed files with 7 additions and 8 deletions

13
nvimrc
View File

@ -193,14 +193,11 @@ function! OpenGitURLToLineOrRange() range
endif
endfunction
nnoremap <leader>as :Git<cr>
nnoremap <leader>ab :Git blame<cr>
nnoremap <leader>ac :Commits<cr>
nnoremap <leader>af gg0jVG:s/^pick/fixup/<cr> \| :redraw!<cr>:wq
nnoremap <leader>aY :call CopyGitURLToLineOrRange()<cr>
vnoremap <leader>aY :call CopyGitURLToLineOrRange()<cr>
nnoremap <leader>ao :call OpenGitURLToLineOrRange()<cr>
nnoremap <leader>ap :execute 'silent !ghpr <c-r><c-f>' \| redraw!<cr>
nnoremap <leader>gb :Git blame<cr>
nnoremap <leader>gf gg0jVG:s/^pick/fixup/<cr> \| :redraw!<cr>:wq
nnoremap <leader>gy :call CopyGitURLToLineOrRange()<cr>
vnoremap <leader>gy :call CopyGitURLToLineOrRange()<cr>
nnoremap <leader>go :call OpenGitURLToLineOrRange()<cr>
" echo filename of current buffer:
nmap <leader>fe :echom expand("%:p")<cr>

View File

@ -16,9 +16,11 @@ local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>r", "<Cmd>lua vim.lsp.buf.references()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>i", "<Cmd>lua vim.lsp.buf.implementation()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>ca", "<Cmd>lua vim.lsp.buf.code_action()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "v", "<leader>ca", "<Cmd>lua vim.lsp.buf.code_action()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>ci", "<Cmd>lua vim.lsp.buf.incoming_calls()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>co", "<Cmd>lua vim.lsp.buf.outgoing_calls()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "v", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "]e", '<Cmd>lua vim.diagnostic.goto_next({severity="Error"})<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "[e", '<Cmd>lua vim.diagnostic.goto_prev({severity="Error"})<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", "<Cmd>lua vim.diagnostic.goto_next()<CR>", opts)