---@type MappingsConfig local M = {} M.general = { n = { [";"] = { ":", "enter command mode", opts = { nowait = true } }, ["gc"] = { function() require("Comment.api").toggle.linewise.current() end, "toggle comment", }, ["gcc"] = { function() require("Comment.api").toggle.linewise.current() end, "toggle comment", }, }, v = { ["gc"] = { "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", "toggle comment", }, ["gcc"] = { "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", "toggle comment", }, }, } M.file = { n = { -- file / directory ["fF"] = { function() require("telescope.builtin").find_files({ cwd = vim.fn.expand("%:p:h") }) end, "[F]ind [F]iles in current directory", }, ["fo"] = { function() require("telescope.builtin").oldfiles() end, "[F]ind recently [o]pened files", }, ["fs"] = { " :w ", "[F]ile [S]ave" }, ["fw"] = { function() end, "Nothing" }, }, } M.search = { n = { -- search ["sd"] = { function() require("telescope.builtin").diagnostics() end, "[S]earch [D]iagnostics", }, ["sf"] = { function() require("telescope.builtin").find_files() end, "[S]earch [F]iles", }, ["sh"] = { function() require("telescope.builtin").help_tags() end, "[S]earch [H]elp", }, ["sw"] = { function() require("telescope.builtin").grep_string() end, "[S]earch current [W]ord", }, ["sp"] = { function() require("telescope.builtin").live_grep() end, "[S]earch by gre[p]", }, ["sg"] = { function() require("telescope.builtin").live_grep() end, "[S]earch by [g]rep", }, ["so"] = { function() require("telescope.builtin").oldfiles() end, "[S]earch recently [o]pened files", }, ["sG"] = { function() require("telescope").extensions.live_grep_args.live_grep_args({ cwd = vim.fn.expand("%:p:h") }) end, "[S]earch by [G]rep in current directory", }, }, } M.buffer = { n = { ["bd"] = { "bpspbnbd", "[B]uffer [D]elete" }, ["bb"] = { function() require("telescope.builtin").buffers() end, "[B]rowse [B]uffers", }, }, } M.window = { n = { ["ws"] = { " :split ", "[W]indow Horizontal [S]plit" }, -- split horizontal ["wv"] = { " :vsplit ", "[W]indow [V]ertical Split" }, -- split vertical ["wh"] = { " :TmuxNavigateLeft", "Go to Left [W]indow" }, ["wj"] = { " :TmuxNavigateDown", "Go to [W]indow Below" }, ["wk"] = { " :TmuxNavigateUp", "Go to Top [W]indow" }, ["wl"] = { " :TmuxNavigateRight", "Go to Right [W]indow" }, ["wq"] = { "q", "[W]indow [Q]uit" }, -- quit }, } M.term = { n = { ["tf"] = { " :ToggleTerm direction=float", "[T]erm [F]loat" }, ["tt"] = { " :ToggleTerm direction=tab", "[T]erm [T]ab" }, ["th"] = { " :ToggleTerm direction=horizontal", "[T]erm [H]orizontal" }, ["tv"] = { " :ToggleTerm direction=vertical", "[T]erm [V]ertical" }, ["ht"] = { function() require("custom.term").htop:toggle() end, "[H]top", }, [""] = { " :ToggleTerm direction=horizontal", "[T]erm [H]orizontal" }, }, } M.git = { n = { ["gg"] = { function() require("custom.term").lazygit:toggle() end, "Lazy[G]it", }, ["gl"] = { function() require("custom.term").lazygit:toggle() end, "[L]azy[G]it", }, }, } M.lsp = { n = { -- ["gD"] = { -- function() -- vim.lsp.buf.declaration() -- end, -- "lsp declaration", -- }, -- -- ["gd"] = { -- function() -- vim.lsp.buf.definition() -- end, -- "lsp definition", -- }, ["gh"] = { "Lspsaga lsp_finder" }, -- ["K"] = { "Lspsaga hover_doc", "Hover Documentation" }, ["ld"] = { "Lspsaga show_line_diagnostics", "[L]ine [D]iagnostics" }, ["cd"] = { "Lspsaga show_cursor_diagnostics", "[C]ursor [D]iagnostics" }, ["ad"] = { "Lspsaga show_buffer_diagnostics", "Buffer [D]iagnostics" }, }, } return M