diff --git a/flake.nix b/flake.nix index 5f0d6a8..38fd089 100644 --- a/flake.nix +++ b/flake.nix @@ -58,6 +58,7 @@ inherit pkgs; libn = nixvim.lib.${system}; + icons = import ./utils/icons.nix; }; }; in diff --git a/plugins/alpha.nix b/plugins/alpha.nix index adaf401..f888ec9 100644 --- a/plugins/alpha.nix +++ b/plugins/alpha.nix @@ -1,6 +1,6 @@ # homepage: https://github.com/goolord/alpha-nvim # nixvim doc: https://nix-community.github.io/nixvim/plugins/alpha/index.html -{ libn, pkgs, ... }: +{ icons, libn, pkgs, ... }: let header = { @@ -30,11 +30,11 @@ let # Use function defined in lua config (see below) to generate buttons val = [ - { __raw = "alpha_button('LDR n ', ' New File')"; } - { __raw = "alpha_button('LDR e ', ' Explorer')"; } - { __raw = "alpha_button('LDR f f', ' Find File')"; } - { __raw = "alpha_button('LDR f o', '󰈙 Recents')"; } - { __raw = "alpha_button('LDR f g', '󰈭 Live Grep')"; } + { __raw = "alpha_button('LDR n ', '${icons.FileNew} New File')"; } + { __raw = "alpha_button('LDR e ', '${icons.FolderOpen} Explorer')"; } + { __raw = "alpha_button('LDR f f', '${icons.Search} Find File')"; } + { __raw = "alpha_button('LDR f o', '${icons.DefaultFile} Recents')"; } + { __raw = "alpha_button('LDR f g', '${icons.WordFile} Live Grep')"; } ]; }; diff --git a/plugins/neo-tree.nix b/plugins/neo-tree.nix index fb42919..d331f50 100644 --- a/plugins/neo-tree.nix +++ b/plugins/neo-tree.nix @@ -1,6 +1,6 @@ # homepage: https://github.com/nvim-neo-tree/neo-tree.nvim # nixvim doc: https://nix-community.github.io/nixvim/plugins/neo-tree/index.html -_: +{ icons, ... }: { opts = { @@ -143,15 +143,15 @@ _: defaultComponentConfigs = { gitStatus.symbols = { - added = ""; - conflict = ""; - deleted = ""; - ignored = "◌"; - modified = ""; - renamed = ""; - staged = ""; - unstaged = ""; - untracked = "★"; + added = icons.GitAdd; + conflict = icons.GitConflict; + deleted = icons.GitDelete; + ignored = icons.GitIgnored; + modified = icons.GitChange; + renamed = icons.GitRenamed; + staged = icons.GitStaged; + unstaged = icons.GitUnstaged; + untracked = icons.GitUntracked; }; }; @@ -177,15 +177,15 @@ _: # Sources to show and their labels sources = [ { - displayName = " Files"; + displayName = "${icons.FolderClosed} Files"; source = "filesystem"; } { - displayName = "󰈙 Bufs"; + displayName = "${icons.DefaultFile} Bufs"; source = "buffers"; } { - displayName = "󰊢 Git"; + displayName = "${icons.Git} Git"; source = "git_status"; } ]; diff --git a/utils/icons.nix b/utils/icons.nix new file mode 100644 index 0000000..97845ba --- /dev/null +++ b/utils/icons.nix @@ -0,0 +1,62 @@ +# Taken from AstroNvim +# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/_astroui.lua#L7-L66 +{ + ActiveLSP = ""; + ActiveTS = ""; + ArrowLeft = ""; + ArrowRight = ""; + Bookmarks = ""; + BufferClose = "󰅖"; + DapBreakpoint = ""; + DapBreakpointCondition = ""; + DapBreakpointRejected = ""; + DapLogPoint = "󰛿"; + DapStopped = "󰁕"; + Debugger = ""; + DefaultFile = "󰈙"; + Diagnostic = "󰒡"; + DiagnosticError = ""; + DiagnosticHint = "󰌵"; + DiagnosticInfo = "󰋼"; + DiagnosticWarn = ""; + Ellipsis = "…"; + Environment = ""; + FileNew = ""; + FileModified = ""; + FileReadOnly = ""; + FoldClosed = ""; + FoldOpened = ""; + FoldSeparator = " "; + FolderClosed = ""; + FolderEmpty = ""; + FolderOpen = ""; + Git = "󰊢"; + GitAdd = ""; + GitBranch = ""; + GitChange = ""; + GitConflict = ""; + GitDelete = ""; + GitIgnored = "◌"; + GitRenamed = "➜"; + GitSign = "▎"; + GitStaged = "✓"; + GitUnstaged = "✗"; + GitUntracked = "★"; + LSPLoading1 = ""; + LSPLoading2 = "󰀚"; + LSPLoading3 = ""; + MacroRecording = ""; + Package = "󰏖"; + Paste = "󰅌"; + Refresh = ""; + Search = ""; + Selected = "❯"; + Session = "󱂬"; + Sort = "󰒺"; + Spellcheck = "󰓆"; + Tab = "󰓩"; + TabClose = "󰅙"; + Terminal = ""; + Window = ""; + WordFile = "󰈭"; +}