From b487984ecc61c6229cf92550030745c192fd3d0b Mon Sep 17 00:00:00 2001 From: Arnold Sommerfeld Date: Wed, 17 May 2023 18:44:48 +0100 Subject: first commit --- home/.config/nvim/after/plugin/mappings.lua | 58 +++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 home/.config/nvim/after/plugin/mappings.lua (limited to 'home/.config/nvim/after/plugin/mappings.lua') diff --git a/home/.config/nvim/after/plugin/mappings.lua b/home/.config/nvim/after/plugin/mappings.lua new file mode 100644 index 0000000..7fd0f03 --- /dev/null +++ b/home/.config/nvim/after/plugin/mappings.lua @@ -0,0 +1,58 @@ +local map = require("mapper") + +map.n("", "") + +-- make an accidental ; press also enter command mode +-- temporarily disabled to to vim-sneak plugin +map.n(";", ":") + +-- highlight last inserted text +map.n("gV", "`[v`]") + +map.n("", "") +map.n("", "") + +-- go to first non-blank character of current line +map.n("", "^") +map.v("", "^") +map.n("", "$") +map.v("", "$") + +-- This extends p in visual mode (note the noremap), so that if you paste from +-- the unnamed (ie. default) register, that register content is not replaced by +-- the visual selection you just pasted over–which is the default behavior. +-- This enables the user to yank some text and paste it over several places in +-- a row, without using a named register +-- map.v('p', "p:if v:register == '"'let @@=@0endif") +map.v("p", 'p:let @+=@0:let @"=@0') + +map.v("p", '"_dP') +map.n("d", '"_d') +map.n("D", '"_D') +map.map("", "c", '"_c') +map.map("", "C", '"_C') + +-- Find and Replace binds +map.ncmdi("s", "%s/") +map.vcmdi("s", "s/") +map.ncmdi("gs", '%s/"/') +map.vcmdi("gs", 's/"/') +map.ncmdi("S", "%s//") + +map.ncmd("x", "wall") +map.ncmd("z", "wqall") +map.ncmd("q", "quitall") +map.ncmd("x", "update") + +map.t("", "", { silent = true, noremap = true, expr = true }) + +map.n("gw", vim.diagnostic.open_float) +map.n("gW", vim.diagnostic.setloclist) +map.n("[w", vim.diagnostic.goto_prev) +map.n("]w", vim.diagnostic.goto_next) +map.n("[e", function() + vim.diagnostic.goto_prev({ severity = vim.diagnostic.severity.ERROR }) +end) +map.n("]e", function() + vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR }) +end) -- cgit v1.2.3-70-g09d2