Updated config
This commit is contained in:
@ -2,47 +2,25 @@ local function map(mode, lhs, rhs, info)
|
||||
vim.keymap.set(mode, lhs, rhs, { desc = info })
|
||||
end
|
||||
|
||||
-- Basics
|
||||
map("n", ";", ":", "Command mode")
|
||||
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", "Clear search")
|
||||
map({"n", "v"}, "<leader>q", "<cmd>qa!<cr>", "Quit all")
|
||||
|
||||
-- Buffer management
|
||||
map("n", "<C-t>", "<cmd>enew<cr>", "New file")
|
||||
map({ "i", "n", "s", "v" }, "<C-s>", "<cmd>w<cr>", "Save file")
|
||||
map("n", "U", "<cmd>redo<cr>", "Redo")
|
||||
map("n", "<Bslash>", "<cmd>ToggleWord<cr>", "Toggle word")
|
||||
map("n", "<C-q>", "<cmd>close<cr>", "Close window")
|
||||
|
||||
-- Copy and paste
|
||||
map("v", "<C-c>", "y")
|
||||
map("n", "<C-v>", '"+P<right>')
|
||||
|
||||
-- Editing lines
|
||||
map({ "n", "v" }, "<C-b>", "^", "Beginning of line")
|
||||
map("i", "<C-b>", "<esc>^i", "Beginning of line")
|
||||
map({ "i", "n", "v" }, "<C-e>", "<end>", "End of line")
|
||||
map("n", "<C-l>", "^Da", "Rewrite line")
|
||||
map("i", "<C-l>", "<esc>^Da", "Rewrite line")
|
||||
map("v", "<C-l>", "V", "Select line")
|
||||
map("n", "<C-Enter>", "i<Enter>", "Split line")
|
||||
map({"n", "v"}, "<C-a>", "<esc>ggVG", "Select all")
|
||||
map("n", "<leader>l", "<cmd>Lazy<cr>", "Lazy")
|
||||
map({"n", "v"}, "<leader>q", "<cmd>qa!<cr>", "Quit all")
|
||||
map({"n", "i"}, "<esc>", "<cmd>noh<cr><esc>", "Clear search")
|
||||
map({"n", "i", "s", "v"}, "<C-s>", "<cmd>w<cr>", "Save file")
|
||||
|
||||
-- Editing multiple instances
|
||||
map("n", "<f2>", "*#:%s//<C-r><C-w>/g<left><left>", "Replace word under cursor")
|
||||
map("v", "<f2>", "y/<C-r>\"<cr>N:%s//<C-r>\"/g<left><left>", "Replace selection")
|
||||
map("n", "<f3>", "#*", "Search word under cursor")
|
||||
map("v", "<f3>", "y/<C-r>\"<cr>N", "Search selection")
|
||||
-- map("n", "<C-d>", "viw", "Select word under cursor")
|
||||
-- map("v", "<C-d>", "y/<C-r>\"<cr>N", "Search selection")
|
||||
map("n", "<C-r>", "*#:%s//<C-r><C-w>/g<left><left>", "Replace word under cursor")
|
||||
map("v", "<C-r>", "y/<C-r>\"<cr>N:%s//<C-r>\"/g<left><left>", "Replace selection")
|
||||
|
||||
-- Editing words
|
||||
map("n", "<C-w>", "ciw", "Rewrite word")
|
||||
map("n", "<Bslash>", "<cmd>ToggleWord<cr>", "Toggle word")
|
||||
|
||||
-- Indenting
|
||||
map("n", "<Tab>", "V>gv<esc>")
|
||||
map("n", "<S-Tab>", "V<gv<esc>")
|
||||
map("v", "<Tab>", ">gv")
|
||||
map("v", "<S-Tab>", "<gv")
|
||||
-- Line movement
|
||||
map({"n", "v"}, "<C-b>", "^", "Beginning of line")
|
||||
map("i", "<C-b>", "<esc>^i", "Beginning of line")
|
||||
map({"i", "n", "v"}, "<C-e>", "<end>", "End of line")
|
||||
|
||||
-- Increasing and decreasing numbers
|
||||
map("n", "+", "<C-a>", "Increase number")
|
||||
@ -50,11 +28,11 @@ map("n", "-", "<C-x>", "Decrease number")
|
||||
map("n", "<kPlus>", "<C-a>", "Increase number")
|
||||
map("n", "<kMinus>", "<C-x>", "Decrease number")
|
||||
|
||||
-- Package manager
|
||||
map("n", "<leader>l", "<cmd>Lazy<cr>", "Lazy")
|
||||
|
||||
-- Redo
|
||||
map("n", "U", "<cmd>redo<cr>", "Redo")
|
||||
-- Indenting
|
||||
map("n", "<Tab>", "V>gv<esc>")
|
||||
map("n", "<S-Tab>", "V<gv<esc>")
|
||||
map("v", "<Tab>", ">gv")
|
||||
map("v", "<S-Tab>", "<gv")
|
||||
|
||||
-- Shift arrow selection
|
||||
map("n", "<S-Up>", "v<Up>")
|
||||
@ -76,4 +54,4 @@ map("i", "<S-Right>", "<Esc>v<Right>")
|
||||
map("n", "<A-Up>", "<C-w>k", "Move to the window above")
|
||||
map("n", "<A-Down>", "<C-w>j", "Move to the window below")
|
||||
map("n", "<A-Left>", "<C-w>h", "Move to the window on the left")
|
||||
map("n", "<A-Right>", "<C-w>l", "Move to the window on the right")
|
||||
map("n", "<A-Right>", "<C-w>l", "Move to the window on the right")
|
Reference in New Issue
Block a user