~cricket/dotfiles

bb3b574d96a4838fb7ebdba2c3f757827985deb4 — c piapiac 4 months ago 42e2c79
fish prompt
3 files changed, 26 insertions(+), 6 deletions(-)

M .config/fish/config.fish
M .config/fish/fish_variables
M .config/fish/functions/fish_prompt.fish
M .config/fish/config.fish => .config/fish/config.fish +2 -0
@@ 2,3 2,5 @@ set fish_greeting
theme_gruvbox
alias dotfiles="/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME"
alias dofs="/usr/local/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME" # BSD systems use different filesystem

set -x CARP_DIR ~/Carp/

M .config/fish/fish_variables => .config/fish/fish_variables +3 -2
@@ 1,12 1,13 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR --export EDITOR:kak
SETUVAR __fish_initialized:3100
SETUVAR arch:all
SETUVAR binutils:2\x2e35\x1ebinutils\x2d2\x2e35\x1ebinutils\x2d2\x2e35\x2etar\x2exz
SETUVAR binutils_file:binutils\x2d2\x2e35\x2etar\x2exz
SETUVAR binutils_name:binutils\x2d2\x2e35
SETUVAR binutils_version:2\x2e35
SETUVAR file:5\x2e39\x1efile\x2d5\x2e39\x1efile\x2d5\x2e39\x2etar\x2egz
SETUVAR file:
SETUVAR file_file:file\x2d5\x2e39\x2etar\x2egz
SETUVAR file_name:file\x2d5\x2e39
SETUVAR file_version:5\x2e39


@@ 39,7 40,7 @@ SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_user_paths:/home/cricket/\x2enimble/bin/\x1e/home/cricket/cproc/qbe/obj\x1e/home/cricket/\x2elocal/bin/\x1e/home/cricket/GeneratorFabricMod/bin/
SETUVAR fish_user_paths:/home/cricket/\x2enimble/bin/\x1e/home/cricket/cproc/qbe/obj\x1e/home/cricket/\x2elocal/bin/\x1e/home/cricket/GeneratorFabricMod/bin/\x1e/home/cricket/\x2ecargo/bin/
SETUVAR gcc:10\x2e2\x2e0\x1egcc\x2d10\x2e2\x2e0\x1egcc\x2d10\x2e2\x2e0\x2etar\x2exz
SETUVAR gcc_file:gcc\x2d10\x2e2\x2e0\x2etar\x2exz
SETUVAR gcc_name:gcc\x2d10\x2e2\x2e0

M .config/fish/functions/fish_prompt.fish => .config/fish/functions/fish_prompt.fish +21 -4
@@ 1,6 1,23 @@
function fish_prompt
    set_color $gruvbox_neutral_aqua
    echo -n (pwd)
    set_color normal
    echo -n ' > '
    set -l last_status $status 												# last command exited with
    set -l normal (set_color normal)										# reset colours / styles
    set -l aqua (set_color -o $gruvbox_neutral_aqua)						# gruvbox colours
    set -l error (set_color -o -r $gruvbox_bright_red)
    set -l orange (set_color -o $gruvbox_neutral_orange)
    set -l purple (set_color -o $gruvbox_neutral_purple)
    set -l blue (set_color -o $gruvbox_neutral_blue)
    
    set -l suffix " % "														# default suffix is %
    set -l bracket_colour $orange 											# set bracket colour to orange
    [ $last_status = 1 ] && set bracket_colour $error && set suffix " ! "	# exited with failure
    [ $last_status = 127 ] && set suffix " ? "								# unknown command
    [ $last_status = 130 ] && set suffix " * " 								# script has been killed with ^C

    set -l directory (pwd | string split "/")[-1]							# just show last directory in path
    [ $PWD = ~ ] && set directory "their home"								# set directory name to ~ if it's the home
    
    set -l git_info															# set git info if .git exists
    [ -d .git ] && set git_info $bracket_colour " on " $blue (git branch --show-current) 

    echo -s $bracket_colour "[" $purple $USER $bracket_colour " in " $aqua $directory $git_info $bracket_colour "]" $normal $suffix
end