diff --git a/fish/conf.d/.gitignore b/fish/conf.d/.gitignore new file mode 100644 index 0000000..c989a98 --- /dev/null +++ b/fish/conf.d/.gitignore @@ -0,0 +1 @@ +secret.fish diff --git a/fish/conf.d/colors.fish b/fish/conf.d/colors.fish new file mode 100644 index 0000000..db6b496 --- /dev/null +++ b/fish/conf.d/colors.fish @@ -0,0 +1,12 @@ +set fish_color_user normal +set fish_color_host blue +set fish_color_host_remote blue +set fish_color_command blue +set fish_color_quote purple +set fish_color_keyword yellow +set fish_color_option normal +set fish_color_param normal +set fish_color_valid_path green +set fish_color_comment gray +set fish_color_operator cyan +set fish_color_cancel red diff --git a/fish/conf.d/composer.fish b/fish/conf.d/composer.fish index 1b1a444..9f7525f 100644 --- a/fish/conf.d/composer.fish +++ b/fish/conf.d/composer.fish @@ -1 +1,3 @@ -fish_add_path -a $HOME/.config/composer/vendor/bin +if [ -f "$HOME/.config/composer/vendor/bin" ] + fish_add_path -a $HOME/.config/composer/vendor/bin +end diff --git a/fish/conf.d/editor.fish b/fish/conf.d/editor.fish new file mode 100644 index 0000000..db4dbf1 --- /dev/null +++ b/fish/conf.d/editor.fish @@ -0,0 +1,3 @@ +if command -q nvim + set -x EDITOR nvim +end diff --git a/fish/conf.d/go.fish b/fish/conf.d/go.fish index 47a7dfc..2408b47 100644 --- a/fish/conf.d/go.fish +++ b/fish/conf.d/go.fish @@ -1 +1,3 @@ -fish_add_path (go env GOPATH)/bin +if command -q go + fish_add_path (go env GOPATH)/bin +end diff --git a/fish/conf.d/path.fish b/fish/conf.d/path.fish new file mode 100644 index 0000000..3735236 --- /dev/null +++ b/fish/conf.d/path.fish @@ -0,0 +1,2 @@ +fish_add_path $HOME/bin +fish_add_path $HOME/.local/bin diff --git a/fish/config.fish b/fish/config.fish index 2dd3ad1..eee0f20 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -3,24 +3,5 @@ if status is-interactive set -x GPG_TTY (tty) end +# Disable greeting set -g fish_greeting - -# Path stuff -fish_add_path $HOME/bin -fish_add_path $HOME/.local/bin - -set -x EDITOR nvim - -# Colors -set fish_color_user normal -set fish_color_host blue -set fish_color_host_remote blue -set fish_color_command blue -set fish_color_quote purple -set fish_color_keyword yellow -set fish_color_option normal -set fish_color_param normal -set fish_color_valid_path green -set fish_color_comment gray -set fish_color_operator cyan -set fish_color_cancel red diff --git a/fish/functions/tree.fish b/fish/functions/tree.fish index 448de35..b437e12 100644 --- a/fish/functions/tree.fish +++ b/fish/functions/tree.fish @@ -1,6 +1,6 @@ function tree - if test -f /usr/bin/eza - /usr/bin/eza -T $argv + if command -q eza + eza -T $argv else /bin/tree $argv end diff --git a/fish/functions/vim.fish b/fish/functions/vim.fish index badff72..7c4bda9 100644 --- a/fish/functions/vim.fish +++ b/fish/functions/vim.fish @@ -1,3 +1,10 @@ function vim --wraps=nvim --description 'alias vim nvim' - nvim $argv + if command -q nvim + nvim $argv + else if command -q vim + command vim $argv + else + echo "fish: unknown command: vim" + return 127 + end end