--[[-- 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 -- -- 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["x"] = { "w! q!", "Save and quit" } lvim.builtin.which_key.mappings[";"] = {} lvim.builtin.terminal.open_mapping = "" end return M