This commit is contained in:
sankalp committed 2024-11-05 14:07:43 +05:45
1 parent bd932cf5e1
commit a4647b1cae
69 files changed
+12974 -5399

No files matched your search

+69 -1
View File
@@ -15,7 +15,23 @@ vim.g.maplocalleader = ' '
-- visual_block_mode = "x", term_mode = "t", command_mode = "c",
-- Comment
map({ 'n', 'v' }, '<leader>/', 'gcc', { remap = true })
map({ 'n', 'v' }, '<leader>/', 'gcc', { desc = 'Comment toggle', remap = true })
map({ 'v', 'x' }, '<leader>/', 'gc', { desc = 'Comment toggle', remap = true })
-- save file
map({ 'x', 'i', 'n', 's' }, '<C-s>', '<cmd>w<cr>', { desc = 'Save File' })
-- Shortcut for surrounding a word (inner) with a '
map('n', 'S', '<nop>') -- Don't keep S mapping
map('n', 'Sq', "Siw'", { desc = "Wrap word with '", remap = true })
map('n', 'Sp', 'SiW(', { desc = 'Wrap word with ()', remap = true })
map('n', 'Sb', 'Saw}', { desc = 'Wrap word with {}', remap = true })
-- Remove all text
map('n', '<leader>r', '<cmd>%d+<cr>', { desc = 'General | Remove All Text', silent = true })
-- Able to use semicolon in normal mode
map('n', ';', ':', { desc = '; Command mode' })
-- Select all
map('n', '<C-a>', 'gg<S-v>G')
@@ -84,3 +100,55 @@ map('n', 'd', '"_d', { desc = 'Delete without replacing clipboad' })
map('n', 'x', '"_x', { desc = 'Cut without replacing clipboad' })
map('n', 'c', '"_c', { desc = 'Change without replacing clipboad' })
map('v', 'p', '"_dP', { desc = 'Paste without replacing clipboard' })
map('n', '<leader>oz', function()
---@diagnostic disable-next-line: undefined-field
if vim.opt.foldcolumn:get() == '0' then
vim.opt.foldcolumn = '1'
else
vim.opt.foldcolumn = '0'
end
end, { desc = 'Toggle foldcolumn' })
map('n', '<leader>op', function()
vim.g.minipairs_disable = not vim.g.minipairs_disable and true or false
end, { desc = 'Toggle mini.pairs' })
-- -- Indent backward
-- vim.keymap.set("n", "<", "<<", { desc = "General | Indent backward", silent = true })
--
-- -- Indent forward
-- vim.keymap.set("n", ">", ">>", { desc = "General | Indent forward", silent = true })
--
-- -- Move the line up
-- vim.keymap.set("n", "<A-j>", "<cmd>m .+1<CR>==", { desc = "General | Move the line up", silent = true })
--
-- -- Move the line down
-- vim.keymap.set("n", "<A-k>", "<cmd>m .-2<CR>==", { desc = "General | Move the line down", silent = true })
--
-- -- Move the line up (Insert Mode)
-- vim.keymap.set("i", "<A-j>", "<Esc>:m .+1<CR>==gi", { desc = "General | Move the line up", silent = true })
--
-- -- Move the line down (Insert Mode)
-- vim.keymap.set("i", "<A-k>", "<Esc>:m .-2<CR>==gi", { desc = "General | Move the line down", silent = true })
--
-- -- Better Down (Visual Mode)
-- vim.keymap.set("v", "j", "v:count == 0 ? 'gj' : 'j'", { desc = "General | Better Down", expr = true, silent = true })
--
-- -- Better Up (Visual Mode)
-- vim.keymap.set("v", "k", "v:count == 0 ? 'gk' : 'k'", { desc = "General | Better Up", expr = true, silent = true })
--
-- -- Better Paste (Visual Mode)
-- vim.keymap.set("v", "p", '"_dP', { desc = "General | Better Paste", silent = true })
--
-- -- Indent backward (Visual Mode)
-- vim.keymap.set("v", "<", "<gv", { desc = "General | Indent backward", silent = true })
--
-- -- Indent forward (Visual Mode)
-- vim.keymap.set("v", ">", ">gv", { desc = "General | Indent forward", silent = true })
--
-- -- Move the selected text up (Visual Mode)
-- vim.keymap.set("v", "<A-j>", "<cmd>m '>+1<CR>gv=gv", { desc = "General | Move the selected text up", silent = true })
--
-- -- Move the selected text down (Visual Mode)
-- vim.keymap.set("v", "<A-k>", "<cmd>m '<-2<CR>gv=gv", { desc = "General | Move the selected text down", silent = true })