-- [[ General Keymaps ]] local nmap = require 'core.utils'.createNmap() vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) -- Remap for dealing with word wrap vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -- Stop yanking on paste vim.keymap.set('x', 'p', 'P') -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) vim.api.nvim_create_autocmd('TextYankPost', { callback = function() vim.highlight.on_yank() end, group = highlight_group, pattern = '*', }) local function nohClear() -- Removes highlight search vim.cmd.noh() -- Clear terminal notification below vim.notify("") end vim.keymap.set("n", "", nohClear, { silent = true }) vim.keymap.set("n", "", nohClear, { silent = true }) --[[ NOTE To use Meta key as Option in mac inside iterm it should be set to work as +ESC in iterm settings --]] -- Split resize nmap('', ':res +1', 'Resize split') nmap('', ':res -1', 'Resize split') nmap('', ':vertical res -1', 'Resize split vertically') nmap('', ':vertical res +1', 'Resize split vertically') nmap('', '|', 'Maximize Split Vertically') nmap('', '_', 'Maximize Split Horizontally') nmap('', '=', 'Reset Split Size')