mappings: Add back mappings removed in 0844431d37 | Format files

This commit is contained in:
Akianonymus 2022-07-14 15:37:52 +05:30 committed by Sidhanth Rathod
parent 37b2c53a46
commit b9f0e4623e
4 changed files with 21 additions and 5 deletions

View file

@ -7,6 +7,16 @@ end
local M = {} local M = {}
M.general = { M.general = {
[""] = {
-- Allow moving the cursor through wrapped lines with j, k, <Up> and <Down>
-- http<cmd> ://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/
-- empty mode is same as using <cmd> :map
-- also don't use g[j|k] when in operator pending mode, so it doesn't alter d, y or c behaviour
["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } },
["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } },
["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } },
["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } },
},
i = { i = {
@ -56,6 +66,12 @@ M.general = {
t = { t = {
["<C-x>"] = { termcodes "<C-\\><C-N>", " escape terminal mode" }, ["<C-x>"] = { termcodes "<C-\\><C-N>", " escape terminal mode" },
}, },
v = {
-- Don't copy the replaced text after pasting in visual mode
-- https://vim.fandom.com/wiki/Replace_a_word_with_yanked_text#Alternative_mapping_for_paste
["p"] = { 'p:let @+=@0<CR>:let @"=@0<CR>', opts = { silent = true } },
},
} }
M.tabufline = { M.tabufline = {

View file

@ -112,7 +112,7 @@ M.luasnip = function()
options = load_override(options, "L3MON4D3/LuaSnip") options = load_override(options, "L3MON4D3/LuaSnip")
luasnip.config.set_config(options) luasnip.config.set_config(options)
require("luasnip.loaders.from_vscode").lazy_load() require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load({ paths = vim.g.luasnippets_path or "" }) require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.luasnippets_path or "" }
vim.api.nvim_create_autocmd("InsertLeave", { vim.api.nvim_create_autocmd("InsertLeave", {
callback = function() callback = function()