-- more mappings are defined in `lua/config/which.lua` local map = vim.keymap.set local default_options = { silent = true } local expr_options = { expr = true, silent = true } --Remap space as leader key map({ "n", "v" }, "", "", { silent = true }) vim.g.mapleader = " " --Remap for dealing with visual line wraps map("n", "k", "v:count == 0 ? 'gk' : 'k'", expr_options) map("n", "j", "v:count == 0 ? 'gj' : 'j'", expr_options) -- better indenting map("v", "<", "", ">gv", default_options) -- paste over currently selected text without yanking it map("v", "p", '"_dP', default_options) -- Tab switch buffer map("n", "", ":BufferLineCycleNext", default_options) map("n", "", ":BufferLineCyclePrev", default_options) -- Cancel search highlighting with ESC map("n", "", ":nohlsearch:echo", default_options) -- Resizing panes map("n", "", ":vertical resize +1", default_options) map("n", "", ":vertical resize -1", default_options) map("n", "", ":resize -1", default_options) map("n", "", ":resize +1", default_options) -- Autocorrect spelling from previous error map("i", "", "u[s1z=`]au", default_options) -- Move selected line / block of text in visual mode map("x", "K", ":move '<-2gv-gv", default_options) map("x", "J", ":move '>+1gv-gv", default_options) -- starlite mappings map("n", "*", function() return require("starlite").star() end, default_options) map("n", "g*", function() return require("starlite").g_star() end, default_options) map("n", "#", function() return require("starlite").hash() end, default_options) map("n", "g#", function() return require("starlite").g_hash() end, default_options) -- move over a closing element in insert mode map("i", "", function() return require("functions").escapePair() end, default_options)