aboutsummaryrefslogtreecommitdiffstats
path: root/home-manager/soispha/config/neovim/nixvim/autocmds
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-08-26 23:42:21 +0200
committerSoispha <soispha@vhack.eu>2023-08-26 23:42:21 +0200
commit3f600ab07dbad3b6dd7655587ddea158b19aea71 (patch)
tree7164ccd965e1d14ade970aeb8eb188b1442a6c91 /home-manager/soispha/config/neovim/nixvim/autocmds
parentStyle(treewide): Format all lua-files makes lua ➛ nix easier (diff)
downloadnixos-config-3f600ab07dbad3b6dd7655587ddea158b19aea71.zip
Refactor(treewide): Abbreviate path names
Diffstat (limited to 'home-manager/soispha/config/neovim/nixvim/autocmds')
-rw-r--r--home-manager/soispha/config/neovim/nixvim/autocmds/default.nix99
1 files changed, 0 insertions, 99 deletions
diff --git a/home-manager/soispha/config/neovim/nixvim/autocmds/default.nix b/home-manager/soispha/config/neovim/nixvim/autocmds/default.nix
deleted file mode 100644
index cb0311fb..00000000
--- a/home-manager/soispha/config/neovim/nixvim/autocmds/default.nix
+++ /dev/null
@@ -1,99 +0,0 @@
-{config, ...}: {
- programs.nixvim = {
- autoGroups = {
- cursor_off = {clear = true;};
- colorcolumn_toggle = {clear = true;};
- numbertoggle = {clear = true;};
- coloroverride = {clear = true;};
- highlight_on_yank = {clear = true;};
- };
- autoCmd = [
- {
- event = ["TextYankPost"];
- pattern = ["*"];
- callback = {
- __raw = ''
- function()
- vim.highlight.on_yank()
- end
- '';
- };
- group = "highlight_on_yank";
- description = "Highlight the yanked text";
- }
- {
- 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 = ["InsertEnter"];
- pattern = ["*"];
- command = "set colorcolumn=${config.programs.nixvim.options.colorcolumn}";
- group = "colorcolumn_toggle";
- description = "Only activate the colorcolumn when focused";
- }
- {
- event = ["BufLeave" "FocusLost" "InsertLeave" "WinLeave"];
- pattern = ["*"];
- command = "set colorcolumn=0";
- group = "colorcolumn_toggle";
- description = "Only activate the colorcolumn when focused";
- }
-
- {
- 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 focused";
- }
-
- {
- # 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";
- }
- ];
- };
-}