-- keymappings [view all the defaults by pressing Lk] lvim.leader = 'space' -- add your own keymapping lvim.keys.normal_mode[''] = ':w' -- unmap a default keymapping -- lvim.keys.normal_mode[""] = "" -- edit a default keymapping -- lvim.keys.normal_mode[""] = ":q" -- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode. -- we use protected-mode (pcall) just in case the plugin wasn't loaded yet. -- local _, actions = pcall(require, "telescope.actions") -- lvim.builtin.telescope.defaults.mappings = { -- -- for input mode -- i = { -- [""] = actions.move_selection_next, -- [""] = actions.move_selection_previous, -- [""] = actions.cycle_history_next, -- [""] = actions.cycle_history_prev, -- }, -- -- for normal mode -- n = { -- [""] = actions.move_selection_next, -- [""] = actions.move_selection_previous, -- }, -- } -- use the default vim behavior for H and L lvim.keys.normal_mode[''] = nil lvim.keys.normal_mode[''] = nil -- When text is wrapped, move by terminal rows, not lines, unless a count is provided vim.api.nvim_set_keymap('n', 'j', '(v:count == 0 ? "gj" : "j")', {noremap = true, expr = true, silent = true}) vim.api.nvim_set_keymap('n', 'k', '(v:count == 0 ? "gk" : "k")', {noremap = true, expr = true, silent = true}) -- move around *visually* -- make Y consistent with other capitals lvim.keys.normal_mode['Y'] = 'y$' -- easy align lvim.keys.normal_mode['ga'] = ':EasyAlign' lvim.keys.visual_mode['ga'] = ':EasyAlign' -- Maintain the cursor position when yanking a visual selection -- http://ddrscott.github.io/blog/2016/yank-without-jank/ lvim.keys.visual_mode['y'] = 'myy`y' lvim.keys.visual_mode['Y'] = ' myY`y' -- make . to work with visually selected lines lvim.keys.visual_mode['.'] = ':normal . ' -- insert mode mappings lvim.keys.insert_mode[''] = '^' lvim.keys.insert_mode[''] = '$' lvim.keys.insert_mode[''] = 'w' lvim.keys.insert_mode[''] = 'b' lvim.keys.insert_mode[''] = 'd$' lvim.keys.insert_mode[''] = 'd^' lvim.keys.insert_mode[''] = 'u[s1z=`]au'