mappings: add <esc> working in terminal mode + <leader>y to copy
+ rename vim.keymap.set with keymap
This commit is contained in:
parent
fad7bc2ae5
commit
bbbd416de5
@ -3,36 +3,37 @@ local map_list = {
|
|||||||
["gi"] = ":bprevious", ["ge"] = ":bnext",
|
["gi"] = ":bprevious", ["ge"] = ":bnext",
|
||||||
["W"] = ":w", ["<C-t>"] = ":tabnew",
|
["W"] = ":w", ["<C-t>"] = ":tabnew",
|
||||||
}
|
}
|
||||||
for key, binding in pairs(map_list) do
|
|
||||||
vim.api.nvim_set_keymap("n", key, binding .. "<CR>", {noremap = true, silent = true})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- spelling maps
|
local keymap = vim.keymap.set
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>s", "mz[s1z=`z", {noremap = true, silent = true})
|
|
||||||
vim.api.nvim_set_keymap("n", "à", "]s", {noremap = true, silent = true})
|
for key, binding in pairs(map_list) do
|
||||||
|
keymap("n", key, binding .. "<CR>", {noremap = true, silent = true})
|
||||||
|
end
|
||||||
|
|
||||||
-- [[ kickstart.nvim ]]
|
-- [[ kickstart.nvim ]]
|
||||||
-- Keymaps for better default experience
|
-- Keymaps for better default experience
|
||||||
-- See `:help vim.keymap.set()`
|
-- See `:help remap()`
|
||||||
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
keymap({ '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 })
|
keymap('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 })
|
keymap('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||||
|
|
||||||
-- Diagnostic keymaps
|
-- Diagnostic keymaps
|
||||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
|
keymap('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
|
||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
|
keymap('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
|
||||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
|
keymap('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
|
||||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
|
keymap('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>y", '"+y', {noremap = true, silent = true})
|
keymap("n", "<Leader>y", '"+y', {noremap = true, silent = true})
|
||||||
vim.api.nvim_set_keymap("v", "<Leader>y", '"+y', {noremap = true, silent = true})
|
keymap("v", "<Leader>y", '"+y', {noremap = true, silent = true})
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>pp", '"+p', {noremap = true, silent = true})
|
keymap("n", "<Leader>p", '"+p', {noremap = true, silent = true})
|
||||||
vim.api.nvim_set_keymap("v", "<Leader>pp", '"+p', {noremap = true, silent = true})
|
keymap("v", "<Leader>p", '"+p', {noremap = true, silent = true})
|
||||||
|
|
||||||
-- z0…z9 to open folds to a certain level
|
-- z0…z9 to open folds to a certain level
|
||||||
|
|
||||||
for i=0,9 do
|
for i=0,9 do
|
||||||
vim.api.nvim_set_keymap('n', 'z' .. i , ':set fdl=' .. i .. '<CR>', {noremap = true, silent = false})
|
keymap('n', 'z' .. i , ':set fdl=' .. i .. '<CR>', {noremap = true, silent = false})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- in :terminal esc exits edit mode
|
||||||
|
keymap('t', '<Esc>', '<C-\\><C-n>', {noremap = true, silent = true})
|
||||||
|
Loading…
Reference in New Issue
Block a user