From c0290fc1c74cd390a0cc21664cd7d7f71e14716f Mon Sep 17 00:00:00 2001 From: Alex Kretzschmar Date: Sun, 20 Oct 2024 19:55:32 -0400 Subject: [PATCH] neovim updates --- home/nvim/keymap.lua | 17 ++++++++++++++++- home/nvim/options.lua | 5 ++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/home/nvim/keymap.lua b/home/nvim/keymap.lua index accd741..0ef1d85 100644 --- a/home/nvim/keymap.lua +++ b/home/nvim/keymap.lua @@ -4,9 +4,24 @@ local keymap = vim.keymap keymap.set("i", "jk", "", { desc = "Exit insert mode with jk"}) +keymap.set("n", "nh", ":nohl", { desc = "Clear search highlights" }) + -- telescope keymap.set("n", "ff", "Telescope find_files", { desc = "Fuzzy find files in cwd" }) keymap.set("n", "fr", "Telescope oldfiles", { desc = "Fuzzy find recent files" }) keymap.set("n", "fs", "Telescope live_grep", { desc = "Find string in cwd" }) keymap.set("n", "fc", "Telescope grep_string", { desc = "Find string under cursor in cwd" }) -keymap.set("n", "ft", "TodoTelescope", { desc = "Find todos" }) \ No newline at end of file +keymap.set("n", "ft", "TodoTelescope", { desc = "Find todos" }) + +-- window management +keymap.set("n", "sv", "v", { desc = "Split window vertically" }) -- split window vertically +keymap.set("n", "sh", "s", { desc = "Split window horizontally" }) -- split window horizontally +keymap.set("n", "se", "=", { desc = "Make splits equal size" }) -- make split windows equal width & height +keymap.set("n", "sx", "close", { desc = "Close current split" }) -- close current split window + + +keymap.set("n", "to", "tabnew", { desc = "Open new tab" }) -- open new tab +keymap.set("n", "tx", "tabclose", { desc = "Close current tab" }) -- close current tab +keymap.set("n", "tn", "tabn", { desc = "Go to next tab" }) -- go to next tab +keymap.set("n", "tp", "tabp", { desc = "Go to previous tab" }) -- go to previous tab +keymap.set("n", "tf", "tabnew %", { desc = "Open current buffer in new tab" }) -- move current buffer to new tab \ No newline at end of file diff --git a/home/nvim/options.lua b/home/nvim/options.lua index 087c391..5e205af 100644 --- a/home/nvim/options.lua +++ b/home/nvim/options.lua @@ -32,4 +32,7 @@ opt.clipboard:append("unnamedplus") -- use system clipboard as the default regis -- window splits opt.splitright = true -opt.splitbelow = true \ No newline at end of file +opt.splitbelow = true + +-- turn off swapfile +opt.swapfile = false \ No newline at end of file