feat: change some keymaps
This commit is contained in:
parent
5417f99cb9
commit
cf259fd22e
|
@ -7,6 +7,8 @@ vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
||||||
-- Remap for dealing with word wrap
|
-- Remap for dealing with word wrap
|
||||||
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||||
|
vim.keymap.set('n', '<Up>', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||||
|
vim.keymap.set('n', '<Down>', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||||
|
|
||||||
-- Remap for vertical navigation
|
-- Remap for vertical navigation
|
||||||
vim.keymap.set('n', '<C-d>', '<C-d>zz', { noremap = true, silent = true })
|
vim.keymap.set('n', '<C-d>', '<C-d>zz', { noremap = true, silent = true })
|
||||||
|
@ -14,6 +16,10 @@ vim.keymap.set('n', '<C-u>', '<C-u>zz', { noremap = true, silent = true })
|
||||||
vim.keymap.set('n', 'n', 'nzzzv', { noremap = true, silent = true })
|
vim.keymap.set('n', 'n', 'nzzzv', { noremap = true, silent = true })
|
||||||
vim.keymap.set('n', 'N', 'Nzzzv', { noremap = true, silent = true })
|
vim.keymap.set('n', 'N', 'Nzzzv', { noremap = true, silent = true })
|
||||||
|
|
||||||
|
-- Remap for moving selected line / block of text in visual mode
|
||||||
|
vim.keymap.set('v', '<M-k>', ":m '<-2<cr>gv=gv", { desc = 'Move selected lines up' })
|
||||||
|
vim.keymap.set('v', '<M-j>', ":m '>+1<cr>gv=gv", { desc = 'move selected lines down' })
|
||||||
|
|
||||||
-- [[ Highlight on yank ]]
|
-- [[ Highlight on yank ]]
|
||||||
-- See `:help vim.highlight.on_yank()`
|
-- See `:help vim.highlight.on_yank()`
|
||||||
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
||||||
|
@ -32,8 +38,8 @@ vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
||||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
||||||
|
|
||||||
-- Plugins
|
-- Plugins
|
||||||
vim.keymap.set('n', '<leader>nb', ":Navbuddy<CR>", { desc = '[N]av[b]uddy' })
|
vim.keymap.set('n', '<leader>nb', ':Navbuddy<CR>', { desc = '[N]av[b]uddy' })
|
||||||
vim.keymap.set('n', '<leader>nt', ":NvimTreeToggle<CR>", { desc = '[N]vim[T]ree' })
|
vim.keymap.set('n', '<leader>nt', ':NvimTreeToggle<CR>', { desc = '[N]vim[T]ree' })
|
||||||
|
|
||||||
-- terminal keymaps
|
-- terminal keymaps
|
||||||
function _G.set_terminal_keymaps()
|
function _G.set_terminal_keymaps()
|
||||||
|
|
|
@ -54,8 +54,8 @@ return {
|
||||||
config = function()
|
config = function()
|
||||||
require('copilot_cmp').setup { clear_after_cursor = true }
|
require('copilot_cmp').setup { clear_after_cursor = true }
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>cd', ":Copilot disable<CR>", { desc = '[C]opilot [d]isable' })
|
vim.keymap.set('n', '<leader>cd', ':Copilot disable<CR>', { desc = '[C]opilot [d]isable' })
|
||||||
vim.keymap.set('n', '<leader>ce', ":Copilot enable<CR>", { desc = '[C]opilot [e]nable' })
|
vim.keymap.set('n', '<leader>ce', ':Copilot enable<CR>', { desc = '[C]opilot [e]nable' })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue