local opts = { noremap = true, silent = true } vim.keymap.set('n', '', 'nil', opts) -- Tabs vim.keymap.set('n', '', ':tabnext', opts) vim.keymap.set('n', '', ':tabprevious', opts) -- Split movement vim.keymap.set('n', '', ':wincmd k', opts) vim.keymap.set('n', '', ':wincmd j', opts) vim.keymap.set('n', '', ':wincmd h', opts) vim.keymap.set('n', '', ':wincmd l', opts) vim.keymap.set('n', '', ':wa | wshada') -- Linewrap and jumping vim.keymap.set({ 'n', 'x' }, 'k', 'gk', opts) vim.keymap.set({ 'n', 'x' }, 'j', 'gj', opts) vim.keymap.set({ 'n', 'x' }, '0', 'g0', opts) vim.keymap.set({ 'n', 'x' }, '$', 'g$', opts) vim.keymap.set({ 'n', 'x' }, '', 'gk', opts) vim.keymap.set({ 'n', 'x' }, '', 'gj', opts) vim.keymap.set({ 'n', 'x' }, '', 'g', opts) vim.keymap.set({ 'n', 'x' }, '', 'g', opts) vim.keymap.set('x', '<', '', '>gv') local function hlWord() local current_word = vim.call('expand','') vim.fn.setreg('/', "\\<" .. current_word .. "\\>") vim.opt.hlsearch = true end -- Highlight word under cursor vim.keymap.set('n', "'", hlWord, { noremap = true, silent = false }) vim.keymap.set('x', "'", 'y/\\V"N', { noremap = true, silent = true }) -- Close Buffer vim.keymap.set('n', '', ':bd')