aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-03-01 18:35:20 +0530
committersinanmohd <sinan@sinanmohd.com>2024-03-01 18:35:20 +0530
commit66f9dec9b9efdc8962f45dcb2f3ac97c27dd0ea2 (patch)
treea9b6c504d0837238fdb4e8115c6ead9cf3c12700 /lua
parent66bf17e2fefed4d6e60cf421b447b947a7074705 (diff)
core/maps: init <Leader>cc for toggle 80 column hint
Diffstat (limited to 'lua')
-rw-r--r--lua/core/maps.lua36
1 files changed, 23 insertions, 13 deletions
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 = {
- ["<Esc>"] = { "<cmd> noh <CR>", "Clear highlights" },
- },
+ n = {
+ ["<Esc>"] = { "<cmd> noh <CR>", "Clear highlights" },
+ ["<Leader>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 = {
- ["<C-x>"] = {
- vim.api.nvim_replace_termcodes("<C-\\><C-N>", true, true, true),
- "Escape terminal mode"
- },
- },
+ t = {
+ ["<C-x>"] = {
+ vim.api.nvim_replace_termcodes("<C-\\><C-N>", true, true, true),
+ "Escape terminal mode"
+ },
+ },
- v = {
- ["<"] = { "<gv", "Indent line" },
- [">"] = { ">gv", "Indent line" },
- },
+ v = {
+ ["<"] = { "<gv", "Indent line" },
+ [">"] = { ">gv", "Indent line" },
+ },
}