feat: added keybind to toggle foldcolumn + small fix

This commit is contained in:
əlemi 2022-08-18 05:31:54 +02:00
parent 942c2fdb40
commit aed10e596d
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 13 additions and 2 deletions

View file

@ -183,7 +183,7 @@ function PALETTE:set_ui_colors()
vim.api.nvim_set_hl(0, "VertSplit", HIGHLIGHT(self.black.normal, self.black.normal, nil)) -- Split divider color
vim.api.nvim_set_hl(0, "SignColumn", HIGHLIGHT(nil, nil, nil)) -- Gutter color
vim.api.nvim_set_hl(0, "CursorLine", HIGHLIGHT(nil, nil, nil)) -- Line number color
vim.api.nvim_set_hl(0, "CursorLineSign", HIGHLIGHT(nil, nil, nil)) -- CursorLine color (in sign column)
vim.api.nvim_set_hl(0, "CursorLineSign", HIGHLIGHT(nil, self.black.normal, nil)) -- CursorLine color (in sign column)
vim.api.nvim_set_hl(0, "CursorLineNr", HIGHLIGHT(self.yellow.normal, self.black.normal, {bold=true})) -- CursorLine color (in number column)
vim.api.nvim_set_hl(0, "LineNr", HIGHLIGHT(self.black.bright, nil, nil)) -- Number column color

View file

@ -21,7 +21,9 @@
&&&
]]--
local KEYBINDS = { }
local KEYBINDS = {
foldcolumn = false,
}
--|| GLOBAL KEYBINDS
function KEYBINDS:set_global_keys(opts)
@ -38,6 +40,15 @@ function KEYBINDS:set_global_keys(opts)
vim.keymap.set('n', '<C-t>', ':NvimTreeToggle<CR>', {noremap=true})
-- Esc goes back to normal mode in terminal
vim.keymap.set('t', '<ESC>', '<C-\\><C-n>', opts)
vim.keymap.set('n', 'zi', function()
if self.foldcolumn then
vim.opt.foldcolumn = '0'
else
vim.opt.foldcolumn = '2'
end
self.foldcolumn = not self.foldcolumn
end)
end
function KEYBINDS:set_navigation_keys(opts)