fish: steal good stuff from garuda >:)
This commit is contained in:
parent
ad79ad9737
commit
d27d9c3654
|
@ -1,5 +1,7 @@
|
|||
# fish config
|
||||
|
||||
## Variables
|
||||
|
||||
set PATH $PATH $HOME/.local/bin $HOME/.mix $HOME/.mix/escripts $HOME/.cargo/bin
|
||||
set DOTFILES $HOME/.dotfiles
|
||||
set NOTES $HOME/Documents/Sync/Notes/MyVault
|
||||
|
@ -7,23 +9,54 @@ set TERMINAL 'alacritty'
|
|||
set TERM 'xterm'
|
||||
set EDITOR 'nano'
|
||||
|
||||
alias r='source ~/.config/fish/config.fish'
|
||||
## Environment setup
|
||||
|
||||
if test -e /usr/bin/lsd
|
||||
alias ls="lsd"
|
||||
alias ll="lsd -lh"
|
||||
alias la="lsd -A"
|
||||
else
|
||||
alias ls="ls"
|
||||
alias ll="ls -lh"
|
||||
alias la="ls -A"
|
||||
# Apply .profile: use this to put fish compatible .profile stuff in
|
||||
if test -f ~/.fish_profile
|
||||
source ~/.fish_profile
|
||||
end
|
||||
|
||||
alias up="sudo apt update && sudo apt list --upgradable"
|
||||
alias ug="sudo apt upgrade"
|
||||
# Hide welcome message
|
||||
set fish_greeting
|
||||
set VIRTUAL_ENV_DISABLE_PROMPT "1"
|
||||
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
||||
|
||||
## Functions
|
||||
|
||||
function backup --argument filename
|
||||
cp $filename $filename.bak
|
||||
end
|
||||
|
||||
## Useful aliases
|
||||
|
||||
# Reload fish config
|
||||
alias r='clear && source ~/.config/fish/config.fish'
|
||||
|
||||
# Nicer ls if nothing els is available
|
||||
alias ls="ls"
|
||||
alias ll="ls -lh"
|
||||
alias la="ls -A"
|
||||
alias lt="ls -ald .*"
|
||||
|
||||
# Replace ls with exa
|
||||
if test -e /usr/bin/exa
|
||||
alias ls='exa -al --color=always --group-directories-first --icons' # preferred listing
|
||||
alias la='exa -a --color=always --group-directories-first --icons' # all files and dirs
|
||||
alias ll='exa -l --color=always --group-directories-first --icons' # long format
|
||||
alias lt='exa -aT --color=always --group-directories-first --icons' # tree listing
|
||||
alias l.='exa -ald --color=always --group-directories-first --icons .*' # show only dotfiles
|
||||
end
|
||||
|
||||
# Add apt aliases for updating / upgrading if available
|
||||
if test -e (whereis apt)
|
||||
alias up="sudo apt update && sudo apt list --upgradable"
|
||||
alias ug="sudo apt upgrade"
|
||||
end
|
||||
|
||||
# Elixir / phoenix aliases
|
||||
alias phx="iex -S mix phx.server"
|
||||
|
||||
# Systemd alias
|
||||
alias start="sudo systemctl start"
|
||||
alias restart="sudo systemctl restart"
|
||||
alias stop="sudo systemctl stop"
|
||||
|
@ -31,15 +64,29 @@ alias enable="sudo systemctl enable"
|
|||
alias disable="sudo systemctl disable"
|
||||
alias sta="sudo systemctl status"
|
||||
|
||||
alias dot="hx $DOTFILES"
|
||||
alias notes="hx $NOTES"
|
||||
|
||||
## Helpers
|
||||
# Generate SSH key
|
||||
alias sshkey='ssh-keygen -t ed25519 -f $HOME/.ssh/id_ed25519 -C "(whoami)@(hostname)-(date +'%y%m%d')"'
|
||||
|
||||
# Get the error messages from journalctl
|
||||
alias jctl="journalctl -p 3 -xb"
|
||||
|
||||
# Recent installed packages
|
||||
alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
|
||||
|
||||
# Cleanup orphaned packages
|
||||
alias cleanup='sudo pacman -Rns (pacman -Qtdq)'
|
||||
|
||||
if status is-interactive
|
||||
# Commands to run in interactive sessions can go here
|
||||
end
|
||||
|
||||
## Load asdf if available
|
||||
if test -e ~/.asdf/asdf.fish
|
||||
source ~/.asdf/asdf.fish
|
||||
end
|
||||
|
||||
## Run fastfetch if session is interactive
|
||||
if status --is-interactive && type -q fastfetch
|
||||
fastfetch --load-config neofetch
|
||||
end
|
|
@ -0,0 +1,44 @@
|
|||
# This file contains fish universal variable definitions.
|
||||
# VERSION: 3.0
|
||||
SETUVAR ZO_CMD:zo
|
||||
SETUVAR Z_CMD:z
|
||||
SETUVAR Z_DATA:/home/inhji/\x2elocal/share/z/data
|
||||
SETUVAR Z_DATA_DIR:/home/inhji/\x2elocal/share/z
|
||||
SETUVAR Z_EXCLUDE:\x5e/home/inhji\x24
|
||||
SETUVAR __fish_initialized:3400
|
||||
SETUVAR _fisher_danhper_2F_fish_2D_ssh_2D_agent_files:\x7e/\x2econfig/fish/functions/__ssh_agent_is_started\x2efish\x1e\x7e/\x2econfig/fish/functions/__ssh_agent_start\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/fish\x2dssh\x2dagent\x2efish
|
||||
SETUVAR _fisher_franciscolourenco_2F_done_files:\x7e/\x2econfig/fish/conf\x2ed/done\x2efish
|
||||
SETUVAR _fisher_jethrokuan_2F_z_files:\x7e/\x2econfig/fish/functions/__z\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_add\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_clean\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_complete\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/z\x2efish
|
||||
SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish
|
||||
SETUVAR _fisher_jorgebucaran_2F_hydro_files:\x7e/\x2econfig/fish/functions/fish_mode_prompt\x2efish\x1e\x7e/\x2econfig/fish/functions/fish_prompt\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/hydro\x2efish
|
||||
SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejethrokuan/z\x1efranciscolourenco/done\x1ejorgebucaran/hydro\x1edanhper/fish\x2dssh\x2dagent
|
||||
SETUVAR _fisher_upgraded_to_4_4:\x1d
|
||||
SETUVAR _hydro_git_58137:main\u2022\x20
|
||||
SETUVAR fish_color_autosuggestion:555\x1ebrblack
|
||||
SETUVAR fish_color_cancel:\x2dr
|
||||
SETUVAR fish_color_command:blue
|
||||
SETUVAR fish_color_comment:red
|
||||
SETUVAR fish_color_cwd:green
|
||||
SETUVAR fish_color_cwd_root:red
|
||||
SETUVAR fish_color_end:green
|
||||
SETUVAR fish_color_error:brred
|
||||
SETUVAR fish_color_escape:brcyan
|
||||
SETUVAR fish_color_history_current:\x2d\x2dbold
|
||||
SETUVAR fish_color_host:normal
|
||||
SETUVAR fish_color_host_remote:yellow
|
||||
SETUVAR fish_color_normal:normal
|
||||
SETUVAR fish_color_operator:brcyan
|
||||
SETUVAR fish_color_param:cyan
|
||||
SETUVAR fish_color_quote:yellow
|
||||
SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold
|
||||
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
|
||||
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
|
||||
SETUVAR fish_color_status:red
|
||||
SETUVAR fish_color_user:brgreen
|
||||
SETUVAR fish_color_valid_path:\x2d\x2dunderline
|
||||
SETUVAR fish_key_bindings:fish_default_key_bindings
|
||||
SETUVAR fish_pager_color_completion:normal
|
||||
SETUVAR fish_pager_color_description:B3A06D\x1eyellow\x1e\x2di
|
||||
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
||||
SETUVAR fish_pager_color_selected_background:\x2dr
|
Loading…
Reference in New Issue