mirror of
https://github.com/nvim-lua/kickstart.nvim.git
synced 2025-12-07 09:35:37 -08:00
Add keymaps
This commit is contained in:
9
lua/custom/keymaps.lua
Normal file
9
lua/custom/keymaps.lua
Normal 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 })
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user