local maps = { n = { [""] = { " noh ", "Clear highlights" }, ["[b"] = { " bprev ", "Previous buffer" }, ["]b"] = { " bnext ", "Next buffer" }, ["cc"] = { function() if vim.api.nvim_get_option_value("colorcolumn", {}) == "" then vim.api.nvim_set_option_value("colorcolumn", "80", {}) else vim.api.nvim_set_option_value("colorcolumn", "", {}) end end, "Toggle 80 column hint", }, ["r"] = { vim.lsp.buf.rename, "Rename with LSP" }, }, t = { [""] = { vim.api.nvim_replace_termcodes("", true, true, true), "Escape terminal mode", }, }, v = { ["<"] = { ""] = { ">gv", "Indent line" }, }, } for mode, keytab in pairs(maps) do for key, fun in pairs(keytab) do vim.keymap.set(mode, key, fun[1], { desc = fun[2] }) end end