Skip to content

Commit

Permalink
refactor(fish): improve config speed time
Browse files Browse the repository at this point in the history
  • Loading branch information
olimorris committed Dec 2, 2024
1 parent 5043673 commit 43fb660
Showing 1 changed file with 24 additions and 30 deletions.
54 changes: 24 additions & 30 deletions .config/fish/config.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

set -u fish_greeting ""
set -g fish_greeting ""

# Variables
set -x GPG_TTY (tty)
Expand All @@ -8,41 +7,36 @@ set -x DOTNET_CLI_TELEMETRY_OPTOUT 1
set -x HOMEBREW_NO_ANALYTICS 1
set -x GOPATH "$HOME/Code/Go"
set -x STARSHIP_CONFIG "$HOME/.config/starship/starship.toml"
set -gx macOS_Theme (cat $HOME/.color_mode | string collect)

set fish_color_param cyan
set fish_pager_color_completion blue --bold
set fish_color_normal black
set fish_color_error red
set fish_color_comment gray
set fish_color_autosuggestion gray

if [ "$macOS_Theme" = light ]
set -x LS_COLORS "vivid generate $HOME/.config/vivid/onelight.yml"
else
set -x LS_COLORS "vivid generate $HOME/.config/vivid/onedark.yml"
end
# set -gx macOS_Theme (cat $HOME/.color_mode | string collect)

set -g fish_color_param cyan
set -g fish_color_normal black
set -g fish_color_error red
set -g fish_color_comment gray
set -g fish_color_autosuggestion gray
set -g fish_pager_color_completion blue --bold

# if [ "$macOS_Theme" = light ]
# set -x LS_COLORS "vivid generate $HOME/.config/vivid/onelight.yml"
# else
# set -x LS_COLORS "vivid generate $HOME/.config/vivid/onedark.yml"
# end

# Paths
fish_add_path /opt/homebrew/bin
fish_add_path /opt/homebrew/sbin
fish_add_path "$HOME/.cargo/bin"
fish_add_path "$HOME/.dotfiles/bin"
fish_add_path "$HOME/.local/share/nvim/mason/bin"
fish_add_path "$HOME/.local/share/bob/nvim-bin"
# Paths
fish_add_path -p /opt/homebrew/sbin /opt/homebrew/bin "$HOME/.cargo/bin" "$HOME/.dotfiles/bin" "$HOME/.local/share/nvim/mason/bin" "$HOME/.local/share/bob/nvim-bin"

source $HOME/.config/fish/fzf.fish
source $HOME/.config/fish/aliases.fish
source $HOME/.config/fish/functions.fish

if type -q zoxide
zoxide init fish | source
set -x _ZO_DATA_DIR "$HOME/.local/share/zoxide"
set -x _ZO_ECHO 1
set -x _ZO_RESOLVE_SYMLINKS 1
end

if status is-interactive
load_env_vars ~/.env

# Cache zoxide init output
source ~/.cache/zoxide.fish 2>/dev/null; or begin
zoxide init fish > ~/.cache/zoxide.fish
source ~/.cache/zoxide.fish
end

starship init fish | source
end

0 comments on commit 43fb660

Please sign in to comment.