From 0c8e8c27d4dc61afd6e25023ebaff58922b4a531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Mon, 6 Jul 2026 13:58:29 +0200 Subject: [PATCH] feat: update nvim config --- hosts/MONSTER/default.nix | 1 + hosts/aero/default.nix | 1 + hosts/shark/default.nix | 1 + .../modules/nixvim/auto-session.nix | 5 +- .../home-manager/modules/nixvim/base/tabs.nix | 116 ++++++++++++++++++ .../home-manager/modules/nixvim/base/tree.nix | 4 + .../home-manager/modules/nixvim/base/yazi.nix | 47 +++++++ .../home-manager/modules/nixvim/default.nix | 2 + modules/home-manager/programs/nixvim.nix | 5 +- modules/home-manager/theme/nvim.vim | 18 +++ 10 files changed, 194 insertions(+), 6 deletions(-) create mode 100644 modules/home-manager/modules/nixvim/base/tabs.nix create mode 100644 modules/home-manager/modules/nixvim/base/yazi.nix diff --git a/hosts/MONSTER/default.nix b/hosts/MONSTER/default.nix index bdcb85e..48862ec 100644 --- a/hosts/MONSTER/default.nix +++ b/hosts/MONSTER/default.nix @@ -190,6 +190,7 @@ p7zip fzf eza + yazi # docker ausweisapp ]; diff --git a/hosts/aero/default.nix b/hosts/aero/default.nix index fbf6ca1..23ef89c 100644 --- a/hosts/aero/default.nix +++ b/hosts/aero/default.nix @@ -166,6 +166,7 @@ p7zip fzf eza + yazi ]; networking = { diff --git a/hosts/shark/default.nix b/hosts/shark/default.nix index 4e1f30a..01b9d28 100644 --- a/hosts/shark/default.nix +++ b/hosts/shark/default.nix @@ -185,6 +185,7 @@ p7zip fzf eza + yazi ]; networking = { diff --git a/modules/home-manager/modules/nixvim/auto-session.nix b/modules/home-manager/modules/nixvim/auto-session.nix index 40bfa0a..58a5a20 100644 --- a/modules/home-manager/modules/nixvim/auto-session.nix +++ b/modules/home-manager/modules/nixvim/auto-session.nix @@ -14,6 +14,7 @@ in "buffers" "curdir" "folds" + "globals" "help" "tabpages" "winsize" @@ -34,10 +35,6 @@ in }; }; lz-n.enable = true; - neo-tree.lazyLoad = { - enable = true; - settings.cmd = "Neotree"; - }; fidget.lazyLoad = { enable = true; settings = { diff --git a/modules/home-manager/modules/nixvim/base/tabs.nix b/modules/home-manager/modules/nixvim/base/tabs.nix new file mode 100644 index 0000000..868492a --- /dev/null +++ b/modules/home-manager/modules/nixvim/base/tabs.nix @@ -0,0 +1,116 @@ +{ lib, config, ... }: +let + cfg = config.presets.base.tabs; +in +{ + options.presets.base.tabs = { + enable = lib.mkEnableOption "Tabs"; + }; + + config = lib.mkIf cfg.enable { + keymaps = [ + { + key = ""; + action = # vim + "BufferPrevious"; + options.desc = "Navigate Buffer Left"; + } + { + key = ""; + action = # vim + "BufferNext"; + options.desc = "Navigate Buffer Right"; + } + { + key = ""; + action = # vim + "BufferMovePrevious"; + options.desc = "Move Buffer Left"; + } + { + key = ""; + action = # vim + "BufferMoveNext"; + options.desc = "Move Buffer Right"; + } + { + key = ""; + action = # vim + "BufferPin"; + options.desc = "Pin Buffer"; + } + { + key = ""; + action = # vim + "BufferClose"; + options.desc = "Close Buffer"; + } + { + key = ""; + action = # vim + "BufferRestore"; + options.desc = "Close Buffer"; + } + { + key = "gb"; + action = # vim + "BufferPick"; + options.desc = "Pick Buffer"; + } + ]; + plugins = { + barbar = { + enable = true; + settings = { + highlight_inactive_file_icons = true; + icons = { + button = ""; + separator = { + left = ""; + right = ""; + }; + modified.button = ""; + separator_at_end = false; + pinned = { + button = ""; + filename = true; + }; + current = { + filetype.custom_colors = true; + separator = { + left = ""; + right = ""; + }; + }; + inactive = { + separator = { + left = ""; + right = ""; + }; + }; + }; + minimum_padding = 1; + maximum_padding = 1; + letters = "etarfkcdmhsunobwgiyzqxvplj.,-ETARFKCDMHSUNOBWGIYZQXVPLJ"; + }; + }; + /* + scope = { + enable = true; + settings.hooks = { + pre_tab_leave.__raw = '' + function() + vim.api.nvim_exec_autocmds('User', {pattern = 'ScopeTabLeavePre'}) + end + ''; + post_tab_enter.__raw = '' + function() + vim.api.nvim_exec_autocmds('User', {pattern = 'ScopeTabEnterPost'}) + end + ''; + }; + }; + */ + }; + }; +} diff --git a/modules/home-manager/modules/nixvim/base/tree.nix b/modules/home-manager/modules/nixvim/base/tree.nix index 5c6d1d6..01b85c3 100644 --- a/modules/home-manager/modules/nixvim/base/tree.nix +++ b/modules/home-manager/modules/nixvim/base/tree.nix @@ -20,6 +20,10 @@ in web-devicons.enable = true; neo-tree = { enable = true; + lazyLoad = { + enable = true; + settings.cmd = "Neotree"; + }; settings = { window.position = "float"; filesystem = { diff --git a/modules/home-manager/modules/nixvim/base/yazi.nix b/modules/home-manager/modules/nixvim/base/yazi.nix new file mode 100644 index 0000000..132cf44 --- /dev/null +++ b/modules/home-manager/modules/nixvim/base/yazi.nix @@ -0,0 +1,47 @@ +{ lib, config, ... }: +let + cfg = config.presets.base.yazi; +in +{ + options.presets.base.yazi = { + enable = lib.mkEnableOption "yazi"; + }; + + config = lib.mkIf cfg.enable { + keymaps = [ + { + key = "y"; + mode = [ + "n" + "v" + ]; + action = # vim + "Yazi"; + } + ]; + globals.loaded_netrwPlugin = 1; + plugins = { + web-devicons.enable = true; + yazi = { + enable = true; + settings = { + enable_mouse_support = true; + open_for_directories = true; + yazi_floating_window_border = "none"; + keymaps.show_help = ""; + }; + lazyLoad = { + enable = true; + settings.cmd = "Yazi"; + }; + }; + which-key.settings.spec = [ + { + __unkeyed-1 = "y"; + desc = "Yazi"; + icon = "󰙅"; + } + ]; + }; + }; +} diff --git a/modules/home-manager/modules/nixvim/default.nix b/modules/home-manager/modules/nixvim/default.nix index 53bed30..3c3c3d9 100644 --- a/modules/home-manager/modules/nixvim/default.nix +++ b/modules/home-manager/modules/nixvim/default.nix @@ -34,7 +34,9 @@ ./base/spellcheck.nix ./base/status-line.nix ./base/syntax.nix + ./base/tabs.nix ./base/tree.nix + ./base/yazi.nix ./languages/angular.nix ./languages/c.nix diff --git a/modules/home-manager/programs/nixvim.nix b/modules/home-manager/programs/nixvim.nix index 4b43886..9035a70 100644 --- a/modules/home-manager/programs/nixvim.nix +++ b/modules/home-manager/programs/nixvim.nix @@ -60,7 +60,6 @@ lazygit.enable = true; mergetool.enable = true; undotree.enable = true; - harpoon.enable = true; base = { completion = { enable = true; @@ -77,7 +76,8 @@ spellcheck.enable = true; status-line.enable = true; syntax.enable = true; - tree.enable = true; + tabs.enable = true; + yazi.enable = true; }; languages = { c.enable = true; @@ -116,6 +116,7 @@ origami.enable = false; nvim-surround.enable = true; fidget.enable = true; + gitsigns.enable = true; treesitter-context = { enable = false; # TODO: looks weird with Neovide settings.line_numbers = false; diff --git a/modules/home-manager/theme/nvim.vim b/modules/home-manager/theme/nvim.vim index bd3892c..71b54ee 100644 --- a/modules/home-manager/theme/nvim.vim +++ b/modules/home-manager/theme/nvim.vim @@ -221,6 +221,24 @@ hi! MatchParen gui=none guibg={{colors.surface_container_highest.default.hex}} hi! LspInlayHint gui=italic guifg={{colors.outline.default.hex}} guibg={{colors.surface_container_highest.default.hex}} +hi BufferCurrent guibg={{colors.primary.default.hex}} guifg={{colors.on_primary.default.hex}} +hi BufferCurrentMod guibg={{colors.primary.default.hex}} guifg={{colors.on_primary.default.hex}} +hi BufferCurrentIcon guibg={{colors.primary.default.hex}} guifg={{colors.on_primary.default.hex}} +hi BufferCurrentSign guibg={{colors.surface.default.hex}} guifg={{colors.primary.default.hex}} +hi BufferCurrentTarget guibg={{colors.primary.default.hex}} guifg={{colors.on_primary.default.hex}} + +hi BufferVisible guibg={{colors.primary_container.default.hex}} guifg={{colors.on_primary_container.default.hex}} +hi BufferVisibleIcon guibg={{colors.primary_container.default.hex}} +hi BufferVisibleSign guibg={{colors.surface.default.hex}} guifg={{colors.primary_container.default.hex}} +hi BufferVisibleTarget guibg={{colors.primary_container.default.hex}} guifg={{colors.primary.default.hex}} + +hi BufferInactive guibg={{colors.surface.default.hex}} guifg={{colors.on_surface.default.hex}} +hi BufferInactiveIcon guibg={{colors.surface.default.hex}} +hi BufferInactiveSign guibg={{colors.surface.default.hex}} guifg={{colors.outline.default.hex}} +hi BufferInactiveTarget guibg={{colors.surface.default.hex}} guifg={{colors.primary.default.hex}} + +hi BufferTabpageFill guibg={{colors.surface.default.hex}} guifg={{colors.on_surface.default.hex}} + let g:lualine_theme = { \ "insert": { \ "a": {"fg": "{{colors.on_green.default.hex}}", "bg": "{{colors.green.default.hex}}", "gui": "bold"},