Add keymaps

This commit is contained in:
dla 2024-09-12 18:02:57 +07:00
parent df3391a4cf
commit 5cca66915a
2 changed files with 10 additions and 0 deletions

9
lua/custom/keymaps.lua Normal file
View File

@ -0,0 +1,9 @@
-- vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
vim.keymap.set('n', '<leader>l', ':set hlsearch!<CR>', { noremap = true, silent = true, desc = 'Toggle highlight search' })
-- Map Ctrl-s to save the file in normal and insert mode
vim.keymap.set('n', '<C-s>', ':w<CR>', { noremap = true, silent = true })
vim.keymap.set('i', '<C-s>', '<Esc>:w<CR>', { noremap = true, silent = true })
-- Map Ctrl-c to yank (copy) the selected text in visual mode
vim.api.nvim_set_keymap('v', '<C-c>', '"+y', { noremap = true, silent = true })

View File

@ -4,3 +4,4 @@ vim.opt.smarttab = true -- Enable smarttab
vim.opt.expandtab = true -- Convert tabs to spaces vim.opt.expandtab = true -- Convert tabs to spaces
vim.opt.smartindent = true -- Enable smart indentation vim.opt.smartindent = true -- Enable smart indentation
vim.opt.autoindent = true -- Enable auto indentation vim.opt.autoindent = true -- Enable auto indentation
vim.opt.relativenumber = true