moved remaps to their own file

This commit is contained in:
n 2024-10-27 07:44:47 +00:00
parent d2bc567a8c
commit 7b3e08f8a9
2 changed files with 43 additions and 34 deletions

19
lua/nat/remap.lua Normal file
View File

@ -0,0 +1,19 @@
vim.g.mapleader = " "
vim.g.maplocalleader = "<5C>"
-- https://neovim.reddit.com/comments/xykklt/_/j4gxyqx
vim.keymap.set("n", "<C-_>", function()
require("Comment.api").toggle.linewise.current() end,
{ noremap = true, silent = true }
)
vim.keymap.set("n", "<leader>Tt", function() vim.cmd [[Neotree toggle left]] end)
vim.keymap.set("n", "<leader>Tf", function() vim.cmd [[Neotree toggle float]] end)
-- Map Alt + Up to move the current line up
vim.keymap.set("n", "<A-Up>", ":m .-2<CR>==", { noremap = true, silent = true })
vim.keymap.set("i", "<A-Up>", "<Esc>:m .-2<CR>==gi", { noremap = true, silent = true })
-- -- Map Alt + Down to move the current line down
vim.keymap.set("n", "<A-Down>", ":m .+1<CR>==", { noremap = true, silent = true })
vim.keymap.set("i", "<A-Down>", "<Esc>:m .+1<CR>==gi", { noremap = true, silent = true })

View File

@ -1,45 +1,35 @@
vim.g.mapleader = " " -- local HOME = "C:\\Users\\Nathan"
local HOME = os.getenv("HOME") or "~"
local set = vim.opt vim.opt.guicursor = ""
local HOME = "C:\\Users\\Nathan" vim.opt.nu = true
set.guicursor = "" vim.opt.relativenumber = true
-- set.number = "relativenumber" vim.opt.paste = true
set.relativenumber = true vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.softtabstop = 2
vim.opt.expandtab = false
set.tabstop = 2 vim.opt.smartindent = true
set.softtabstop = 2
set.shiftwidth = 2
set.expandtab = 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 vim.opt.hlsearch = false
set.backup = false vim.opt.incsearch = true
set.undodir = HOME .. "/.vim/undodir"
set.undofile = true
set.hlsearch = false vim.opt.termguicolors = true
set.incsearch = true
set.termguicolors = true vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")
set.scrolloff = 8 vim.opt.updatetime = 50
set.signcolumn = "yes"
set.isfname:append("@-@")
set.updatetime = 50 -- vim.opt.colorcolumn = "161"
-- set.colorcolumn = "161"
-- https://neovim.reddit.com/comments/xykklt/_/j4gxyqx
vim.keymap.set("n", "<C-_>", function()
require('Comment.api').toggle.linewise.current() end,
{ noremap = true, silent = true }
)
vim.keymap.set("n", "<leader>tt", function() vim.cmd [[Neotree left toggle]] end)
vim.keymap.set("n", "<leader>tf", function() vim.cmd [[Neotree float]] end)