local bind = require("keymap.bind") local map_cr = bind.map_cr local map_cu = bind.map_cu local map_cmd = bind.map_cmd local map_callback = bind.map_callback require("keymap.helpers") local plug_map = { -- Plugin: vim-fugitive ["n|gps"] = map_cr("G push"):with_noremap():with_silent():with_desc("git: Push"), ["n|gpl"] = map_cr("G pull"):with_noremap():with_silent():with_desc("git: Pull"), ["n|gG"] = map_cu("Git"):with_noremap():with_silent():with_desc("git: Open git-fugitive"), -- Plugin: nvim-tree ["n|"] = map_cr("NvimTreeToggle"):with_noremap():with_silent():with_desc("filetree: Toggle"), ["n|nf"] = map_cr("NvimTreeFindFile"):with_noremap():with_silent():with_desc("filetree: Find file"), ["n|nr"] = map_cr("NvimTreeRefresh"):with_noremap():with_silent():with_desc("filetree: Refresh"), -- Plugin: sniprun ["v|r"] = map_cr("SnipRun"):with_noremap():with_silent():with_desc("tool: Run code by range"), ["n|r"] = map_cu([[%SnipRun]]):with_noremap():with_silent():with_desc("tool: Run code by file"), -- Plugin: toggleterm ["t|"] = map_cmd([[]]):with_noremap():with_silent(), -- switch to normal mode in terminal. ["n|"] = map_cr("ToggleTerm direction=horizontal") :with_noremap() :with_silent() :with_desc("terminal: Toggle horizontal"), ["i|"] = map_cmd("ToggleTerm direction=horizontal") :with_noremap() :with_silent() :with_desc("terminal: Toggle horizontal"), ["t|"] = map_cmd("ToggleTerm"):with_noremap():with_silent():with_desc("terminal: Toggle horizontal"), ["n|"] = map_cr("ToggleTerm direction=vertical") :with_noremap() :with_silent() :with_desc("terminal: Toggle vertical"), ["i|"] = map_cmd("ToggleTerm direction=vertical") :with_noremap() :with_silent() :with_desc("terminal: Toggle vertical"), ["t|"] = map_cmd("ToggleTerm"):with_noremap():with_silent():with_desc("terminal: Toggle vertical"), ["n|"] = map_cr("ToggleTerm direction=vertical") :with_noremap() :with_silent() :with_desc("terminal: Toggle vertical"), ["i|"] = map_cmd("ToggleTerm direction=vertical") :with_noremap() :with_silent() :with_desc("terminal: Toggle vertical"), ["t|"] = map_cmd("ToggleTerm"):with_noremap():with_silent():with_desc("terminal: Toggle vertical"), ["n|"] = map_cr("ToggleTerm direction=float"):with_noremap():with_silent():with_desc("terminal: Toggle float"), ["i|"] = map_cmd("ToggleTerm direction=float") :with_noremap() :with_silent() :with_desc("terminal: Toggle float"), ["t|"] = map_cmd("ToggleTerm"):with_noremap():with_silent():with_desc("terminal: Toggle float"), ["n|gg"] = map_callback(function() _toggle_lazygit() end) :with_noremap() :with_silent() :with_desc("git: Toggle lazygit"), -- Plugin: trouble ["n|gt"] = map_cr("Trouble diagnostics toggle"):with_noremap():with_silent():with_desc("lsp: Toggle trouble list"), ["n|lw"] = map_cr("Trouble diagnostics toggle") :with_noremap() :with_silent() :with_desc("lsp: Show workspace diagnostics"), ["n|lp"] = map_cr("Trouble project_diagnostics toggle") :with_noremap() :with_silent() :with_desc("lsp: Show project diagnostics"), ["n|ld"] = map_cr("Trouble diagnostics toggle filter.buf=0") :with_noremap() :with_silent() :with_desc("lsp: Show document diagnostics"), -- Plugin: telescope ["n|"] = map_callback(function() _command_panel() end) :with_noremap() :with_silent() :with_desc("tool: Toggle command panel"), ["n|fc"] = map_callback(function() _telescope_collections(require("telescope.themes").get_dropdown()) end) :with_noremap() :with_silent() :with_desc("tool: Open Telescope collections"), ["n|ff"] = map_callback(function() require("search").open({ collection = "file" }) end) :with_noremap() :with_silent() :with_desc("tool: Find files"), ["n|fp"] = map_callback(function() require("search").open({ collection = "pattern" }) end) :with_noremap() :with_silent() :with_desc("tool: Find patterns"), ["v|fs"] = map_cu("Telescope grep_string") :with_noremap() :with_silent() :with_desc("tool: Find word under cursor"), ["n|fg"] = map_callback(function() require("search").open({ collection = "git" }) end) :with_noremap() :with_silent() :with_desc("tool: Locate Git objects"), ["n|fd"] = map_callback(function() require("search").open({ collection = "dossier" }) end) :with_noremap() :with_silent() :with_desc("tool: Retrieve dossiers"), ["n|fm"] = map_callback(function() require("search").open({ collection = "misc" }) end) :with_noremap() :with_silent() :with_desc("tool: Miscellaneous"), -- Plugin: dap ["n|"] = map_callback(function() require("dap").continue() end) :with_noremap() :with_silent() :with_desc("debug: Run/Continue"), ["n|"] = map_callback(function() require("dap").terminate() end) :with_noremap() :with_silent() :with_desc("debug: Stop"), ["n|"] = map_callback(function() require("dap").toggle_breakpoint() end) :with_noremap() :with_silent() :with_desc("debug: Toggle breakpoint"), ["n|"] = map_callback(function() require("dap").step_into() end) :with_noremap() :with_silent() :with_desc("debug: Step into"), ["n|"] = map_callback(function() require("dap").step_out() end) :with_noremap() :with_silent() :with_desc("debug: Step out"), ["n|"] = map_callback(function() require("dap").step_over() end) :with_noremap() :with_silent() :with_desc("debug: Step over"), ["n|db"] = map_callback(function() require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) end) :with_noremap() :with_silent() :with_desc("debug: Set breakpoint with condition"), ["n|dc"] = map_callback(function() require("dap").run_to_cursor() end) :with_noremap() :with_silent() :with_desc("debug: Run to cursor"), ["n|dl"] = map_callback(function() require("dap").run_last() end) :with_noremap() :with_silent() :with_desc("debug: Run last"), ["n|do"] = map_callback(function() require("dap").repl.open() end) :with_noremap() :with_silent() :with_desc("debug: Open REPL"), } bind.nvim_load_mapping(plug_map)