Add keymaps
This commit is contained in:
parent
df3391a4cf
commit
5cca66915a
|
@ -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 })
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue