Restructure
This commit is contained in:
122
config/fish/config.fish
Executable file
122
config/fish/config.fish
Executable file
@@ -0,0 +1,122 @@
|
||||
alias ls='ls -l --color'
|
||||
alias ll='ls -la --color'
|
||||
alias v='nvim'
|
||||
alias c='clear'
|
||||
alias bt='bashtop'
|
||||
alias vicfg='cd ~/.config/nvim/ && nvim'
|
||||
alias fm='thunar .'
|
||||
alias gl='git ls-files --others --exclude-standard'
|
||||
alias gm='gti ls-files -m'
|
||||
alias gpu='git push'
|
||||
alias gp='git pull'
|
||||
alias gc='git commit -a -m'
|
||||
alias ga='git add ./*'
|
||||
alias cfh='nvim ~/.config/hypr/'
|
||||
alias cfn='nvim ~/.config/nvim/'
|
||||
alias cff='nvim ~/.config/fish/config.fish'
|
||||
alias cfw='nvim ~/.config/waybar/'
|
||||
alias cf='nvim ~/.config/'
|
||||
alias g='lazygit'
|
||||
alias open-webui='sudo systemctl start docker && sudo docker start -i open-webui'
|
||||
alias ai='ollama serve'
|
||||
|
||||
# Add scripts in ~/projects/active/dotfiles/general/scripts/ to path
|
||||
fish_add_path -P ~/projects/active/dotfiles/scripts/
|
||||
|
||||
function y
|
||||
set tmp (mktemp -t "yazi-cwd.XXXXXX")
|
||||
yazi $argv --cwd-file="$tmp"
|
||||
if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
builtin cd -- "$cwd"
|
||||
end
|
||||
rm -f -- "$tmp"
|
||||
end
|
||||
|
||||
[ -f /usr/share/autojump/autojump.fish ]; and source /usr/share/autojump/autojump.fish
|
||||
|
||||
if status is-interactive
|
||||
function fish_prompt
|
||||
|
||||
# Cache exit status
|
||||
set -l last_status $status
|
||||
|
||||
# Set color for variables in prompt
|
||||
set -l normal (set_color normal)
|
||||
set -l white (set_color FFFFFF)
|
||||
set -l turquoise (set_color 5fdfff)
|
||||
set -l orange (set_color df5f00)
|
||||
set -l hotpink (set_color df005f)
|
||||
set -l blue (set_color blue)
|
||||
set -l limegreen (set_color 87ff00)
|
||||
set -l purple (set_color af5fff)
|
||||
set -l red (set_color e70e0e)
|
||||
|
||||
# Configure __fish_git_prompt
|
||||
set -g __fish_git_prompt_char_stateseparator ' '
|
||||
set -g __fish_git_prompt_color 5fdfff
|
||||
set -g __fish_git_prompt_color_flags df5f00
|
||||
set -g __fish_git_prompt_color_prefix white
|
||||
set -g __fish_git_prompt_color_suffix white
|
||||
set -g __fish_git_prompt_showdirtystate true
|
||||
set -g __fish_git_prompt_showuntrackedfiles true
|
||||
set -g __fish_git_prompt_showstashstate true
|
||||
|
||||
set -g __fish_git_prompt_show_informative_status true
|
||||
|
||||
|
||||
# Only calculate once, to save a few CPU cycles when displaying the prompt
|
||||
if not set -q __fish_prompt_hostname
|
||||
# set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
|
||||
set -g __fish_prompt_hostname $orange(prompt_hostname)(set_color normal)
|
||||
end
|
||||
if not set -q __fish_prompt_char
|
||||
if [ (id -u) -eq 0 ]
|
||||
set -g __fish_prompt_char (set_color red)'λ'(set_color normal)
|
||||
else
|
||||
set -g __fish_prompt_char 'λ'
|
||||
end
|
||||
end
|
||||
|
||||
# change `at` to `ssh` when an interactive ssh session is present
|
||||
if [ "$SSH_TTY" = "" ]
|
||||
set -g location at
|
||||
# set -g __fish_prompt_hostname (set_color orange)(hostname|cut -d . -f 1)
|
||||
else # connected via ssh
|
||||
if [ "$TERM" = "xterm-256color-italic" -o "$TERM" = "tmux-256color" ]
|
||||
set -g location (echo -e "\e[3mssh\e[23m")
|
||||
# set -g ssh_hostname (echo -e $blue$__fish_prompt_hostname)
|
||||
set -g __fish_prompt_hostname $blue(prompt_hostname)(set_color normal)
|
||||
else
|
||||
set -g location ssh
|
||||
# set -g ssh_hostname (echo -e $blue$__fish_prompt_hostname)
|
||||
set -g __fish_prompt_hostname $blue(prompt_hostname)(set_color normal)
|
||||
end
|
||||
end
|
||||
|
||||
if [ (id -u) -eq 0 ]
|
||||
# top line > Superuser
|
||||
echo -n $red'╭─'$hotpink$USER $white$location $__fish_prompt_hostname$white' in '$limegreen(pwd)$turquoise
|
||||
__fish_git_prompt " (%s)"
|
||||
echo
|
||||
# bottom line > Superuser
|
||||
echo -n $red'╰'
|
||||
echo -n $red'─'$__fish_prompt_char $normal
|
||||
else # top line > non superuser's
|
||||
echo -n $white'╭─'$hotpink$USER $white$location $__fish_prompt_hostname$white' in '$limegreen(pwd)$turquoise
|
||||
__fish_git_prompt " (%s)"
|
||||
echo
|
||||
# bottom line > non superuser's
|
||||
echo -n $white'╰'
|
||||
echo -n $white'─'$__fish_prompt_char $normal
|
||||
end
|
||||
|
||||
# NOTE: disable `VIRTUAL_ENV_DISABLE_PROMPT` in `config.fish`
|
||||
# see: https://virtualenv.pypa.io/en/latest/reference/#envvar-VIRTUAL_ENV_DISABLE_PROMPT
|
||||
# support for virtual env name
|
||||
if set -q VIRTUAL_ENV
|
||||
echo -n "($turquoise"(basename "$VIRTUAL_ENV")"$white)"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
33
config/fish/fish_variables
Executable file
33
config/fish/fish_variables
Executable file
@@ -0,0 +1,33 @@
|
||||
# This file contains fish universal variable definitions.
|
||||
# VERSION: 3.0
|
||||
SETUVAR __fish_initialized:3800
|
||||
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:white\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_greeting:\x1d
|
||||
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
|
||||
SETUVAR fish_user_paths:/usr/lib/python3\x2e11/site\x2dpackages\x1e/usr/lib/python3\x2e11\x1e/usr/lib/python3\x2e11/site\x2dpackages/\x1e/home/janis/\x2elocal/lib/python3\x2e11/site\x2dpackages/\x1e/home/janis/\x2elocal/lib/python3\x2e11/
|
Reference in New Issue
Block a user