From 9818f56002f34190b393951cc0118fd8435b0fe3 Mon Sep 17 00:00:00 2001 From: ame Date: Fri, 29 Sep 2023 19:49:11 -0500 Subject: init --- lua/config/whichkey.lua | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 lua/config/whichkey.lua (limited to 'lua/config/whichkey.lua') diff --git a/lua/config/whichkey.lua b/lua/config/whichkey.lua new file mode 100644 index 0000000..2fb572f --- /dev/null +++ b/lua/config/whichkey.lua @@ -0,0 +1,64 @@ +local M = {} + +function M.setup() + local whichkey = require "which-key" + + local conf = { + window = { + border = "single", -- none, single, double, shadow + position = "bottom", -- bottom, top + }, + } + + local opts = { + mode = {"n", "v"}, -- Normal mode + prefix = " ", + buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings + silent = true, -- use `silent` when creating keymaps + noremap = true, -- use `noremap` when creating keymaps + nowait = true, -- use `nowait` when creating keymaps + } + + local mappings = { + --["w"] = { "update!", "Save" }, + ["f"] = { "Neotree", "fs"}, + ["t"] = { "UndotreeToggle", "clip tree"}, + ["e"] = { "TroubleToggle", "errors" }, + ["g"] = { + name = "'games'", + ["q"] = { "KillKillKill", "killer sheep" }, + ["w"] = { "Nvimesweeper", "minesweeper" }, + ["e"] = { "CellularAutomaton make_it_rain", "c_a make it rain" }, + ["r"] = { "CellularAutomaton game_of_life", "c_a conway gol" }, + ["t"] = { "Tetris", "tetris" }, + ["y"] = { "ShenzhenSolitaireNewGame", "solitaire" }, + ["u"] = { "BlackJackNewGame", "blackjack" }, + ["i"] = { "lua require('sudoku').setup{}Sudoku", "sudoku" }, + }, + ["n"] = { + name = "sci", + ["i"] = { "lua require('nabla').toggle_virt({autogen=true})", "toggle" }, + }, + ["q"] = { + name = "quick chords", + ["l"] = { "0v$", "line" }, + ["s"] = { "\"+y", "system grab" }, + }, + ["z"] = { + name = "packer", + c = { "PackerCompile", "compile" }, + i = { "PackerInstall", "install" }, + s = { "PackerSync", "sync" }, + S = { "PackerStatus", "status" }, + u = { "PackerUpdate", "update" }, + }, + + } + + whichkey.setup(conf) + whichkey.register(mappings, opts) +end + +return M + + -- cgit v1.2.3