nvim: Fix colorizer setup and add mappings

This commit is contained in:
Marty Oehme 2023-03-23 08:30:01 +01:00
parent 3a6c7717c8
commit 8606652b93
Signed by: Marty
GPG Key ID: EDBF2ED917B2EF6A
2 changed files with 12 additions and 2 deletions

View File

@ -4,7 +4,7 @@ local prefix = require('which-key').register
-- The general ideas behind these mappings:
--
-- * Leader prefix is the generally preferred way to map new things, however
-- only for those that affect all of vim of work in a supra-buffer way.
-- only for those that affect all of vim or work in a supra-buffer way.
--
-- * Localleader prefix is used for mappings which only affect single buffers.
-- In other words mostly filetype specific mappings
@ -277,3 +277,7 @@ map('n', '<localleader>ss', ':EasyreadToggle<cr>', { silent = true, desc = 'togg
map('n', '<localleader>sv', '<cmd>lua require("nabla").popup()<cr>', { silent = true, desc = 'latex formula popup' })
map('n', '<localleader>sV', '<cmd>lua require("nabla").toggle_virt({autogen = true, silent = true})<cr>',
{ silent = true, desc = 'toggle formula notation' })
-- PLUGIN: nvim-colorizer
map('n', '<localleader>sc', '<cmd>ColorizerToggle<cr>', { silent = true, desc = 'toggle colorizer' })
map('n', '<localleader>sC', '<cmd>lua require("colorizer").attach_to_buffer(0, {mode = "background"} )<cr>',
{ silent = true, desc = 'colorize background' })

View File

@ -28,7 +28,13 @@ return {
dependencies = { 'rktjmp/fwatch.nvim' }
}, {
'NvChad/nvim-colorizer.lua', -- color hex, named colors in the correct preview scheme
config = true,
config = function()
require('colorizer').setup({
user_default_options = {
mode = 'virtualtext'
}
})
end,
event = "VeryLazy"
}, {
'mhartington/formatter.nvim', -- auto formatting on save