feat: add more mappings

This commit is contained in:
tsorabel-pc 2024-03-06 23:02:01 +01:00 committed by tsorabel
parent f1894507ad
commit 504fc007d3
3 changed files with 22 additions and 7 deletions

View file

@ -734,7 +734,6 @@ require('lazy').setup({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
{ name = 'tsserver' },
},
}
end,
@ -872,3 +871,22 @@ require('lazy').setup({
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
--
local map = vim.keymap.set
-- Set current wordl
map({ 'n' }, '<leader>cw', ':%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>', { desc = '[C]ut [W]orld' })
-- Close buffer
map({ 'n' }, '<leader>x', '<cmd>bd<CR>', { desc = 'Close buffer' })
-- misc mappings
map('n', 'n', 'nzzzv')
map('n', 'N', 'Nzzzv')
-- Create new vertical buffer
map({ 'n' }, '<leader>wb', '<cmd>vs<CR>', { desc = 'New [W]orkspace [B]uffer' })
-- Resize buffer (width)
map({ 'n' }, '<C-m>', '<cmd>vertical res -5^M<CR>', { desc = 'Buffer - width' })
map({ 'n' }, '<C-n>', '<cmd>vertical res +5^M<CR>', { desc = 'Buffer + width' })