More nvim mappings

This commit is contained in:
Emmet 2024-09-15 10:15:48 -05:00
parent 9cf3f9d204
commit 58c8c7b87b

View file

@ -17,10 +17,27 @@ vim.keymap.set("n", "<C-->", function()
end) end)
map("n", ";", ":", { desc = "CMD enter command mode" }) map("n", ";", ":", { desc = "CMD enter command mode" })
map({"n", "v", "i"}, "<A-x>", ":", { desc = "CMD enter command mode" }) map({"n", "t", "v", "i"}, "<A-x>", ":", { desc = "CMD enter command mode" })
map({"n", "t", "v", "i"}, "<C-n>", "<Down>", { desc = "up" })
map({"n", "t", "v", "i"}, "<C-p>", "<Up>", { desc = "down" })
map({"n", "t", "v", "i"}, "<C-h>", "<C-w>h", { desc = "switch window left" })
map({"n", "t", "v", "i"}, "<C-l>", "<C-w>l", { desc = "switch window right" })
map({"n", "t", "v", "i"}, "<C-j>", "<C-w>j", { desc = "switch window down" })
map({"n", "t", "v", "i"}, "<C-k>", "<C-w>k", { desc = "switch window up" })
map("n", "<leader>.", "<cmd>Telescope find_files<cr>", { desc = "telescope find files" }) map("n", "<leader>.", "<cmd>Telescope find_files<cr>", { desc = "telescope find files" })
map("n", "<leader>/", "<cmd>Telescope live_grep<cr>", { desc = "telescope live grep" })
map("n", "<leader>gg", "<cmd>Neogit<cr>", { desc = "Neogit status buffer" }) map("n", "<leader>gg", "<cmd>Neogit<cr>", { desc = "Neogit status buffer" })
map("n", "<leader>c", "gcc", { desc = "Toggle Comment", remap = true })
map("v", "<leader>c", "gc", { desc = "Toggle comment", remap = true })
map("n", "<leader>pp", "<cmd>Telescope workspaces<cr>", { desc = "telescope workspaces" }) map("n", "<leader>pp", "<cmd>Telescope workspaces<cr>", { desc = "telescope workspaces" })
map("n", "<leader>ws", "<cmd>split<cr>", { desc = "horizontal split" })
map("n", "<leader>wS", "<cmd>split<cr>", { desc = "horizontal split" })
map("n", "<leader>wv", "<cmd>vsplit<cr>", { desc = "vertical split" })
map("n", "<leader>wV", "<cmd>vsplit<cr>", { desc = "vertical split" })
map({ "n", "t", "i", "v" }, "<A-f>", "<cmd>NvimTreeToggle<CR>", { desc = "nvimtree toggle window" })
map({ "n", "t", "i", "v" }, "<A-z>", function()
require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm" }
end, { desc = "terminal toggleable horizontal term" })
map("i", "jk", "<ESC>") map("i", "jk", "<ESC>")
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>") -- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")