Cleaner fish configuration and temporary ingnore of fish_variables

This commit is contained in:
Eduardo Cueto-Mendoza 2024-12-27 11:07:52 +00:00
parent 0de62ea21d
commit 1a3802cdac
2 changed files with 23 additions and 104 deletions

1
.config/fish/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
fish_variables

View File

@ -93,21 +93,28 @@ switch (uname)
#echo Hi Hexley! #echo Hi Hexley!
fish_vi_key_bindings fish_vi_key_bindings
set ID (id -u) set ID (id -u)
# Start tmux ## Start tmux
if not set -q TMUX; and [ $ID != 0 ] #if not set -q TMUX; and [ $ID != 0 ]
echo "Setting tmux" # echo "Setting tmux"
set -g TMUX tmux new-session -d -s base # set -g TMUX tmux new-session -d -s base
eval $TMUX # eval $TMUX
tmux attach-session -d -t base # tmux attach-session -d -t base
end #end
# PATH # PATH
# Rust # Homebrew
source "$HOME/.cargo/env.fish" fish_add_path -a /opt/homebrew/bin
fish_add_path -a /opt/homebrew/sbin
# Java
fish_add_path -a /opt/homebrew/Cellar/openjdk/23.0.1/bin
# Ruby
fish_add_path -a /opt/homebrew/lib/ruby/gems/3.3.0/bin
# pyenv # pyenv
#export PYENV_ROOT="$HOME/.pyenv" set -x PYENV_ROOT "$HOME/.pyenv"
#export PATH="$PYENV_ROOT/bin:$PATH" fish_add_path -a $PYENV_ROOT/bin
pyenv init - | source pyenv init - | source
status --is-interactive; and pyenv virtualenv-init - | source status --is-interactive; and pyenv virtualenv-init - | source
@ -121,17 +128,17 @@ switch (uname)
end end
# Editor # Editor
set -x EDITOR='nvim' set -x EDITOR 'nvim'
# Manpager # Manpager
set -x PAGER='nvim +Man!' set -x PAGER 'nvim +Man!'
# Term for ssh # Term for ssh
#export TERM='xterm-256color' #export TERM='xterm-256color'
# Homebrew # Homebrew
set -x HOMEBREW_NO_AUTO_UPDATE=1 set -x HOMEBREW_NO_AUTO_UPDATE 1
set -x HOMEBREW_NO_ENV_HINTS=1 set -x HOMEBREW_NO_ENV_HINTS 1
# DBUS for zathura # DBUS for zathura
#export DBUS_LAUNCHD_SESSION_BUS_SOCKET=/tmp/(id -u) #export DBUS_LAUNCHD_SESSION_BUS_SOCKET=/tmp/(id -u)
@ -178,95 +185,6 @@ switch (uname)
/usr/bin/git $argv /usr/bin/git $argv
end end
end end
case Darwin
#echo Hi Hexley!
fish_vi_key_bindings
set ID (id -u)
## Start tmux
#if not set -q TMUX; and [ $ID != 0 ]
# echo "Setting tmux"
# set -g TMUX tmux new-session -d -s base
# eval $TMUX
# tmux attach-session -d -t base
#end
# PATH
# Rust
source "$HOME/.cargo/env.fish"
# pyenv
#export PYENV_ROOT="$HOME/.pyenv"
#export PATH="$PYENV_ROOT/bin:$PATH"
pyenv init - | source
status --is-interactive; and pyenv virtualenv-init - | source
# VARIABLES
if [ $ID != 0 ]
# ssh and gpg
set -x GPG_TTY (tty)
set -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent
gpg-connect-agent updatestartuptty /bye > /dev/null
end
# Editor
export EDITOR='nvim'
# Manpager
export PAGER='nvim +Man!'
# Term for ssh
#export TERM='xterm-256color'
# Homebrew
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_ENV_HINTS=1
# DBUS for zathura
#export DBUS_LAUNCHD_SESSION_BUS_SOCKET=/tmp/(id -u)
#export DBUS_SESSION_BUS_ADDRESS='unix:path='$DBUS_LAUNCHD_SESSION_BUS_SOCKET
#if pgrep -x dbus-daemon &> /dev/null
# printf (_ "%sdbus-daemon%s is running\n") (set_color red) (set_color normal)
#else
# #echo "dbus-daemon is not running"
# dbus-daemon --fork --session --address=$DBUS_SESSION_BUS_ADDRESS
#end
# ALIAS
# convinience
alias doas='sudo'
# ls
alias ls='colorls'
# neovim
alias vi='nvim'
alias vim='nvim'
# mutt
#alias mutt='neomutt'
# rsync
alias rsync='rsync -h -v -r -P -p -t --stats'
# wget folder
alias wget_f='wget -r -np -R "index.html*"'
# btop
alias top='btop'
# git signed
function git --wraps git
switch $argv[1]
case commit
/usr/bin/git commit -S
case tag
/usr/bin/git tag -S
case '*'
/usr/bin/git $argv
end
end
case '*' case '*'