From bb006482081994296a2f041011a09d870deb1e1a Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Wed, 4 Aug 2021 11:39:27 -0400 Subject: [PATCH] vimrc tweaks --- nvim.configlink/init.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nvim.configlink/init.lua b/nvim.configlink/init.lua index a3026fb..5b3ab68 100644 --- a/nvim.configlink/init.lua +++ b/nvim.configlink/init.lua @@ -337,7 +337,7 @@ vim.api.nvim_set_keymap("", "ta", ":Tabularize /", {noremap=true}) vim.api.nvim_set_keymap("", "t#", ":Tabularize /#", {noremap=true}) vim.api.nvim_set_keymap("", "t\"", ":Tabularize /\"", {noremap=true}) --- Vimrc +-- Vimrc editing vim.api.nvim_set_keymap("n", "fv", ":edit $MYVIMRC", {noremap=true}) vim.api.nvim_set_keymap("n", "rr", ":luafile $MYVIMRC", {noremap=true}) @@ -346,3 +346,14 @@ vim.api.nvim_set_keymap("n", "", ":HopWord", {noremap=true}) vim.api.nvim_set_keymap("t", "", "", {noremap=true}) -- Exit terminal mode vim.api.nvim_set_keymap("n", "", ":noh", {noremap=true, silent=true}) vim.api.nvim_set_keymap('n', 'Y', 'y$', { noremap = true}) + +-- Keep cursor in place +vim.api.nvim_set_keymap("n", 'n', "nzz", {noremap=true}) +vim.api.nvim_set_keymap("n", 'N', "Nzz", {noremap=true}) +vim.api.nvim_set_keymap("n", 'J', "mzJ`z", {noremap=true}) -- Mark and jump back to it + +-- Add undo breakpoints +vim.api.nvim_set_keymap("i", ',', ",u", {noremap=true}) +vim.api.nvim_set_keymap("i", '.', ".u", {noremap=true}) +vim.api.nvim_set_keymap("i", '!', "!u", {noremap=true}) +vim.api.nvim_set_keymap("i", '?', "?u", {noremap=true})