diff --git a/nvim/lua/chadrc.lua b/nvim/lua/chadrc.lua index 7bd7eaf..e2fc2a4 100644 --- a/nvim/lua/chadrc.lua +++ b/nvim/lua/chadrc.lua @@ -113,10 +113,21 @@ M.ui = { { " 󰈚 Recent Files", "Spc f o", "Telescope oldfiles" }, { " 󰈭 Find Word", "Spc f w", "Telescope live_grep" }, { "  Bookmarks", "Spc m a", "Telescope marks" }, - { "  Themes", "Spc t h", "Telescope themes" }, - { "  Mappings", "Spc c h", "NvCheatsheet" }, }, }, } +M.term = { + -- hl = "Normal:term,WinSeparator:WinSeparator", + -- sizes = { sp = 0.3, vsp = 0.2 }, + float = { + relative = "editor", + row = 0.04, + col = 0.045, + width = 0.9, + height = 0.8, + border = "single", + }, +} + return M diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua index e1a0231..d267450 100644 --- a/nvim/lua/mappings.lua +++ b/nvim/lua/mappings.lua @@ -1,16 +1,32 @@ require "nvchad.mappings" --- add yours here +local nomap = vim.keymap.del +nomap("n", "x") +nomap("n", "cc") +nomap("n", "ch") +nomap("n", "cm") + + local map = vim.keymap.set - map("n", ";", ":", { desc = "CMD enter command mode" }) map("i", "jk", "") -- Group names map("n", "f", "", { desc = "Find" }) +map("n", "l", "", { desc = "LSP" }) +map("n", "g", "", { desc = "Git" }) -- General -map("n", "q", "confirm q", { desc = " close" }) +map("n", "q", "confirm q", { desc = "quit" }) + +map("n", "c", function() + require("nvchad.tabufline").close_buffer() +end, { desc = "buffer close" }) + +map( + "n", "rd", " lua require('rainbow-delimiters').toggle() ", + {desc = "Toggle rainbow delimiters"} +) -- Lsp map( @@ -19,8 +35,15 @@ map( " lua require('conform').format { lsp_fallback = true }", { desc = "General Format file" } ) + map({ "n", "v" }, "la", vim.lsp.buf.code_action, {desc= "Code action"}) -map( - "n", "rd", " lua require('rainbow-delimiters').toggle() ", - {desc = "Toggle rainbow delimiters"} -) +-- Git +map("n", "gm", "Telescope git_commits", { desc = "telescope git commits" }) +map({ "n", "t" }, "gg", function() + require("nvchad.term").runner { + pos = "float", + cmd = "gitui && exit", + id = "gue", + clear_cmd = true + } +end, { desc = "Gitui" })