keybinds: some renames and add terminal escape
This commit is contained in:
parent
be676d0b07
commit
417197d303
|
@ -18,7 +18,7 @@ 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' })
|
||||
vim.keymap.set('v', '<M-j>', ":m '>+1<cr>gv=gv", { desc = 'Move selected lines down' })
|
||||
|
||||
-- [[ Highlight on yank ]]
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
|
@ -37,18 +37,7 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
|||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
||||
|
||||
-- terminal keymaps
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = { buffer = 0 }
|
||||
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
|
||||
vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]], opts)
|
||||
vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd j<CR>]], opts)
|
||||
vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], opts)
|
||||
vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]], opts)
|
||||
end
|
||||
|
||||
--
|
||||
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
|
||||
vim.cmd 'autocmd! TermOpen term://* lua set_terminal_keymaps()'
|
||||
-- terminal
|
||||
vim.keymap.set('t', '<C-x>', vim.api.nvim_replace_termcodes('<C-\\><C-N>', true, true, true), { desc = 'Escape terminal mode' })
|
||||
|
||||
return {}
|
||||
|
|
Loading…
Reference in New Issue