From 66f9dec9b9efdc8962f45dcb2f3ac97c27dd0ea2 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Fri, 1 Mar 2024 18:35:20 +0530 Subject: core/maps: init cc for toggle 80 column hint --- lua/core/maps.lua | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'lua/core/maps.lua') diff --git a/lua/core/maps.lua b/lua/core/maps.lua index 57c9b94..31f899c 100644 --- a/lua/core/maps.lua +++ b/lua/core/maps.lua @@ -1,19 +1,29 @@ local maps = { - n = { - [""] = { " noh ", "Clear highlights" }, - }, + n = { + [""] = { " noh ", "Clear highlights" }, + ["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" + }, + }, - t = { - [""] = { - vim.api.nvim_replace_termcodes("", true, true, true), - "Escape terminal mode" - }, - }, + t = { + [""] = { + vim.api.nvim_replace_termcodes("", true, true, true), + "Escape terminal mode" + }, + }, - v = { - ["<"] = { ""] = { ">gv", "Indent line" }, - }, + v = { + ["<"] = { ""] = { ">gv", "Indent line" }, + }, } -- cgit v1.2.3