nvim/lua/nat/remap.lua

20 lines
847 B
Lua
Raw Normal View History

2024-10-27 07:44:47 +00:00
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 })