From c8901181f2c1352d58a43197c0cb4d0bc1da1b2a Mon Sep 17 00:00:00 2001 From: lelgenio Date: Thu, 24 Feb 2022 11:10:58 -0300 Subject: [PATCH] fish: extract plugins config --- dotfiles/fish/config.fish | 16 +--------------- dotfiles/fish/env.fish | 8 ++++++-- dotfiles/fish/plugins.fish | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 dotfiles/fish/plugins.fish diff --git a/dotfiles/fish/config.fish b/dotfiles/fish/config.fish index 3c7ca40..59884e4 100644 --- a/dotfiles/fish/config.fish +++ b/dotfiles/fish/config.fish @@ -15,21 +15,7 @@ if status is-interactive source {$__fish_config_dir}/keys.fish source {$__fish_config_dir}/tmux.fish source {$__fish_config_dir}/colors.fish - - if not functions -q fundle - eval (curl -sfL https://git.io/fundle-install) - end - fundle plugin 'FabioAntunes/fish-nvm' - fundle plugin 'edc/bass' - fundle init - - {%@@ if starship @@%} - starship init fish | source - # Set cursor shape - printf '\e[5 q' # Bar - {%@@ else @@%} - source {$__fish_config_dir}/prompt.fish - {%@@ endif @@%} + source {$__fish_config_dir}/plugins.fish end diff --git a/dotfiles/fish/env.fish b/dotfiles/fish/env.fish index bc81424..8f7dfcc 100644 --- a/dotfiles/fish/env.fish +++ b/dotfiles/fish/env.fish @@ -14,6 +14,8 @@ set -x XDG_DATA_DIRS "$XDG_DATA_DIRS:$HOME/.local/share/flatpak/exports/share" set -x XDG_DATA_DIRS "$XDG_DATA_DIRS:/usr/share" set -x XDG_DATA_DIRS "$XDG_DATA_DIRS:$HOME/.local/share" +set -x XDG_CONFIG_HOME "$HOME/.config/" + for i in ~/.local/bin ~/.local/share/cargo/bin ~/.yarn/bin ~/.factorio/bin/* test -d "$i";and fish_add_path "$i" end @@ -42,13 +44,15 @@ end if test "$USER" != "root" set -x PYTHONPYCACHEPREFIX "$HOME/.cache/python" set -x MYPY_CACHE_DIR "$HOME/.cache/mypy" - set -x RUSTUP_HOME $HOME/.local/share/rustup - set -x CARGO_HOME $HOME/.local/share/cargo + set -x RUSTUP_HOME "$HOME/.local/share/rustup" + set -x CARGO_HOME "$HOME/.local/share/cargo" + set -gx NVM_DIR "$HOME/.local/share/nvm" else set -e PYTHONPYCACHEPREFIX set -e MYPY_CACHE_DIR set -e RUSTUP_HOME set -e CARGO_HOME + set -ge NVM_DIR end diff --git a/dotfiles/fish/plugins.fish b/dotfiles/fish/plugins.fish new file mode 100644 index 0000000..3ff2833 --- /dev/null +++ b/dotfiles/fish/plugins.fish @@ -0,0 +1,21 @@ +set -l NVM_URL "https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh" +if not test -d "$NVM_DIR" + set -e nvm_prefix + mkdir -p "$NVM_DIR" + curl -o- "$NVM_URL" | bash +end + +if not functions -q fundle + eval (curl -sfL https://git.io/fundle-install) +end +fundle plugin 'FabioAntunes/fish-nvm' +fundle plugin 'edc/bass' +fundle init + +{%@@ if starship @@%} + starship init fish | source + # Set cursor shape + printf '\e[5 q' # Bar +{%@@ else @@%} + source {$__fish_config_dir}/prompt.fish +{%@@ endif @@%}