summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2024-02-06 23:50:43 +0100
committerEkaitz Zarraga <ekaitz@elenq.tech>2024-02-06 23:50:43 +0100
commit70ee2964919c53a5b16e8c7917f174139ce6a58e (patch)
tree14b2c0fde1d9670b365a6bed001d084600a0459f
parentc167f6ecf9c4e21846b608d9d96fee6d32fd7e8b (diff)
nvim: colorcolumn after editorconfig is loaded
-rw-r--r--nvim/nvim/init.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/nvim/nvim/init.lua b/nvim/nvim/init.lua
index 1145a29..1193861 100644
--- a/nvim/nvim/init.lua
+++ b/nvim/nvim/init.lua
@@ -37,10 +37,7 @@ vim.cmd.colorscheme("dracula")
vim.opt.cursorline = true
vim.cmd.highlight("CursorColumn", "ctermbg=DarkGrey", "guibg=#262626")
vim.cmd.highlight("CursorLine", "ctermbg=DarkGrey", "guibg=#262626")
-
-vim.opt.colorcolumn = "80"
vim.cmd.highlight("ColorColumn", "ctermbg=DarkGrey", "guibg=#262626")
-
vim.cmd.highlight("ExtraWhitespace", "ctermbg=red", "guibg=red")
-- HighLight search
@@ -113,6 +110,14 @@ vim.opt.shiftwidth=4
-- Formatting
vim.opt.textwidth=79
vim.opt.formatoptions="jcroql"
+-- Put colorcolumn after editorconfig is loaded
+vim.api.nvim_create_autocmd({ "BufEnter" }, {
+ pattern = { "*" },
+ callback = function()
+ vim.opt.colorcolumn=tostring(vim.o.textwidth+1)
+ end,
+})
+
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all"