{...}: { programs.nixvim = { autoGroups = { cursor_off = {clear = true;}; numbertoggle = {clear = true;}; coloroverride = {clear = true;}; }; autoCmd = [ { event = ["BufWritePre"]; pattern = ["*"]; command = '' ks | if search("\\s\\+$", 'n') != 0 | :%s/\s\+$// | endif | 's ''; description = '' Remove trailing whitespace on safe :%s/\s\+$\| \+\ze\t//g >> For trailing spaces and spaces before tabstops ''; } { event = ["WinLeave"]; pattern = ["*"]; command = "set nocursorline"; # TODO possible also nocursorcolumn group = "cursor_off"; description = "Display cursorline and cursorcolumn ONLY in active window."; } { event = ["WinEnter"]; pattern = ["*"]; command = "set cursorline"; # TODO possible also cursorcolumn group = "cursor_off"; description = "Display cursorline and cursorcolumn ONLY in active window."; } { event = ["BufEnter" "FocusGained" "InsertLeave" "WinEnter"]; pattern = ["*"]; command = "if &nu && mode() != \"i\" | set rnu | endif"; group = "numbertoggle"; description = "Change line numbers, when not focused"; } { event = ["BufLeave" "FocusLost" "InsertEnter" "WinLeave"]; pattern = ["*"]; command = "if &nu | set nornu | endif"; group = "numbertoggle"; description = "Change line numbers, when not fucused"; } { # Override LineNr event = ["ColorScheme"]; pattern = ["*"]; command = "highlight LineNr ctermfg=DarkGrey guifg=DarkGrey "; group = "coloroverride"; description = "Changes Line number colors"; } { # Override CursorLineNr event = ["ColorScheme"]; pattern = ["*"]; command = "highlight CursorLineNr ctermfg=White guifg=White "; group = "coloroverride"; description = "Changes Line number colors"; } ]; }; }