Updated config

This commit is contained in:
2024-03-05 00:40:49 +01:00
parent 29a8811800
commit 307d253d9e
17 changed files with 196 additions and 120 deletions

View File

@ -6,7 +6,16 @@ end
map("n", ";", ":", "Command mode")
map("n", "U", "<cmd>redo<cr>", "Redo")
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", "Clear search")
map({"n", "v"}, "qq", "<cmd>qa!<cr>", "Quit all")
map({"n", "v"}, "<leader>q", "<cmd>qa!<cr>", "Quit all")
-- Buffer management
map("n", "<C-n>", "<cmd>enew<cr>", "New file")
map({ "i", "n", "s", "v" }, "<C-s>", "<cmd>w<cr><esc>", "Save file")
map("n", "<C-q>", "<cmd>bd<cr>", "Delete buffer")
-- Copy and paste
map("v", "<C-c>", "y")
map("n", "<C-v>", '"+P<right>')
-- Editing lines
map({ "n", "v" }, "<C-b>", "^", "Beginning of line")
@ -15,6 +24,7 @@ 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")
-- Editing multiple instances
@ -25,27 +35,22 @@ 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")
-- Increasing and decreasing numbers
map("n", "+", "<C-a>", "Increase number")
map("n", "-", "<C-x>", "Decrease number")
map("n", "<kPlus>", "<C-a>", "Increase number")
map("n", "<kMinus>", "<C-x>", "Decrease number")
-- Buffer management
map("n", "<C-n>", "<cmd>enew<cr>", "New file")
map({ "i", "n", "s", "v" }, "<C-s>", "<cmd>w<cr><esc>", "Save file")
map("n", "<C-q>", "<cmd>bd<cr>", "Delete buffer")
-- Copy and paste
map("v", "<C-c>", "y")
map("n", "<C-v>", '"+p')
-- Indenting
map("n", "<Tab>", "V>gv<esc>")
map("n", "<S-Tab>", "V<gv<esc>")
map("v", "<Tab>", ">gv")
map("v", "<S-Tab>", "<gv")
-- Increasing and decreasing numbers
map("n", "+", "<C-a>", "Increase number")
map("n", "-", "<C-x>", "Decrease number")
map("n", "<kPlus>", "<C-a>", "Increase number")
map("n", "<kMinus>", "<C-x>", "Decrease number")
map("n", "<Bslash>", "<cmd>ToggleWord<cr>", "Toggle word")
-- Package manager
map("n", "<leader>l", "<cmd>Lazy<cr>", "Lazy")
-- Shift arrow selection
map("n", "<S-Up>", "v<Up>")
map("n", "<S-Down>", "v<Down>")
@ -61,6 +66,3 @@ map("i", "<S-Up>", "<Esc>v<Up>")
map("i", "<S-Down>", "<Esc>v<Down>")
map("i", "<S-Left>", "<Esc>v<Left>")
map("i", "<S-Right>", "<Esc>v<Right>")
-- Package manager
map("n", "<leader>l", "<cmd>Lazy<cr>", "Lazy")