---@type MappingsTable local M = {} M.disabled = { n = { [""] = "", [""] = "", [""] = "", ["n"] = "", ["rn"] = "", [""] = "", [""] = "", ["x"] = "", ["/"] = "", ["ra"] = "", ["[d"] = "", ["]d"] = "", ["[c"] = "", ["]c"] = "", ["h"] = "", ["ff"] = "", ["fa"] = "", ["fw"] = "", ["fb"] = "", ["fh"] = "", ["fo"] = "", ["fz"] = "", ["cm"] = "", ["gt"] = "", ["pt"] = "", ["th"] = "", ["ma"] = "", ["v"] = "", ["rh"] = "", ["ph"] = "", ["gb"] = "", ["td"] = "", }, t = { [""] = "", }, v = { ["/"] = "", }, } M.tabufline = { plugin = true, n = { -- cycle through buffers [""] = { function() require("nvchad.tabufline").tabuflineNext() end, "Goto next buffer", }, [""] = { function() require("nvchad.tabufline").tabuflinePrev() end, "Goto prev buffer", }, -- close buffer + hide terminal buffer [""] = { function() require("nvchad.tabufline").close_buffer() end, "Close buffer", }, }, } M.comment = { plugin = true, -- toggle comment in both modes n = { ["v"] = { function() require("Comment.api").toggle.linewise.current() end, "Toggle comment", }, }, v = { ["v"] = { "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", "Toggle comment", }, }, } M.leap = { plugin = true, n = { ["s"] = { "(leap-forward)", "leap forward", }, ["S"] = { "(leap-backward)", "leap backward", }, ["gs"] = { "(leap-from-window)", "leap from window", }, }, x = { ["s"] = { "(leap-forward)", "leap forward", }, ["S"] = { "(leap-backward)", "leap forward", }, ["gs"] = { "(leap-from-window)", "leap from window", }, }, o = { ["s"] = { "(leap-forward)", "leap forward", }, ["S"] = { "(leap-backward)", "leap forward", }, ["gs"] = { "(leap-from-window)", "leap from window", }, }, } M.lazygit = { plugin = true, n = { ["gg"] = { " LazyGit ", "Open LazyGit" }, }, } M.lspconfig = { plugin = true, n = { ["[d"] = { function() vim.diagnostic.goto_prev { float = { border = "rounded" } } end, "Goto prev", }, ["cj"] = { function() vim.diagnostic.goto_next { float = { border = "rounded" } } end, "Goto next", }, }, } M.clipboard = { plugin = false, n = { ["y"] = { '"+y', "yank to system" }, ["Y"] = { '"+Y', "yank to system" }, ["yy"] = { '"+y', "yank to system" }, }, v = { ["y"] = { '"+y', "yank to system" }, ["Y"] = { '"+Y', "yank to system" }, ["yy"] = { '"+y', "yank to system" }, }, } M.telescope = { plugin = true, n = { -- find ["ff"] = { " Telescope find_files ", "Find files" }, ["fa"] = { " Telescope find_files follow=true no_ignore=true hidden=true ", "Find all" }, ["fw"] = { " Telescope live_grep ", "Live grep" }, ["fb"] = { " Telescope buffers ", "Find buffers" }, ["fh"] = { " Telescope help_tags ", "Help page" }, ["fo"] = { " Telescope oldfiles ", "Find oldfiles" }, ["fz"] = { " Telescope current_buffer_fuzzy_find ", "Find in current buffer" }, -- git ["cm"] = { " Telescope git_commits ", "Git commits" }, ["gt"] = { " Telescope git_status ", "Git status" }, -- pick a hidden term ["pt"] = { " Telescope terms ", "Pick hidden term" }, -- theme switcher ["th"] = { " Telescope themes ", "Nvchad themes" }, ["ma"] = { " Telescope marks ", "telescope bookmarks" }, }, } M.nvterm = { plugin = true, t = { -- preserve defaults }, n = { -- preserve defaults }, } M.nvimtree = { plugin = true, n = { -- toggle [""] = { " NvimTreeToggle ", "Toggle nvimtree" }, [""] = { " NvimTreeToggle ", "Toggle nvimtree" }, -- focus ["e"] = { " NvimTreeFocus ", "Focus nvimtree" }, }, } M.movements = { plugin = false, i = { --big move [""] = { "", "big step down" }, [""] = { "", "big step down" }, -- go to beginning and end [""] = { "", "Beginning of line" }, [""] = { "", "End of line" }, -- navigate within insert mode [""] = { "", "Move left" }, [""] = { "", "Move right" }, [""] = { "", "Move down" }, [""] = { "", "Move up" }, }, n = { --big move [""] = { "", "big step down" }, [""] = { "", "big step down" }, -- go to beginning and end ["H"] = { "", "Beginning of line" }, ["L"] = { "", "End of line" }, }, v = { --big move [""] = { "", "big step down" }, [""] = { "", "big step down" }, -- go to beginning and end ["H"] = { "", "Beginning of line" }, ["L"] = { "", "End of line" }, }, t = { [""] = { vim.api.nvim_replace_termcodes("", true, true, true), "Escape terminal mode", }, }, } M.edit = { plugin = false, n = { -- easy newline ["OO"] = { "O", "insert a line above", opts = { nowait = false } }, ["oo"] = { "o", "insert a line below", opts = { nowait = false } }, -- split and join lines -- "J" for join is defaul ["S"] = { "il", "split line", }, -- do something useful with the arrows [""] = { " move-2", "Move line up", opts = { expr = true } }, [""] = { " move+", "Move line down", opts = { expr = true } }, [""] = { " << ", "Less indentation", opts = { expr = true } }, [""] = { " >> ", "More indentation", opts = { expr = true } }, -- format with conform ["ff"] = { function() require("conform").format() end, "format buffer", }, -- -- remove trailing whitespace ["fw"] = { function() require('mini.trailspace').trim() end, "remove whitespace", }, }, v = { [""] = { ""] = { ">gv", "More indentation" }, }, x = { [""] = { "move'<-2gv=gv", "Move line up", opts = { expr = true } }, [""] = { "move'<-2gv=gv", "Move line down", opts = { expr = true } }, }, t = { --big move [""] = { "", "big step down" }, [""] = { "", "big step down" }, }, } M.ui = { plugin = false, n = { -- toggle wrap ["tw"] = { function() vim.opt_local.wrap = not vim.wo.wrap vim.opt_local.breakindent = not vim.wo.breakindent if vim.wo.colorcolumn == "" then vim.opt_local.colorcolumn = tostring(vim.bo.textwidth) else vim.opt_local.colorcolumn = "" end end, "toggle wrap", }, }, } -- more keybinds! return M