Updates
This commit is contained in:
1 parent
620d42fe58
commit
ce52200ed5
12 files changed
+162
-49
No files matched your search
+84
-7
@@ -37,6 +37,7 @@ map("n", "<C-y>", "<cmd>%y+<CR>", {
|
||||
desc = "Copy whole file"
|
||||
})
|
||||
|
||||
|
||||
-- Paste
|
||||
map("n", "]p", "o<Esc>p", {
|
||||
desc = "Paste below"
|
||||
@@ -54,9 +55,10 @@ map({
|
||||
desc = "Copy to clipboard"
|
||||
})
|
||||
|
||||
-- Use jj as escape
|
||||
map('i', 'jj', '<Esc>', opts)
|
||||
map('t', 'JJ', '<C-\\><C-n>', opts)
|
||||
-- Better escape using jk in insert and terminal mode
|
||||
map("i", "jk", "<ESC>")
|
||||
map("i", "kj", "<ESC>")
|
||||
map("i", "jj", "<ESC>")
|
||||
|
||||
-- Visual overwrite paste
|
||||
map({ 'v', 'x' }, 'p', '"_dP', opts)
|
||||
@@ -80,12 +82,18 @@ map('n', 'n', 'nzzzv', opts)
|
||||
map('n', 'N', 'Nzzzv', opts)
|
||||
|
||||
-- Better up/down
|
||||
map('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
map('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
vim.keymap.set({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
vim.keymap.set({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
vim.keymap.set({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
vim.keymap.set({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
|
||||
-- Move text up and down
|
||||
map({ 'v', 'x' }, 'J', ":move '>+1<CR>gv-gv", opts)
|
||||
map({ 'v', 'x' }, 'K', ":move '<-2<CR>gv-gv", opts)
|
||||
vim.keymap.set("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move Down" })
|
||||
vim.keymap.set("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move Up" })
|
||||
vim.keymap.set("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move Down" })
|
||||
vim.keymap.set("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move Up" })
|
||||
vim.keymap.set("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move Down" })
|
||||
vim.keymap.set("v", "<A-k>", ":m '<-4<cr>gv=gv", { desc = "Move Up" })
|
||||
|
||||
-- Clear search, diff update and redraw
|
||||
map({ 'i', 'n' }, '<esc>', '<cmd>noh<cr><esc>', { desc = 'Escape and clear hlsearch' })
|
||||
@@ -107,6 +115,69 @@ map('i', ',', ',<c-g>u')
|
||||
map('i', '.', '.<c-g>u')
|
||||
map('i', ';', ';<c-g>u')
|
||||
|
||||
|
||||
-- Search
|
||||
map({
|
||||
"n",
|
||||
"x"
|
||||
}, "gw", "*N", {
|
||||
desc = "Search word under cursor"
|
||||
})
|
||||
|
||||
|
||||
-- Insert empty line in insert mode
|
||||
map("i", "<A-o>", "<C-O>o", {
|
||||
desc = "Insert empty line below"
|
||||
})
|
||||
map("i", "<A-O>", "<C-O>O", {
|
||||
desc = "Insert empty line above"
|
||||
})
|
||||
|
||||
-- Insert empty line without entering insert mode
|
||||
map('n', '[o', ':<C-u>call append(line("."), repeat([""], v:count1))<CR>', {
|
||||
desc = "Insert empty line below"
|
||||
})
|
||||
map('n', ']o', ':<C-u>call append(line(".")-1, repeat([""], v:count1))<CR>', {
|
||||
desc = "Insert empty line above"
|
||||
})
|
||||
|
||||
-- go to beginning and end in insert mode
|
||||
map("i", "<A-b>", "<ESC>^i", {
|
||||
desc = "Go to beginning of line"
|
||||
})
|
||||
map("i", "<A-e>", "<End>", {
|
||||
desc = "Go to end of line"
|
||||
})
|
||||
|
||||
-- navigate within insert mode
|
||||
map("i", "<C-h>", "<Left>", {
|
||||
desc = "Move Left"
|
||||
})
|
||||
map("i", "<C-l>", "<Right>", {
|
||||
desc = "Move Right"
|
||||
})
|
||||
map("i", "<C-j>", "<Down>", {
|
||||
desc = "Move Down"
|
||||
})
|
||||
map("i", "<C-k>", "<Up>", {
|
||||
desc = "Move Up"
|
||||
})
|
||||
|
||||
|
||||
-- Move to window using the <ctrl> hjkl keys
|
||||
vim.keymap.set("n", "<C-h>", "<C-w>h", { desc = "Go to Left Window", remap = true })
|
||||
vim.keymap.set("n", "<C-j>", "<C-w>j", { desc = "Go to Lower Window", remap = true })
|
||||
vim.keymap.set("n", "<C-k>", "<C-w>k", { desc = "Go to Upper Window", remap = true })
|
||||
vim.keymap.set("n", "<C-l>", "<C-w>l", { desc = "Go to Right Window", remap = true })
|
||||
|
||||
|
||||
-- Resize window using <ctrl> arrow keys
|
||||
vim.keymap.set("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase Window Height" })
|
||||
vim.keymap.set("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease Window Height" })
|
||||
vim.keymap.set("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease Window Width" })
|
||||
vim.keymap.set("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase Window Width" })
|
||||
|
||||
|
||||
-- Codeium
|
||||
map('i', '<M-;>', function () return vim.fn['codeium#Accept']() end, { expr = true, silent = true })
|
||||
map('i', '<M-]>', function() return vim.fn['codeium#CycleCompletions'](1) end, { expr = true, silent = true })
|
||||
@@ -119,3 +190,9 @@ map('n', '<leader>e', function()
|
||||
require("oil").toggle_float()
|
||||
end, { desc = icons.documents.OpenFolder .. 'Oil File Explorer' })
|
||||
|
||||
|
||||
map('n', '<leader>mu', function()
|
||||
require("notify").dismiss({ silent = true, pending = true })
|
||||
end, { desc = 'Dismiss All Notifications' })
|
||||
|
||||
|
||||
Reference in new issue
Block a user