From 115ed0ef2dcfe49c67b594514a90e1cc25188125 Mon Sep 17 00:00:00 2001 From: xengineering Date: Wed, 29 Apr 2026 08:12:39 +0200 Subject: nvim: Use colorcolumn per file type This removes the global colorcolumn and adds one for Python and C. This allows to have a distraction free experience on all other file types and ones adapted to code guidelines for Python and C. --- nvim/ftplugin/c.lua | 1 + nvim/ftplugin/python.lua | 1 + nvim/init.lua | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 nvim/ftplugin/c.lua create mode 100644 nvim/ftplugin/python.lua diff --git a/nvim/ftplugin/c.lua b/nvim/ftplugin/c.lua new file mode 100644 index 0000000..ab34114 --- /dev/null +++ b/nvim/ftplugin/c.lua @@ -0,0 +1 @@ +vim.opt.colorcolumn = {81} diff --git a/nvim/ftplugin/python.lua b/nvim/ftplugin/python.lua new file mode 100644 index 0000000..ac91ce3 --- /dev/null +++ b/nvim/ftplugin/python.lua @@ -0,0 +1 @@ +vim.opt.colorcolumn = {89} diff --git a/nvim/init.lua b/nvim/init.lua index f29938d..93b12e3 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -25,7 +25,6 @@ vim.opt.number = true vim.opt.shiftwidth = 4 vim.opt.autoindent = true vim.opt.spelllang = {'en_gb', 'de_de'} -vim.opt.colorcolumn = {81} vim.opt.encoding = 'utf-8' vim.opt.fileencodings = {'utf-8'} vim.opt.list = true -- cgit v1.3.1