From a00c0a0bd027c0a74fb0e377be23837d5ba91c3f Mon Sep 17 00:00:00 2001 From: Roel de Cort Date: Fri, 10 May 2024 22:48:28 +0200 Subject: [PATCH] add gitsigns, add nvim-web-devicons, update lualine and neo-tree --- config/default.nix | 2 + config/plugins/editor/neo-tree.nix | 3 ++ config/plugins/git/gitsigns.nix | 27 +++++++++++ config/plugins/ui/lualine.nix | 67 +++++++++++++------------- config/plugins/utils/extra_plugins.nix | 5 ++ 5 files changed, 70 insertions(+), 34 deletions(-) create mode 100644 config/plugins/git/gitsigns.nix create mode 100644 config/plugins/utils/extra_plugins.nix diff --git a/config/default.nix b/config/default.nix index b862321..455a607 100644 --- a/config/default.nix +++ b/config/default.nix @@ -36,9 +36,11 @@ _: { # Git ./plugins/git/lazygit.nix + ./plugins/git/gitsigns.nix # Utils ./plugins/utils/telescope.nix ./plugins/utils/whichkey.nix + ./plugins/utils/extra_plugins.nix ]; } diff --git a/config/plugins/editor/neo-tree.nix b/config/plugins/editor/neo-tree.nix index cb7589e..f8d8403 100644 --- a/config/plugins/editor/neo-tree.nix +++ b/config/plugins/editor/neo-tree.nix @@ -6,6 +6,9 @@ filesystem = { bindToCwd = false; + followCurrentFile = { + enabled = true; + }; }; defaultComponentConfigs = { diff --git a/config/plugins/git/gitsigns.nix b/config/plugins/git/gitsigns.nix new file mode 100644 index 0000000..0133ac3 --- /dev/null +++ b/config/plugins/git/gitsigns.nix @@ -0,0 +1,27 @@ +_: { + plugins.gitsigns = { + enable = true; + settings = { + signs = { + add = { + text = "▎"; + }; + change = { + text = "▎"; + }; + delete = { + text = ""; + }; + topdelete = { + text = ""; + }; + changedelete = { + text = "▎"; + }; + untracked = { + text = "▎"; + }; + }; + }; + }; +} diff --git a/config/plugins/ui/lualine.nix b/config/plugins/ui/lualine.nix index 592231c..5219f62 100644 --- a/config/plugins/ui/lualine.nix +++ b/config/plugins/ui/lualine.nix @@ -3,34 +3,24 @@ _: { enable = true; globalstatus = true; disabledFiletypes = { - statusline = ["dashboard" "alpha"]; + statusline = ["startup" "alpha"]; }; theme = "catppuccin"; sections = { lualine_a = [ { name = "mode"; - fmt = "string.lower"; - color = { - fg = "none"; - bg = "none"; - }; } ]; lualine_b = [ { name = "branch"; icon = ""; - color = { - fg = "none"; - bg = "none"; - }; } - "diff" ]; lualine_c = [ { - name = "diagnostic"; + name = "diagnostics"; extraConfig = { symbols = { error = " "; @@ -39,44 +29,53 @@ _: { hint = "󰝶 "; }; }; - color = { - fg = "none"; - bg = "none"; + } + { + name = "filetype"; + extraConfig = { + icon_only = true; + separator = ""; + padding = { + left = 1; + right = 0; + }; }; } ]; lualine_x = [ { - name = "filetype"; + name = "diff"; extraConfig = { - icon_only = true; + symbos = { + added = " "; + modified = " "; + removed = " "; + }; + source = { + __raw = '' + function() + local gitsings = vim.b.gitsigns_status_dict + if gitsigns then + return { + added = gitigns.added, + modified = gitigns.changed, + removed = gitigns.removed + } + end + end + ''; + }; }; } ]; lualine_y = [ { - name = "filename"; - extraConfig = { - symbols = { - modified = ""; - readonly = ""; - unnamed = ""; - }; - }; - color = { - fg = "none"; - bg = "none"; - }; - separator.left = ""; + name = "progress"; } ]; lualine_z = [ { name = "location"; - color = { - fg = "none"; - bg = "none"; - }; } ]; }; diff --git a/config/plugins/utils/extra_plugins.nix b/config/plugins/utils/extra_plugins.nix new file mode 100644 index 0000000..0304bc7 --- /dev/null +++ b/config/plugins/utils/extra_plugins.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + nvim-web-devicons + ]; +}