--[[-- File : conf.d/lvim/lua/user/whichkey.lua Author : Jeff Lance Date : 29.12.2023 22:30:57 Last Modified Date: 29.12.2023 22:30:57 Last Modified By : Jeff Lance --]]-- local M = {} M.setup = function() -- ================= -- whichkey mappings -- -- chatgpt bindings lvim.builtin.which_key.mappings["C"] = { name = "ChatGPT", c = { "ChatGPT", "ChatGPT" }, e = { "ChatGPTEditWithInstruction", "Edit with instruction", mode = { "n", "v" } }, g = { "ChatGPTRun grammar_correction", "Grammar Correction", mode = { "n", "v" } }, t = { "ChatGPTRun translate", "Translate", mode = { "n", "v" } }, k = { "ChatGPTRun keywords", "Keywords", mode = { "n", "v" } }, d = { "ChatGPTRun docstring", "Docstring", mode = { "n", "v" } }, a = { "ChatGPTRun add_tests", "Add Tests", mode = { "n", "v" } }, o = { "ChatGPTRun optimize_code", "Optimize Code", mode = { "n", "v" } }, s = { "ChatGPTRun summarize", "Summarize", mode = { "n", "v" } }, f = { "ChatGPTRun fix_bugs", "Fix Bugs", mode = { "n", "v" } }, x = { "ChatGPTRun explain_code", "Explain Code", mode = { "n", "v" } }, r = { "ChatGPTRun roxygen_edit", "Roxygen Edit", mode = { "n", "v" } }, l = { "ChatGPTRun code_readability_analysis", "Code Readability Analysis", mode = { "n", "v" } }, } -- remap neo-tree shortcut to rnvimr -- lvim.builtin.which_key.mappings["e"] = { "RnvimrToggle", "File explorer" } -- remap dashboard lvim.builtin.which_key.mappings["d"] = lvim.builtin.which_key.mappings[";"] -- remap git lvim.builtin.which_key.mappings["G"] = lvim.builtin.which_key.mappings["g"] lvim.builtin.which_key.mappings["g"] = {} -- remap highlight lvim.builtin.which_key.mappings["H"] = lvim.builtin.which_key.mappings["h"] -- remap lunarvim and lsp lvim.builtin.which_key.mappings["Lv"] = lvim.builtin.which_key.mappings["L"] lvim.builtin.which_key.mappings["Ll"] = lvim.builtin.which_key.mappings["l"] lvim.builtin.which_key.mappings["l"] = {} lvim.builtin.which_key.mappings["L"] = { name = "LSP, Lunar" } lvim.builtin.which_key.mappings["Lve"] = lvim.builtin.which_key.mappings["Lvc"] lvim.builtin.which_key.mappings["Lvc"] = {} -- zettle mappings lvim.builtin.which_key.mappings["N"] = { name = "Notes", c = { "edit /home/jeff/.config/zk/config.toml", "Edit config.toml" }, n = { "ZkNew { dir = vim.fn.input('Groupe: '), title = vim.fn.input('Titre: '), date = 'now' }", "Créer une nouvelle note" }, o = { "ZkNotes { sort = { 'modified' } }", "Ouvrir une note" }, O = { "ZkTags", "Ouvrir les notes avec le tag sélectionné" }, f = { "ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Rechercher note: ') } }", "Rechercher une note" }, F = { ":'<,'>ZkMatch", "Rechercher les notes contenant la sélection" }, } -- remap plugins mappings lvim.builtin.which_key.mappings["P"] = { name = "Plugins" } -- telescope lvim.builtin.which_key.mappings["P"] = lvim.builtin.which_key.mappings["p"] lvim.builtin.which_key.mappings["o"] = { "Telescope find_files", "Open a file" } lvim.builtin.which_key.mappings["p"] = { "Telescope projects", "Projects" } lvim.builtin.which_key.mappings["r"] = { "Telescope oldfiles", "Open recent file" } -- remap search lvim.builtin.which_key.mappings["S"] = lvim.builtin.which_key.mappings["s"] -- new mappings lvim.builtin.which_key.mappings["h"] = { name = "Header", h = { "AddHeader", "Add header to the file" }, m = { "AddMinHeader", "Add minimal header to the file" }, lg = { "AddGNULicense", "Add GPLv3 License" }, lm = { "AddMITLicense", "Add MIT License" }, } lvim.builtin.which_key.mappings["n"] = { "AdvancedNewFile", "Create a new file"} lvim.builtin.which_key.mappings["s"] = { "echom 'Sourcing' source %", "Source current file" } lvim.builtin.which_key.mappings["Q"] = { "w! q!", "Save and quit" } lvim.builtin.which_key.mappings[";"] = {} -- lvim.builtin.which_key.mappings["e"] = { ":lua require('user.functions').xplr_toggle()", "File manager" } lvim.builtin.which_key.mappings["e"] = { ":RnvimrToggle", "File manager" } lvim.builtin.terminal.open_mapping = "" end return M