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 toggle", "fs"}, ["c"] = { "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 = "visual changes", ["d"] = { function () if not _G.__diffview_open then _G.__diffview_open = true; vim.cmd("DiffviewOpen"); else _G.__diffview_open = false; vim.cmd("DiffviewClose") end end, "toggle diff"}, ["s"] = { "if &spellset nospellelseset spellendif", "spellcheck"}, ["i"] = { "lua require('nabla').toggle_virt({autogen=true})", "toggle markdown" }, ["h"] = { "HexToggle", "hex" } }, ["u"] = { name = "utils", ["h"] = { "Hardtime toggle", "toggle hardtime" }, }, ["q"] = { name = "quick", ["l"] = { "0v$", "line" }, ["s"] = { "\"+y", "system grab" }, }, ["t"] = { name = "telescope", ["f"] = { "Telescope find_files", "find files" }, ["b"] = { "Telescope git_branches", "git branches" }, ["c"] = { "Telescope git_commits", "git commits" }, ["l"] = { "Telescope live_grep", "ripgrep" }, ["z"] = { "Telescope current_buffer_fuzzy_find", "fuzzy" }, }, ["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