diff --git a/lua/custom/keymaps.lua b/lua/custom/keymaps.lua new file mode 100644 index 00000000..7c120aa2 --- /dev/null +++ b/lua/custom/keymaps.lua @@ -0,0 +1,9 @@ +-- vim.keymap.set('n', '', 'nohlsearch') +vim.keymap.set('n', 'l', ':set hlsearch!', { noremap = true, silent = true, desc = 'Toggle highlight search' }) + +-- Map Ctrl-s to save the file in normal and insert mode +vim.keymap.set('n', '', ':w', { noremap = true, silent = true }) +vim.keymap.set('i', '', ':w', { noremap = true, silent = true }) + +-- Map Ctrl-c to yank (copy) the selected text in visual mode +vim.api.nvim_set_keymap('v', '', '"+y', { noremap = true, silent = true }) diff --git a/lua/custom/options.lua b/lua/custom/options.lua index c12ba5c3..0c376db4 100644 --- a/lua/custom/options.lua +++ b/lua/custom/options.lua @@ -4,3 +4,4 @@ vim.opt.smarttab = true -- Enable smarttab vim.opt.expandtab = true -- Convert tabs to spaces vim.opt.smartindent = true -- Enable smart indentation vim.opt.autoindent = true -- Enable auto indentation +vim.opt.relativenumber = true