diff options
author | sinanmohd <sinan@firemail.cc> | 2023-04-05 22:04:15 +0530 |
---|---|---|
committer | sinanmohd <sinan@firemail.cc> | 2023-04-05 22:18:35 +0530 |
commit | 9cfd7e2e4e986a4be06e3120c483524bc176ae43 (patch) | |
tree | 041b5c3e164623e427217f9fa3d49f63c8ea20e1 | |
parent | f8f7e9875219f508152198897ba229d65ebcf807 (diff) |
nvim: init.lua, add keybinding to toggle column 80 hint
-rw-r--r-- | .config/nvim/init.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 51e4415..e083018 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -178,6 +178,15 @@ vim.o.termguicolors = true -- See `:help vim.keymap.set()` vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true }) +-- 80 column hint +vim.keymap.set('n', '<leader>cc', function() + if vim.api.nvim_get_option_value('colorcolumn', {}) == '' then + vim.api.nvim_set_option_value('colorcolumn', '79', {}) + else + vim.api.nvim_set_option_value('colorcolumn', '', {}) + end +end, { desc = "[cc] Toggle 80 column hint" }) + -- Remap for dealing with word wrap vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) |