From 7b3e08f8a92193e4c370e485dbb54599932c9a88 Mon Sep 17 00:00:00 2001 From: n Date: Sun, 27 Oct 2024 07:44:47 +0000 Subject: [PATCH] moved remaps to their own file --- lua/nat/remap.lua | 19 ++++++++++++++++ lua/nat/set.lua | 58 ++++++++++++++++++++--------------------------- 2 files changed, 43 insertions(+), 34 deletions(-) create mode 100644 lua/nat/remap.lua diff --git a/lua/nat/remap.lua b/lua/nat/remap.lua new file mode 100644 index 0000000..ca29584 --- /dev/null +++ b/lua/nat/remap.lua @@ -0,0 +1,19 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = "<5C>" + +-- https://neovim.reddit.com/comments/xykklt/_/j4gxyqx +vim.keymap.set("n", "", function() + require("Comment.api").toggle.linewise.current() end, + { noremap = true, silent = true } +) + +vim.keymap.set("n", "Tt", function() vim.cmd [[Neotree toggle left]] end) +vim.keymap.set("n", "Tf", function() vim.cmd [[Neotree toggle float]] end) + +-- Map Alt + Up to move the current line up +vim.keymap.set("n", "", ":m .-2==", { noremap = true, silent = true }) +vim.keymap.set("i", "", ":m .-2==gi", { noremap = true, silent = true }) + +-- -- Map Alt + Down to move the current line down +vim.keymap.set("n", "", ":m .+1==", { noremap = true, silent = true }) +vim.keymap.set("i", "", ":m .+1==gi", { noremap = true, silent = true }) diff --git a/lua/nat/set.lua b/lua/nat/set.lua index 02af3ef..c05aa37 100644 --- a/lua/nat/set.lua +++ b/lua/nat/set.lua @@ -1,45 +1,35 @@ -vim.g.mapleader = " " +-- local HOME = "C:\\Users\\Nathan" +local HOME = os.getenv("HOME") or "~" -local set = vim.opt -local HOME = "C:\\Users\\Nathan" +vim.opt.guicursor = "" +vim.opt.nu = true -set.guicursor = "" +vim.opt.relativenumber = true --- set.number = "relativenumber" -set.relativenumber = true +vim.opt.paste = true +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.softtabstop = 2 +vim.opt.expandtab = false -set.tabstop = 2 -set.softtabstop = 2 -set.shiftwidth = 2 -set.expandtab = true +vim.opt.smartindent = true -set.smartindent = true +vim.opt.wrap = false -set.wrap = false +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undodir = HOME .. "/.vim/undodir" +vim.opt.undofile = true -set.swapfile = false -set.backup = false -set.undodir = HOME .. "/.vim/undodir" -set.undofile = true +vim.opt.hlsearch = false +vim.opt.incsearch = true -set.hlsearch = false -set.incsearch = true +vim.opt.termguicolors = true -set.termguicolors = true +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") -set.scrolloff = 8 -set.signcolumn = "yes" -set.isfname:append("@-@") +vim.opt.updatetime = 50 -set.updatetime = 50 - --- set.colorcolumn = "161" - --- https://neovim.reddit.com/comments/xykklt/_/j4gxyqx -vim.keymap.set("n", "", function() - require('Comment.api').toggle.linewise.current() end, - { noremap = true, silent = true } -) - -vim.keymap.set("n", "tt", function() vim.cmd [[Neotree left toggle]] end) -vim.keymap.set("n", "tf", function() vim.cmd [[Neotree float]] end) +-- vim.opt.colorcolumn = "161"