diff options
| author | José Juan Loeza Sierra <jj@xz6ze.com> | 2025-06-13 01:02:52 -0700 |
|---|---|---|
| committer | José Juan Loeza Sierra <jj@xz6ze.com> | 2025-06-13 01:02:52 -0700 |
| commit | ef91c646f7d7ce5a2547ce9badae64572d6fa1f4 (patch) | |
| tree | f7f9bebd062779c0acc4ae0a9172c08683c34da0 /dot-config/fish | |
| parent | e06462207c18f18e5926ff80869b8af5e4fdaf4a (diff) | |
move all into one single .config directory
Moves of the config files into a single dot-config directory, simplifying the structure and the usage of stow. dot-config gets processed into .config by stow.
See the `--dotfiles` option at https://www.gnu.org/software/stow/manual/stow.html#Invoking-Stow for more information
Diffstat (limited to 'dot-config/fish')
| -rw-r--r-- | dot-config/fish/config.fish | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dot-config/fish/config.fish b/dot-config/fish/config.fish new file mode 100644 index 0000000..f8fcc91 --- /dev/null +++ b/dot-config/fish/config.fish @@ -0,0 +1,43 @@ +# Setup Homebrew +# Source of code: https://github.com/orgs/Homebrew/discussions/4412#discussioncomment-8651316 +if test -d /home/linuxbrew/.linuxbrew # Linux + set -gx HOMEBREW_PREFIX "/home/linuxbrew/.linuxbrew" + set -gx HOMEBREW_CELLAR "$HOMEBREW_PREFIX/Cellar" + set -gx HOMEBREW_REPOSITORY "$HOMEBREW_PREFIX/Homebrew" +else if test -d /opt/homebrew # MacOS + set -gx HOMEBREW_PREFIX /opt/homebrew + set -gx HOMEBREW_CELLAR "$HOMEBREW_PREFIX/Cellar" + set -gx HOMEBREW_REPOSITORY "$HOMEBREW_PREFIX/homebrew" + # Add SSH key to ssh-agent and store passphrase + # see https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent + ssh-add --apple-use-keychain ~/.ssh/id_ed25519 +end +fish_add_path -gP "$HOMEBREW_PREFIX/bin" "$HOMEBREW_PREFIX/sbin" +! set -q MANPATH; and set MANPATH '' +set -gx MANPATH "$HOMEBREW_PREFIX/share/man" $MANPATH +! set -q INFOPATH; and set INFOPATH '' +set -gx INFOPATH "$HOMEBREW_PREFIX/share/info" $INFOPATH + +# Hook direnv +# Source: https://direnv.net/docs/hook.html +direnv hook fish | source + +# the reverse of fish_remove_path +# fish doesn't provide this out of the box, so we provide our own +# see https://fishshell.com/docs/current/cmds/fish_add_path.html#index-8 for fish_add_path +# source: https://github.com/fish-shell/fish-shell/issues/8604#issuecomment-1169638533 +function fish_remove_path + if set -l index (contains -i "$argv" $fish_user_paths) + set -e fish_user_paths[$index] + echo "Removed $argv from the path" + end +end + +# Kitty shell alias +alias ks="kitten ssh" + +# Nvim alias +alias v="nvim" + +# Starship +starship init fish | source |
