From 70ee2964919c53a5b16e8c7917f174139ce6a58e Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Tue, 6 Feb 2024 23:50:43 +0100 Subject: nvim: colorcolumn after editorconfig is loaded --- nvim/nvim/init.lua | 11 ++++++++--- 1 file 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" -- cgit v1.2.3