---input--- # ----------------------------------------------------------------------------- # Fishshell Samples # |- Theme / bobthefish # |- Function / funced # |- Configuration / config.fish # ----------------------------------------------------------------------------- # name: bobthefish # # bobthefish is a Powerline-style, Git-aware fish theme optimized for awesome. # # You will probably need a Powerline-patched font for this to work: # # https://powerline.readthedocs.org/en/latest/fontpatching.html # # I recommend picking one of these: # # https://github.com/Lokaltog/powerline-fonts # # You can override some default options in your config.fish: # # set -g theme_display_user yes # set -g default_user your_normal_user set -g __bobthefish_current_bg NONE # Powerline glyphs set __bobthefish_branch_glyph \uE0A0 set __bobthefish_ln_glyph \uE0A1 set __bobthefish_padlock_glyph \uE0A2 set __bobthefish_right_black_arrow_glyph \uE0B0 set __bobthefish_right_arrow_glyph \uE0B1 set __bobthefish_left_black_arrow_glyph \uE0B2 set __bobthefish_left_arrow_glyph \uE0B3 # Additional glyphs set __bobthefish_detached_glyph \u27A6 set __bobthefish_nonzero_exit_glyph '! ' set __bobthefish_superuser_glyph '$ ' set __bobthefish_bg_job_glyph '% ' set __bobthefish_hg_glyph \u263F # Python glyphs set __bobthefish_superscript_glyph \u00B9 \u00B2 \u00B3 set __bobthefish_virtualenv_glyph \u25F0 set __bobthefish_pypy_glyph \u1D56 # Colors set __bobthefish_lt_green addc10 set __bobthefish_med_green 189303 set __bobthefish_dk_green 0c4801 set __bobthefish_lt_red C99 set __bobthefish_med_red ce000f set __bobthefish_dk_red 600 set __bobthefish_slate_blue 255e87 set __bobthefish_lt_orange f6b117 set __bobthefish_dk_orange 3a2a03 set __bobthefish_dk_grey 333 set __bobthefish_med_grey 999 set __bobthefish_lt_grey ccc set __bobthefish_dk_brown 4d2600 set __bobthefish_med_brown 803F00 set __bobthefish_lt_brown BF5E00 set __bobthefish_dk_blue 1E2933 set __bobthefish_med_blue 275379 set __bobthefish_lt_blue 326D9E # =========================== # Helper methods # =========================== function __bobthefish_in_git -d 'Check whether pwd is inside a git repo' command which git > /dev/null 2>&1; and command git rev-parse --is-inside-work-tree >/dev/null 2>&1 end function __bobthefish_in_hg -d 'Check whether pwd is inside a hg repo' command which hg > /dev/null 2>&1; and command hg stat > /dev/null 2>&1 end function __bobthefish_git_branch -d 'Get the current git branch (or commitish)' set -l ref (command git symbolic-ref HEAD 2> /dev/null) if [ $status -gt 0 ] set -l branch (command git show-ref --head -s --abbrev |head -n1 2> /dev/null) set ref "$__bobthefish_detached_glyph $branch" end echo $ref | sed "s-refs/heads/-$__bobthefish_branch_glyph -" end function __bobthefish_hg_branch -d 'Get the current hg branch' set -l branch (hg branch ^/dev/null) set -l book " @ "(hg book | grep \* | cut -d\ -f3) echo "$__bobthefish_branch_glyph $branch$book" end function __bobthefish_pretty_parent -d 'Print a parent directory, shortened to fit the prompt' echo -n (dirname $argv[1]) | sed -e 's|/private||' -e "s|^$HOME|~|" -e 's-/\(\.\{0,1\}[^/]\)\([^/]*\)-/\1-g' -e 's|/$||' end function __bobthefish_git_project_dir -d 'Print the current git project base directory' command git rev-parse --show-toplevel 2>/dev/null end function __bobthefish_hg_project_dir -d 'Print the current hg project base directory' command hg root 2>/dev/null end function __bobthefish_project_pwd -d 'Print the working directory relative to project root' echo "$PWD" | sed -e "s*$argv[1]**g" -e 's*^/**' end # =========================== # Segment functions # =========================== function __bobthefish_start_segment -d 'Start a prompt segment' set_color -b $argv[1] set_color $argv[2] if [ "$__bobthefish_current_bg" = 'NONE' ] # If there's no background, just start one echo -n ' ' else # If there's already a background... if [ "$argv[1]" = "$__bobthefish_current_bg" ] # and it's the same color, draw a separator echo -n "$__bobthefish_right_arrow_glyph " else # otherwise, draw the end of the previous segment and the start of the next set_color $__bobthefish_current_bg echo -n "$__bobthefish_right_black_arrow_glyph " set_color $argv[2] end end set __bobthefish_current_bg $argv[1] end function __bobthefish_path_segment -d 'Display a shortened form of a directory' if test -w "$argv[1]" __bobthefish_start_segment $__bobthefish_dk_grey $__bobthefish_med_grey else __bobthefish_start_segment $__bobthefish_dk_red $__bobthefish_lt_red end set -l directory set -l parent switch "$argv[1]" case / set directory '/' case "$HOME" set directory '~' case '*' set parent (__bobthefish_pretty_parent "$argv[1]") set parent "$parent/" set directory (basename "$argv[1]") end test "$parent"; and echo -n -s "$parent" set_color fff --bold echo -n "$directory " set_color normal end function __bobthefish_finish_segments -d 'Close open prompt segments' if [ -n $__bobthefish_current_bg -a $__bobthefish_current_bg != 'NONE' ] set_color -b normal set_color $__bobthefish_current_bg echo -n "$__bobthefish_right_black_arrow_glyph " set_color normal end set -g __bobthefish_current_bg NONE end # =========================== # Theme components # =========================== function __bobthefish_prompt_status -d 'Display symbols for a non zero exit status, root and background jobs' set -l nonzero set -l superuser set -l bg_jobs # Last exit was nonzero if [ $status -ne 0 ] set nonzero $__bobthefish_nonzero_exit_glyph end # if superuser (uid == 0) set -l uid (id -u $USER) if [ $uid -eq 0 ] set superuser $__bobthefish_superuser_glyph end # Jobs display if [ (jobs -l | wc -l) -gt 0 ] set bg_jobs $__bobthefish_bg_job_glyph end set -l status_flags "$nonzero$superuser$bg_jobs" if test "$nonzero" -o "$superuser" -o "$bg_jobs" __bobthefish_start_segment fff 000 if [ "$nonzero" ] set_color $__bobthefish_med_red --bold echo -n $__bobthefish_nonzero_exit_glyph end if [ "$superuser" ] set_color $__bobthefish_med_green --bold echo -n $__bobthefish_superuser_glyph end if [ "$bg_jobs" ] set_color $__bobthefish_slate_blue --bold echo -n $__bobthefish_bg_job_glyph end set_color normal end end function __bobthefish_prompt_user -d 'Display actual user if different from $default_user' if [ "$theme_display_user" = 'yes' ] if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ] __bobthefish_start_segment $__bobthefish_lt_grey $__bobthefish_slate_blue echo -n -s (whoami) '@' (hostname | cut -d . -f 1) ' ' end end end function __bobthefish_prompt_hg -d 'Display the actual hg state' set -l dirty (command hg stat; or echo -n '*') set -l flags "$dirty" test "$flags"; and set flags "" set -l flag_bg $__bobthefish_lt_green set -l flag_fg $__bobthefish_dk_green if test "$dirty" set flag_bg $__bobthefish_med_red set flag_fg fff end __bobthefish_path_segment (__bobthefish_hg_project_dir) __bobthefish_start_segment $flag_bg $flag_fg echo -n -s $__bobthefish_hg_glyph ' ' __bobthefish_start_segment $flag_bg $flag_fg set_color $flag_fg --bold echo -n -s (__bobthefish_hg_branch) $flags ' ' set_color normal set -l project_pwd (__bobthefish_project_pwd (__bobthefish_hg_project_dir)) if test "$project_pwd" if test -w "$PWD" __bobthefish_start_segment 333 999 else __bobthefish_start_segment $__bobthefish_med_red $__bobthefish_lt_red end echo -n -s $project_pwd ' ' end end # TODO: clean up the fugly $ahead business function __bobthefish_prompt_git -d 'Display the actual git state' set -l dirty (command git diff --no-ext-diff --quiet --exit-code; or echo -n '*') set -l staged (command git diff --cached --no-ext-diff --quiet --exit-code; or echo -n '~') set -l stashed (command git rev-parse --verify refs/stash > /dev/null 2>&1; and echo -n '$') set -l ahead (command git branch -v 2> /dev/null | grep -Eo '^\* [^ ]* *[^ ]* *\[[^]]*\]' | grep -Eo '\[[^]]*\]$' | awk 'ORS="";/ahead/ {print "+"} /behind/ {print "-"}' | sed -e 's/+-/±/') set -l new (command git ls-files --other --exclude-standard); test "$new"; and set new '…' set -l flags "$dirty$staged$stashed$ahead$new" test "$flags"; and set flags " $flags" set -l flag_bg $__bobthefish_lt_green set -l flag_fg $__bobthefish_dk_green if test "$dirty" -o "$staged" set flag_bg $__bobthefish_med_red set flag_fg fff else if test "$stashed" set flag_bg $__bobthefish_lt_orange set flag_fg $__bobthefish_dk_orange end end __bobthefish_path_segment (__bobthefish_git_project_dir) __bobthefish_start_segment $flag_bg $flag_fg set_color $flag_fg --bold echo -n -s (__bobthefish_git_branch) $flags ' ' set_color normal set -l project_pwd (__bobthefish_project_pwd (__bobthefish_git_project_dir)) if test "$project_pwd" if test -w "$PWD" __bobthefish_start_segment 333 999 else __bobthefish_start_segment $__bobthefish_med_red $__bobthefish_lt_red end echo -n -s $project_pwd ' ' end end function __bobthefish_prompt_dir -d 'Display a shortened form of the current directory' __bobthefish_path_segment "$PWD" end function __bobthefish_in_virtualfish_virtualenv set -q VIRTUAL_ENV end function __bobthefish_virtualenv_python_version -d 'Get current python version' switch (readlink (which python)) case python2 echo $__bobthefish_superscript_glyph[2] case python3 echo $__bobthefish_superscript_glyph[3] case pypy echo $__bobthefish_pypy_glyph end end function __bobthefish_virtualenv -d 'Get the current virtualenv' echo $__bobthefish_virtualenv_glyph(__bobthefish_virtualenv_python_version) (basename "$VIRTUAL_ENV") end function __bobthefish_prompt_virtualfish -d "Display activated virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself)" set flag_bg $__bobthefish_lt_blue set flag_fg $__bobthefish_dk_blue __bobthefish_start_segment $flag_bg $flag_fg set_color $flag_fg --bold echo -n -s (__bobthefish_virtualenv) $flags ' ' set_color normal end # =========================== # Apply theme # =========================== function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' __bobthefish_prompt_status __bobthefish_prompt_user if __bobthefish_in_virtualfish_virtualenv __bobthefish_prompt_virtualfish end if __bobthefish_in_git # TODO: do this right. __bobthefish_prompt_git # if something is in both git and hg, check the length of else if __bobthefish_in_hg # __bobthefish_git_project_dir vs __bobthefish_hg_project_dir __bobthefish_prompt_hg # and pick the longer of the two. else __bobthefish_prompt_dir end __bobthefish_finish_segments end # ----------------------------------------------------------------------------- # funced - edit a function interactively # # Synopsis # # funced [OPTIONS] NAME # # Description # # funced provides an interface to edit the definition of the function NAME. # ----------------------------------------------------------------------------- function funced --description 'Edit function definition' set -l editor $EDITOR set -l interactive set -l funcname while set -q argv[1] switch $argv[1] case -h --help __fish_print_help funced return 0 case -e --editor set editor $argv[2] set -e argv[2] case -i --interactive set interactive 1 case -- set funcname $funcname $argv[2] set -e argv[2] case '-*' set_color red printf (_ "%s: Unknown option %s\n") funced $argv[1] set_color normal return 1 case '*' '.*' set funcname $funcname $argv[1] end set -e argv[1] end if begin; set -q funcname[2]; or not test "$funcname[1]"; end set_color red _ "funced: You must specify one function name " set_color normal return 1 end set -l init switch $funcname case '-*' set init function -- $funcname\n\nend case '*' set init function $funcname\n\nend end # Break editor up to get its first command (i.e. discard flags) if test -n "$editor" set -l editor_cmd eval set editor_cmd $editor if not type -f "$editor_cmd[1]" >/dev/null _ "funced: The value for \$EDITOR '$editor' could not be used because the command '$editor_cmd[1]' could not be found " set editor fish end end # If no editor is specified, use fish if test -z "$editor" set editor fish end if begin; set -q interactive[1]; or test "$editor" = fish; end set -l IFS if functions -q -- $funcname # Shadow IFS here to avoid array splitting in command substitution set init (functions -- $funcname | fish_indent --no-indent) end set -l prompt 'printf "%s%s%s> " (set_color green) '$funcname' (set_color normal)' # Unshadow IFS since the fish_title breaks otherwise set -e IFS if read -p $prompt -c "$init" -s cmd # Shadow IFS _again_ to avoid array splitting in command substitution set -l IFS eval (echo -n $cmd | fish_indent) end return 0 end set -q TMPDIR; or set -l TMPDIR /tmp set -l tmpname (printf "$TMPDIR/fish_funced_%d_%d.fish" %self (random)) while test -f $tmpname set tmpname (printf "$TMPDIR/fish_funced_%d_%d.fish" %self (random)) end if functions -q -- $funcname functions -- $funcname > $tmpname else echo $init > $tmpname end if eval $editor $tmpname . $tmpname end set -l stat $status rm -f $tmpname >/dev/null return $stat end # ----------------------------------------------------------------------------- # Main file for fish command completions. This file contains various # common helper functions for the command completions. All actual # completions are located in the completions subdirectory. ## ----------------------------------------------------------------------------- # # Set default field separators # set -g IFS \n\ \t # # Set default search paths for completions and shellscript functions # unless they already exist # set -l configdir ~/.config if set -q XDG_CONFIG_HOME set configdir $XDG_CONFIG_HOME end # __fish_datadir, __fish_sysconfdir, __fish_help_dir, __fish_bin_dir # are expected to have been set up by read_init from fish.cpp # Set up function and completion paths. Make sure that the fish # default functions/completions are included in the respective path. if not set -q fish_function_path set fish_function_path $configdir/fish/functions $__fish_sysconfdir/functions $__fish_datadir/functions end if not contains $__fish_datadir/functions $fish_function_path set fish_function_path[-1] $__fish_datadir/functions end if not set -q fish_complete_path set fish_complete_path $configdir/fish/completions $__fish_sysconfdir/completions $__fish_datadir/completions end if not contains $__fish_datadir/completions $fish_complete_path set fish_complete_path[-1] $__fish_datadir/completions end # # This is a Solaris-specific test to modify the PATH so that # Posix-conformant tools are used by default. It is separate from the # other PATH code because this directory needs to be prepended, not # appended, since it contains POSIX-compliant replacements for various # system utilities. # if test -d /usr/xpg4/bin if not contains /usr/xpg4/bin $PATH set PATH /usr/xpg4/bin $PATH end end # # Add a few common directories to path, if they exists. Note that pure # console programs like makedep sometimes live in /usr/X11R6/bin, so we # want this even for text-only terminals. # set -l path_list /bin /usr/bin /usr/X11R6/bin /usr/local/bin $__fish_bin_dir # Root should also have the sbin directories in the path switch $USER case root set path_list $path_list /sbin /usr/sbin /usr/local/sbin end for i in $path_list if not contains $i $PATH if test -d $i set PATH $PATH $i end end end # # Launch debugger on SIGTRAP # function fish_sigtrap_handler --on-signal TRAP --no-scope-shadowing --description "Signal handler for the TRAP signal. Lanches a debug prompt." breakpoint end # # Whenever a prompt is displayed, make sure that interactive # mode-specific initializations have been performed. # This handler removes itself after it is first called. # function __fish_on_interactive --on-event fish_prompt __fish_config_interactive functions -e __fish_on_interactive end ---tokens--- '# -----------------------------------------------------------------------------\n' Comment '# Fishshell Samples\n' Comment '# |- Theme / bobthefish\n' Comment '# |- Function / funced\n' Comment '# |- Configuration / config.fish\n' Comment '# -----------------------------------------------------------------------------\n' Comment '\n' Text '# name: bobthefish\n' Comment '#\n' Comment '# bobthefish is a Powerline-style, Git-aware fish theme optimized for awesome.\n' Comment '#\n' Comment '# You will probably need a Powerline-patched font for this to work:\n' Comment '#\n' Comment '# https://powerline.readthedocs.org/en/latest/fontpatching.html\n' Comment '#\n' Comment '# I recommend picking one of these:\n' Comment '#\n' Comment '# https://github.com/Lokaltog/powerline-fonts\n' Comment '#\n' Comment '# You can override some default options in your config.fish:\n' Comment '#\n' Comment '# set -g theme_display_user yes\n' Comment '# set -g default_user your_normal_user\n' Comment '\n' Text 'set' Keyword ' ' Text '-g' Text ' ' Text '__bobthefish_current_bg' Text ' ' Text 'NONE' Text '\n\n' Text '# Powerline glyphs\n' Comment 'set' Keyword ' ' Text '__bobthefish_branch_glyph' Text ' ' Text '\\u' Literal.String.Escape 'E0A0' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_ln_glyph' Text ' ' Text '\\u' Literal.String.Escape 'E0A1' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_padlock_glyph' Text ' ' Text '\\u' Literal.String.Escape 'E0A2' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_right_black_arrow_glyph' Text ' ' Text '\\u' Literal.String.Escape 'E0B0' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_right_arrow_glyph' Text ' ' Text '\\u' Literal.String.Escape 'E0B1' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_left_black_arrow_glyph' Text ' ' Text '\\u' Literal.String.Escape 'E0B2' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_left_arrow_glyph' Text ' ' Text '\\u' Literal.String.Escape 'E0B3' Text '\n\n' Text '# Additional glyphs\n' Comment 'set' Keyword ' ' Text '__bobthefish_detached_glyph' Text ' ' Text '\\u' Literal.String.Escape '27A6' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_nonzero_exit_glyph' Text ' ' Text "'! '" Literal.String.Single '\n' Text 'set' Keyword ' ' Text '__bobthefish_superuser_glyph' Text ' ' Text "'$ '" Literal.String.Single '\n' Text 'set' Keyword ' ' Text '__bobthefish_bg_job_glyph' Text ' ' Text "'% '" Literal.String.Single '\n' Text 'set' Keyword ' ' Text '__bobthefish_hg_glyph' Text ' ' Text '\\u' Literal.String.Escape '263F' Text '\n\n' Text '# Python glyphs\n' Comment 'set' Keyword ' ' Text '__bobthefish_superscript_glyph' Text ' ' Text '\\u' Literal.String.Escape '00B9' Text ' ' Text '\\u' Literal.String.Escape '00B2' Text ' ' Text '\\u' Literal.String.Escape '00B3' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_virtualenv_glyph' Text ' ' Text '\\u' Literal.String.Escape '25F0' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_pypy_glyph' Text ' ' Text '\\u' Literal.String.Escape '1D56' Text '\n\n' Text '# Colors\n' Comment 'set' Keyword ' ' Text '__bobthefish_lt_green' Text ' ' Text 'addc10' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_med_green' Text ' ' Text '189303' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_dk_green' Text ' ' Text '0c4801' Text '\n\n' Text 'set' Keyword ' ' Text '__bobthefish_lt_red' Text ' ' Text 'C99' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_med_red' Text ' ' Text 'ce000f' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_dk_red' Text ' ' Text '600' Text '\n\n' Text 'set' Keyword ' ' Text '__bobthefish_slate_blue' Text ' ' Text '255e87' Text '\n\n' Text 'set' Keyword ' ' Text '__bobthefish_lt_orange' Text ' ' Text 'f6b117' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_dk_orange' Text ' ' Text '3a2a03' Text '\n\n' Text 'set' Keyword ' ' Text '__bobthefish_dk_grey' Text ' ' Text '333' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_med_grey' Text ' ' Text '999' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_lt_grey' Text ' ' Text 'ccc' Text '\n\n' Text 'set' Keyword ' ' Text '__bobthefish_dk_brown' Text ' ' Text '4d2600' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_med_brown' Text ' ' Text '803F00' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_lt_brown' Text ' ' Text 'BF5E00' Text '\n\n' Text 'set' Keyword ' ' Text '__bobthefish_dk_blue' Text ' ' Text '1E2933' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_med_blue' Text ' ' Text '275379' Text '\n' Text 'set' Keyword ' ' Text '__bobthefish_lt_blue' Text ' ' Text '326D9E' Text '\n\n' Text '# ===========================\n' Comment '# Helper methods\n' Comment '# ===========================\n' Comment '\n' Text 'function' Keyword ' ' Text '__bobthefish_in_git' Text ' ' Text '-d' Text ' ' Text "'Check whether pwd is inside a git repo'" Literal.String.Single '\n ' Text 'command ' Name.Builtin 'which' Text ' ' Text 'git' Text ' ' Text '>' Operator ' ' Text '/dev/null' Text ' ' Text '2>' Text '&' Operator '1' Text ';' Punctuation ' ' Text 'and' Keyword ' ' Text 'command ' Name.Builtin 'git' Text ' ' Text 'rev-parse' Text ' ' Text '--is-inside-work-tree' Text ' ' Text '>' Operator '/dev/null' Text ' ' Text '2>' Text '&' Operator '1' Text '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_in_hg' Text ' ' Text '-d' Text ' ' Text "'Check whether pwd is inside a hg repo'" Literal.String.Single '\n ' Text 'command ' Name.Builtin 'which' Text ' ' Text 'hg' Text ' ' Text '>' Operator ' ' Text '/dev/null' Text ' ' Text '2>' Text '&' Operator '1' Text ';' Punctuation ' ' Text 'and' Keyword ' ' Text 'command ' Name.Builtin 'hg' Text ' ' Text 'stat' Text ' ' Text '>' Operator ' ' Text '/dev/null' Text ' ' Text '2>' Text '&' Operator '1' Text '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_git_branch' Text ' ' Text '-d' Text ' ' Text "'Get the current git branch (or commitish)'" Literal.String.Single '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'ref' Text ' ' Text '(' Operator 'command ' Name.Builtin 'git' Text ' ' Text 'symbolic-ref' Text ' ' Text 'HEAD' Text ' ' Text '2>' Text ' ' Text '/dev/null' Text ')' Operator '\n ' Text 'if' Keyword ' ' Text '[' Operator ' ' Text '$status' Name.Variable ' ' Text '-gt' Text ' ' Text '0' Literal.Number ' ' Text ']' Operator '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'branch' Text ' ' Text '(' Operator 'command ' Name.Builtin 'git' Text ' ' Text 'show-ref' Text ' ' Text '--head' Text ' ' Text '-s' Text ' ' Text '--abbrev' Text ' ' Text '|' Operator 'head' Text ' ' Text '-n1' Text ' ' Text '2>' Text ' ' Text '/dev/null' Text ')' Operator '\n ' Text 'set' Keyword ' ' Text 'ref' Text ' ' Text '"' Literal.String.Double '$__bobthefish_detached_glyph' Name.Variable ' ' Literal.String.Double '$branch' Name.Variable '"' Literal.String.Double '\n ' Text 'end' Keyword '\n ' Text 'echo' Keyword ' ' Text '$ref' Name.Variable ' ' Text '|' Operator ' ' Text 'sed' Text ' ' Text '"' Literal.String.Double 's-refs/heads/-' Literal.String.Double '$__bobthefish_branch_glyph' Name.Variable ' -' Literal.String.Double '"' Literal.String.Double '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_hg_branch' Text ' ' Text '-d' Text ' ' Text "'Get the current hg branch'" Literal.String.Single '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'branch' Text ' ' Text '(' Operator 'hg' Text ' ' Text 'branch' Text ' ' Text '^' Operator '/dev/null' Text ')' Operator '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'book' Text ' ' Text '" @ "' Literal.String.Double '(' Operator 'hg' Text ' ' Text 'book' Text ' ' Text '|' Operator ' ' Text 'grep' Text ' ' Text '\\*' Literal.String.Escape ' ' Text '|' Operator ' ' Text 'cut' Text ' ' Text '-d' Text '\\ ' Literal.String.Escape ' ' Text '-f3' Text ')' Operator '\n ' Text 'echo' Keyword ' ' Text '"' Literal.String.Double '$__bobthefish_branch_glyph' Name.Variable ' ' Literal.String.Double '$branch' Name.Variable '$book' Name.Variable '"' Literal.String.Double '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_pretty_parent' Text ' ' Text '-d' Text ' ' Text "'Print a parent directory, shortened to fit the prompt'" Literal.String.Single '\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '(' Operator 'dirname' Text ' ' Text '$argv' Name.Variable '[' Operator '1' Text ']' Operator ')' Operator ' ' Text '|' Operator ' ' Text 'sed' Text ' ' Text '-e' Text ' ' Text "'s|/private||'" Literal.String.Single ' ' Text '-e' Text ' ' Text '"' Literal.String.Double 's|^' Literal.String.Double '$HOME' Name.Variable '|~|' Literal.String.Double '"' Literal.String.Double ' ' Text '-e' Text ' ' Text "'s-/\\(\\.\\{0,1\\}[^/]\\)\\([^/]*\\)-/\\1-g'" Literal.String.Single ' ' Text '-e' Text ' ' Text "'s|/$||'" Literal.String.Single '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_git_project_dir' Text ' ' Text '-d' Text ' ' Text "'Print the current git project base directory'" Literal.String.Single '\n ' Text 'command ' Name.Builtin 'git' Text ' ' Text 'rev-parse' Text ' ' Text '--show-toplevel' Text ' ' Text '2>/dev/null' Text '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_hg_project_dir' Text ' ' Text '-d' Text ' ' Text "'Print the current hg project base directory'" Literal.String.Single '\n ' Text 'command ' Name.Builtin 'hg' Text ' ' Text 'root' Text ' ' Text '2>/dev/null' Text '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_project_pwd' Text ' ' Text '-d' Text ' ' Text "'Print the working directory relative to project root'" Literal.String.Single '\n ' Text 'echo' Keyword ' ' Text '"' Literal.String.Double '$PWD' Name.Variable '"' Literal.String.Double ' ' Text '|' Operator ' ' Text 'sed' Text ' ' Text '-e' Text ' ' Text '"' Literal.String.Double 's*' Literal.String.Double '$argv' Name.Variable '[1]**g' Literal.String.Double '"' Literal.String.Double ' ' Text '-e' Text ' ' Text "'s*^/**'" Literal.String.Single '\n' Text 'end' Keyword '\n\n\n' Text '# ===========================\n' Comment '# Segment functions\n' Comment '# ===========================\n' Comment '\n' Text 'function' Keyword ' ' Text '__bobthefish_start_segment' Text ' ' Text '-d' Text ' ' Text "'Start a prompt segment'" Literal.String.Single '\n ' Text 'set_color' Name.Builtin ' ' Text '-b' Text ' ' Text '$argv' Name.Variable '[' Operator '1' Text ']' Operator '\n ' Text 'set_color' Name.Builtin ' ' Text '$argv' Name.Variable '[' Operator '2' Text ']' Operator '\n ' Text 'if' Keyword ' ' Text '[' Operator ' ' Text '"' Literal.String.Double '$__bobthefish_current_bg' Name.Variable '"' Literal.String.Double ' ' Text '=' Operator ' ' Text "'NONE'" Literal.String.Single ' ' Text ']' Operator '\n ' Text "# If there's no background, just start one\n" Comment ' ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text "' '" Literal.String.Single '\n ' Text 'else' Keyword '\n ' Text "# If there's already a background...\n" Comment ' ' Text 'if' Keyword ' ' Text '[' Operator ' ' Text '"' Literal.String.Double '$argv' Name.Variable '[1]' Literal.String.Double '"' Literal.String.Double ' ' Text '=' Operator ' ' Text '"' Literal.String.Double '$__bobthefish_current_bg' Name.Variable '"' Literal.String.Double ' ' Text ']' Operator '\n ' Text "# and it's the same color, draw a separator\n" Comment ' ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '"' Literal.String.Double '$__bobthefish_right_arrow_glyph' Name.Variable ' ' Literal.String.Double '"' Literal.String.Double '\n ' Text 'else' Keyword '\n ' Text '# otherwise, draw the end of the previous segment and the start of the next\n' Comment ' ' Text 'set_color' Name.Builtin ' ' Text '$__bobthefish_current_bg' Name.Variable '\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '"' Literal.String.Double '$__bobthefish_right_black_arrow_glyph' Name.Variable ' ' Literal.String.Double '"' Literal.String.Double '\n ' Text 'set_color' Name.Builtin ' ' Text '$argv' Name.Variable '[' Operator '2' Text ']' Operator '\n ' Text 'end' Keyword '\n ' Text 'end' Keyword '\n ' Text 'set' Keyword ' ' Text '__bobthefish_current_bg' Text ' ' Text '$argv' Name.Variable '[' Operator '1' Text ']' Operator '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_path_segment' Text ' ' Text '-d' Text ' ' Text "'Display a shortened form of a directory'" Literal.String.Single '\n ' Text 'if' Keyword ' ' Text 'test' Keyword ' ' Text '-w' Text ' ' Text '"' Literal.String.Double '$argv' Name.Variable '[1]' Literal.String.Double '"' Literal.String.Double '\n ' Text '__bobthefish_start_segment' Text ' ' Text '$__bobthefish_dk_grey' Name.Variable ' ' Text '$__bobthefish_med_grey' Name.Variable '\n ' Text 'else' Keyword '\n ' Text '__bobthefish_start_segment' Text ' ' Text '$__bobthefish_dk_red' Name.Variable ' ' Text '$__bobthefish_lt_red' Name.Variable '\n ' Text 'end' Keyword '\n\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'directory' Text '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'parent' Text '\n\n ' Text 'switch' Keyword ' ' Text '"' Literal.String.Double '$argv' Name.Variable '[1]' Literal.String.Double '"' Literal.String.Double '\n ' Text 'case' Keyword ' ' Text '/' Text '\n ' Text 'set' Keyword ' ' Text 'directory' Text ' ' Text "'/'" Literal.String.Single '\n ' Text 'case' Keyword ' ' Text '"' Literal.String.Double '$HOME' Name.Variable '"' Literal.String.Double '\n ' Text 'set' Keyword ' ' Text 'directory' Text ' ' Text "'~'" Literal.String.Single '\n ' Text 'case' Keyword ' ' Text "'*'" Literal.String.Single '\n ' Text 'set' Keyword ' ' Text 'parent' Text ' ' Text '(' Operator '__bobthefish_pretty_parent' Text ' ' Text '"' Literal.String.Double '$argv' Name.Variable '[1]' Literal.String.Double '"' Literal.String.Double ')' Operator '\n ' Text 'set' Keyword ' ' Text 'parent' Text ' ' Text '"' Literal.String.Double '$parent' Name.Variable '/' Literal.String.Double '"' Literal.String.Double '\n ' Text 'set' Keyword ' ' Text 'directory' Text ' ' Text '(' Operator 'basename' Text ' ' Text '"' Literal.String.Double '$argv' Name.Variable '[1]' Literal.String.Double '"' Literal.String.Double ')' Operator '\n ' Text 'end' Keyword '\n\n ' Text 'test' Keyword ' ' Text '"' Literal.String.Double '$parent' Name.Variable '"' Literal.String.Double ';' Punctuation ' ' Text 'and' Keyword ' ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '-s' Text ' ' Text '"' Literal.String.Double '$parent' Name.Variable '"' Literal.String.Double '\n ' Text 'set_color ' Name.Builtin 'fff' Text ' ' Text '--bold' Text '\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '"' Literal.String.Double '$directory' Name.Variable ' ' Literal.String.Double '"' Literal.String.Double '\n ' Text 'set_color ' Name.Builtin 'normal' Text '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_finish_segments' Text ' ' Text '-d' Text ' ' Text "'Close open prompt segments'" Literal.String.Single '\n ' Text 'if' Keyword ' ' Text '[' Operator ' ' Text '-n' Text ' ' Text '$__bobthefish_current_bg' Name.Variable ' ' Text '-a' Text ' ' Text '$__bobthefish_current_bg' Name.Variable ' ' Text '!' Text '=' Operator ' ' Text "'NONE'" Literal.String.Single ' ' Text ']' Operator '\n ' Text 'set_color' Name.Builtin ' ' Text '-b' Text ' ' Text 'normal' Text '\n ' Text 'set_color' Name.Builtin ' ' Text '$__bobthefish_current_bg' Name.Variable '\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '"' Literal.String.Double '$__bobthefish_right_black_arrow_glyph' Name.Variable ' ' Literal.String.Double '"' Literal.String.Double '\n ' Text 'set_color ' Name.Builtin 'normal' Text '\n ' Text 'end' Keyword '\n ' Text 'set' Keyword ' ' Text '-g' Text ' ' Text '__bobthefish_current_bg' Text ' ' Text 'NONE' Text '\n' Text 'end' Keyword '\n\n\n' Text '# ===========================\n' Comment '# Theme components\n' Comment '# ===========================\n' Comment '\n' Text 'function' Keyword ' ' Text '__bobthefish_prompt_status' Text ' ' Text '-d' Text ' ' Text "'Display symbols for a non zero exit status, root and background jobs'" Literal.String.Single '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'nonzero' Text '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'superuser' Text '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'bg_jobs' Text '\n\n ' Text '# Last exit was nonzero\n' Comment ' ' Text 'if' Keyword ' ' Text '[' Operator ' ' Text '$status' Name.Variable ' ' Text '-ne' Text ' ' Text '0' Literal.Number ' ' Text ']' Operator '\n ' Text 'set' Keyword ' ' Text 'nonzero' Text ' ' Text '$__bobthefish_nonzero_exit_glyph' Name.Variable '\n ' Text 'end' Keyword '\n\n ' Text '# if superuser (uid == 0)\n' Comment ' ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'uid' Text ' ' Text '(' Operator 'id' Text ' ' Text '-u' Text ' ' Text '$USER' Name.Variable ')' Operator '\n ' Text 'if' Keyword ' ' Text '[' Operator ' ' Text '$uid' Name.Variable ' ' Text '-eq' Text ' ' Text '0' Literal.Number ' ' Text ']' Operator '\n ' Text 'set' Keyword ' ' Text 'superuser' Text ' ' Text '$__bobthefish_superuser_glyph' Name.Variable '\n ' Text 'end' Keyword '\n\n ' Text '# Jobs display\n' Comment ' ' Text 'if' Keyword ' ' Text '[' Operator ' ' Text '(' Operator 'jobs' Name.Builtin ' ' Text '-l' Text ' ' Text '|' Operator ' ' Text 'wc' Text ' ' Text '-l' Text ')' Operator ' ' Text '-gt' Text ' ' Text '0' Literal.Number ' ' Text ']' Operator '\n ' Text 'set' Keyword ' ' Text 'bg_jobs' Text ' ' Text '$__bobthefish_bg_job_glyph' Name.Variable '\n ' Text 'end' Keyword '\n\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'status_flags' Text ' ' Text '"' Literal.String.Double '$nonzero' Name.Variable '$superuser' Name.Variable '$bg_jobs' Name.Variable '"' Literal.String.Double '\n\n ' Text 'if' Keyword ' ' Text 'test' Keyword ' ' Text '"' Literal.String.Double '$nonzero' Name.Variable '"' Literal.String.Double ' ' Text '-o' Text ' ' Text '"' Literal.String.Double '$superuser' Name.Variable '"' Literal.String.Double ' ' Text '-o' Text ' ' Text '"' Literal.String.Double '$bg_jobs' Name.Variable '"' Literal.String.Double '\n ' Text '__bobthefish_start_segment' Text ' ' Text 'fff' Text ' ' Text '000' Text '\n ' Text 'if' Keyword ' ' Text '[' Operator ' ' Text '"' Literal.String.Double '$nonzero' Name.Variable '"' Literal.String.Double ' ' Text ']' Operator '\n ' Text 'set_color' Name.Builtin ' ' Text '$__bobthefish_med_red' Name.Variable ' ' Text '--bold' Text '\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '$__bobthefish_nonzero_exit_glyph' Name.Variable '\n ' Text 'end' Keyword '\n\n ' Text 'if' Keyword ' ' Text '[' Operator ' ' Text '"' Literal.String.Double '$superuser' Name.Variable '"' Literal.String.Double ' ' Text ']' Operator '\n ' Text 'set_color' Name.Builtin ' ' Text '$__bobthefish_med_green' Name.Variable ' ' Text '--bold' Text '\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '$__bobthefish_superuser_glyph' Name.Variable '\n ' Text 'end' Keyword '\n\n ' Text 'if' Keyword ' ' Text '[' Operator ' ' Text '"' Literal.String.Double '$bg_jobs' Name.Variable '"' Literal.String.Double ' ' Text ']' Operator '\n ' Text 'set_color' Name.Builtin ' ' Text '$__bobthefish_slate_blue' Name.Variable ' ' Text '--bold' Text '\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '$__bobthefish_bg_job_glyph' Name.Variable '\n ' Text 'end' Keyword '\n\n ' Text 'set_color ' Name.Builtin 'normal' Text '\n ' Text 'end' Keyword '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_prompt_user' Text ' ' Text '-d' Text ' ' Text "'Display actual user if different from $default_user'" Literal.String.Single '\n ' Text 'if' Keyword ' ' Text '[' Operator ' ' Text '"' Literal.String.Double '$theme_display_user' Name.Variable '"' Literal.String.Double ' ' Text '=' Operator ' ' Text "'yes'" Literal.String.Single ' ' Text ']' Operator '\n ' Text 'if' Keyword ' ' Text '[' Operator ' ' Text '"' Literal.String.Double '$USER' Name.Variable '"' Literal.String.Double ' ' Text '!' Text '=' Operator ' ' Text '"' Literal.String.Double '$default_user' Name.Variable '"' Literal.String.Double ' ' Text '-o' Text ' ' Text '-n' Text ' ' Text '"' Literal.String.Double '$SSH_CLIENT' Name.Variable '"' Literal.String.Double ' ' Text ']' Operator '\n ' Text '__bobthefish_start_segment' Text ' ' Text '$__bobthefish_lt_grey' Name.Variable ' ' Text '$__bobthefish_slate_blue' Name.Variable '\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '-s' Text ' ' Text '(' Operator 'whoami' Text ')' Operator ' ' Text "'@'" Literal.String.Single ' ' Text '(' Operator 'hostname' Text ' ' Text '|' Operator ' ' Text 'cut' Text ' ' Text '-d' Text ' ' Text '.' Text ' ' Text '-f' Text ' ' Text '1' Text ')' Operator ' ' Text "' '" Literal.String.Single '\n ' Text 'end' Keyword '\n ' Text 'end' Keyword '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_prompt_hg' Text ' ' Text '-d' Text ' ' Text "'Display the actual hg state'" Literal.String.Single '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'dirty' Text ' ' Text '(' Operator 'command ' Name.Builtin 'hg' Text ' ' Text 'stat' Text ';' Punctuation ' ' Text 'or' Keyword ' ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text "'*'" Literal.String.Single ')' Operator '\n\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'flags' Text ' ' Text '"' Literal.String.Double '$dirty' Name.Variable '"' Literal.String.Double '\n ' Text 'test' Keyword ' ' Text '"' Literal.String.Double '$flags' Name.Variable '"' Literal.String.Double ';' Punctuation ' ' Text 'and' Keyword ' ' Text 'set' Keyword ' ' Text 'flags' Text ' ' Text '""' Literal.String.Double '\n\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'flag_bg' Text ' ' Text '$__bobthefish_lt_green' Name.Variable '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'flag_fg' Text ' ' Text '$__bobthefish_dk_green' Name.Variable '\n ' Text 'if' Keyword ' ' Text 'test' Keyword ' ' Text '"' Literal.String.Double '$dirty' Name.Variable '"' Literal.String.Double '\n ' Text 'set' Keyword ' ' Text 'flag_bg' Text ' ' Text '$__bobthefish_med_red' Name.Variable '\n ' Text 'set' Keyword ' ' Text 'flag_fg' Text ' ' Text 'fff' Text '\n ' Text 'end' Keyword '\n\n ' Text '__bobthefish_path_segment' Text ' ' Text '(' Operator '__bobthefish_hg_project_dir' Text ')' Operator '\n\n ' Text '__bobthefish_start_segment' Text ' ' Text '$flag_bg' Name.Variable ' ' Text '$flag_fg' Name.Variable '\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '-s' Text ' ' Text '$__bobthefish_hg_glyph' Name.Variable ' ' Text "' '" Literal.String.Single '\n\n ' Text '__bobthefish_start_segment' Text ' ' Text '$flag_bg' Name.Variable ' ' Text '$flag_fg' Name.Variable '\n ' Text 'set_color' Name.Builtin ' ' Text '$flag_fg' Name.Variable ' ' Text '--bold' Text '\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '-s' Text ' ' Text '(' Operator '__bobthefish_hg_branch' Text ')' Operator ' ' Text '$flags' Name.Variable ' ' Text "' '" Literal.String.Single '\n ' Text 'set_color ' Name.Builtin 'normal' Text '\n\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'project_pwd' Text ' ' Text '(' Operator '__bobthefish_project_pwd' Text ' ' Text '(' Operator '__bobthefish_hg_project_dir' Text ')' Operator ')' Operator '\n ' Text 'if' Keyword ' ' Text 'test' Keyword ' ' Text '"' Literal.String.Double '$project_pwd' Name.Variable '"' Literal.String.Double '\n ' Text 'if' Keyword ' ' Text 'test' Keyword ' ' Text '-w' Text ' ' Text '"' Literal.String.Double '$PWD' Name.Variable '"' Literal.String.Double '\n ' Text '__bobthefish_start_segment' Text ' ' Text '333' Literal.Number ' ' Text '999' Text '\n ' Text 'else' Keyword '\n ' Text '__bobthefish_start_segment' Text ' ' Text '$__bobthefish_med_red' Name.Variable ' ' Text '$__bobthefish_lt_red' Name.Variable '\n ' Text 'end' Keyword '\n\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '-s' Text ' ' Text '$project_pwd' Name.Variable ' ' Text "' '" Literal.String.Single '\n ' Text 'end' Keyword '\n' Text 'end' Keyword '\n\n' Text '# TODO: clean up the fugly $ahead business\n' Comment 'function' Keyword ' ' Text '__bobthefish_prompt_git' Text ' ' Text '-d' Text ' ' Text "'Display the actual git state'" Literal.String.Single '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'dirty' Text ' ' Text '(' Operator 'command ' Name.Builtin 'git' Text ' ' Text 'diff' Text ' ' Text '--no-ext-diff' Text ' ' Text '--quiet' Text ' ' Text '--exit-code' Text ';' Punctuation ' ' Text 'or' Keyword ' ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text "'*'" Literal.String.Single ')' Operator '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'staged' Text ' ' Text '(' Operator 'command ' Name.Builtin 'git' Text ' ' Text 'diff' Text ' ' Text '--cached' Text ' ' Text '--no-ext-diff' Text ' ' Text '--quiet' Text ' ' Text '--exit-code' Text ';' Punctuation ' ' Text 'or' Keyword ' ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text "'~'" Literal.String.Single ')' Operator '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'stashed' Text ' ' Text '(' Operator 'command ' Name.Builtin 'git' Text ' ' Text 'rev-parse' Text ' ' Text '--verify' Text ' ' Text 'refs/stash' Text ' ' Text '>' Operator ' ' Text '/dev/null' Text ' ' Text '2>' Text '&' Operator '1' Text ';' Punctuation ' ' Text 'and' Keyword ' ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text "'$'" Literal.String.Single ')' Operator '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'ahead' Text ' ' Text '(' Operator 'command ' Name.Builtin 'git' Text ' ' Text 'branch' Text ' ' Text '-v' Text ' ' Text '2>' Text ' ' Text '/dev/null' Text ' ' Text '|' Operator ' ' Text 'grep' Text ' ' Text '-Eo' Text ' ' Text "'^\\* [^ ]* *[^ ]* *\\[[^]]*\\]'" Literal.String.Single ' ' Text '|' Operator ' ' Text 'grep' Text ' ' Text '-Eo' Text ' ' Text "'\\[[^]]*\\]$'" Literal.String.Single ' ' Text '|' Operator ' ' Text 'awk' Text ' ' Text '\'ORS="";/ahead/ {print "+"} /behind/ {print "-"}\'' Literal.String.Single ' ' Text '|' Operator ' ' Text 'sed' Text ' ' Text '-e' Text ' ' Text "'s/+-/±/'" Literal.String.Single ')' Operator '\n\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'new' Text ' ' Text '(' Operator 'command ' Name.Builtin 'git' Text ' ' Text 'ls-files' Text ' ' Text '--other' Text ' ' Text '--exclude-standard' Text ')' Operator ';' Punctuation '\n ' Text 'test' Keyword ' ' Text '"' Literal.String.Double '$new' Name.Variable '"' Literal.String.Double ';' Punctuation ' ' Text 'and' Keyword ' ' Text 'set' Keyword ' ' Text 'new' Text ' ' Text "'…'" Literal.String.Single '\n\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'flags' Text ' ' Text '"' Literal.String.Double '$dirty' Name.Variable '$staged' Name.Variable '$stashed' Name.Variable '$ahead' Name.Variable '$new' Name.Variable '"' Literal.String.Double '\n ' Text 'test' Keyword ' ' Text '"' Literal.String.Double '$flags' Name.Variable '"' Literal.String.Double ';' Punctuation ' ' Text 'and' Keyword ' ' Text 'set' Keyword ' ' Text 'flags' Text ' ' Text '"' Literal.String.Double ' ' Literal.String.Double '$flags' Name.Variable '"' Literal.String.Double '\n\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'flag_bg' Text ' ' Text '$__bobthefish_lt_green' Name.Variable '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'flag_fg' Text ' ' Text '$__bobthefish_dk_green' Name.Variable '\n ' Text 'if' Keyword ' ' Text 'test' Keyword ' ' Text '"' Literal.String.Double '$dirty' Name.Variable '"' Literal.String.Double ' ' Text '-o' Text ' ' Text '"' Literal.String.Double '$staged' Name.Variable '"' Literal.String.Double '\n ' Text 'set' Keyword ' ' Text 'flag_bg' Text ' ' Text '$__bobthefish_med_red' Name.Variable '\n ' Text 'set' Keyword ' ' Text 'flag_fg' Text ' ' Text 'fff' Text '\n ' Text 'else' Keyword '\n ' Text 'if' Keyword ' ' Text 'test' Keyword ' ' Text '"' Literal.String.Double '$stashed' Name.Variable '"' Literal.String.Double '\n ' Text 'set' Keyword ' ' Text 'flag_bg' Text ' ' Text '$__bobthefish_lt_orange' Name.Variable '\n ' Text 'set' Keyword ' ' Text 'flag_fg' Text ' ' Text '$__bobthefish_dk_orange' Name.Variable '\n ' Text 'end' Keyword '\n ' Text 'end' Keyword '\n\n ' Text '__bobthefish_path_segment' Text ' ' Text '(' Operator '__bobthefish_git_project_dir' Text ')' Operator '\n\n ' Text '__bobthefish_start_segment' Text ' ' Text '$flag_bg' Name.Variable ' ' Text '$flag_fg' Name.Variable '\n ' Text 'set_color' Name.Builtin ' ' Text '$flag_fg' Name.Variable ' ' Text '--bold' Text '\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '-s' Text ' ' Text '(' Operator '__bobthefish_git_branch' Text ')' Operator ' ' Text '$flags' Name.Variable ' ' Text "' '" Literal.String.Single '\n ' Text 'set_color ' Name.Builtin 'normal' Text '\n\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'project_pwd' Text ' ' Text '(' Operator '__bobthefish_project_pwd' Text ' ' Text '(' Operator '__bobthefish_git_project_dir' Text ')' Operator ')' Operator '\n ' Text 'if' Keyword ' ' Text 'test' Keyword ' ' Text '"' Literal.String.Double '$project_pwd' Name.Variable '"' Literal.String.Double '\n ' Text 'if' Keyword ' ' Text 'test' Keyword ' ' Text '-w' Text ' ' Text '"' Literal.String.Double '$PWD' Name.Variable '"' Literal.String.Double '\n ' Text '__bobthefish_start_segment' Text ' ' Text '333' Literal.Number ' ' Text '999' Text '\n ' Text 'else' Keyword '\n ' Text '__bobthefish_start_segment' Text ' ' Text '$__bobthefish_med_red' Name.Variable ' ' Text '$__bobthefish_lt_red' Name.Variable '\n ' Text 'end' Keyword '\n\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '-s' Text ' ' Text '$project_pwd' Name.Variable ' ' Text "' '" Literal.String.Single '\n ' Text 'end' Keyword '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_prompt_dir' Text ' ' Text '-d' Text ' ' Text "'Display a shortened form of the current directory'" Literal.String.Single '\n ' Text '__bobthefish_path_segment' Text ' ' Text '"' Literal.String.Double '$PWD' Name.Variable '"' Literal.String.Double '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_in_virtualfish_virtualenv' Text '\n ' Text 'set' Keyword ' ' Text '-q' Text ' ' Text 'VIRTUAL_ENV' Text '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_virtualenv_python_version' Text ' ' Text '-d' Text ' ' Text "'Get current python version'" Literal.String.Single '\n ' Text 'switch' Keyword ' ' Text '(' Operator 'readlink' Text ' ' Text '(' Operator 'which' Text ' ' Text 'python' Text ')' Operator ')' Operator '\n ' Text 'case' Keyword ' ' Text 'python2' Text '\n ' Text 'echo' Keyword ' ' Text '$__bobthefish_superscript_glyph' Name.Variable '[' Operator '2' Text ']' Operator '\n ' Text 'case' Keyword ' ' Text 'python3' Text '\n ' Text 'echo' Keyword ' ' Text '$__bobthefish_superscript_glyph' Name.Variable '[' Operator '3' Text ']' Operator '\n ' Text 'case' Keyword ' ' Text 'pypy' Text '\n ' Text 'echo' Keyword ' ' Text '$__bobthefish_pypy_glyph' Name.Variable '\n ' Text 'end' Keyword '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_virtualenv' Text ' ' Text '-d' Text ' ' Text "'Get the current virtualenv'" Literal.String.Single '\n ' Text 'echo' Keyword ' ' Text '$__bobthefish_virtualenv_glyph' Name.Variable '(' Operator '__bobthefish_virtualenv_python_version' Text ')' Operator ' ' Text '(' Operator 'basename' Text ' ' Text '"' Literal.String.Double '$VIRTUAL_ENV' Name.Variable '"' Literal.String.Double ')' Operator '\n' Text 'end' Keyword '\n\n' Text 'function' Keyword ' ' Text '__bobthefish_prompt_virtualfish' Text ' ' Text '-d' Text ' ' Text '"Display activated virtual environment (only for virtualfish, virtualenv\'s activate.fish changes prompt by itself)"' Literal.String.Double '\n ' Text 'set' Keyword ' ' Text 'flag_bg' Text ' ' Text '$__bobthefish_lt_blue' Name.Variable '\n ' Text 'set' Keyword ' ' Text 'flag_fg' Text ' ' Text '$__bobthefish_dk_blue' Name.Variable '\n ' Text '__bobthefish_start_segment' Text ' ' Text '$flag_bg' Name.Variable ' ' Text '$flag_fg' Name.Variable '\n ' Text 'set_color' Name.Builtin ' ' Text '$flag_fg' Name.Variable ' ' Text '--bold' Text '\n ' Text 'echo' Keyword ' ' Text '-n' Text ' ' Text '-s' Text ' ' Text '(' Operator '__bobthefish_virtualenv' Text ')' Operator ' ' Text '$flags' Name.Variable ' ' Text "' '" Literal.String.Single '\n ' Text 'set_color ' Name.Builtin 'normal' Text '\n' Text 'end' Keyword '\n\n\n' Text '# ===========================\n' Comment '# Apply theme\n' Comment '# ===========================\n' Comment '\n' Text 'function' Keyword ' ' Text 'fish_prompt' Name.Builtin ' ' Text '-d' Text ' ' Text "'bobthefish, a fish theme optimized for awesome'" Literal.String.Single '\n ' Text '__bobthefish_prompt_status' Text '\n ' Text '__bobthefish_prompt_user' Text '\n ' Text 'if' Keyword ' ' Text '__bobthefish_in_virtualfish_virtualenv' Text '\n ' Text '__bobthefish_prompt_virtualfish' Text '\n ' Text 'end' Keyword '\n ' Text 'if' Keyword ' ' Text '__bobthefish_in_git' Text ' ' Text '# TODO: do this right.\n' Comment ' ' Text '__bobthefish_prompt_git' Text ' ' Text '# if something is in both git and hg, check the length of\n' Comment ' ' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text '__bobthefish_in_hg' Text ' ' Text '# __bobthefish_git_project_dir vs __bobthefish_hg_project_dir\n' Comment ' ' Text '__bobthefish_prompt_hg' Text ' ' Text '# and pick the longer of the two.\n' Comment ' ' Text 'else' Keyword '\n ' Text '__bobthefish_prompt_dir' Text '\n ' Text 'end' Keyword '\n ' Text '__bobthefish_finish_segments' Text '\n' Text 'end' Keyword '\n\n' Text '# -----------------------------------------------------------------------------\n' Comment '# funced - edit a function interactively\n' Comment '#\n' Comment '# Synopsis\n' Comment '#\n' Comment '# funced [OPTIONS] NAME\n' Comment '#\n' Comment '# Description\n' Comment '#\n' Comment '# funced provides an interface to edit the definition of the function NAME.\n' Comment '# -----------------------------------------------------------------------------\n' Comment '\n' Text 'function' Keyword ' ' Text 'funced' Name.Builtin ' ' Text '--description' Text ' ' Text "'Edit function definition'" Literal.String.Single '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'editor' Text ' ' Text '$EDITOR' Name.Variable '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'interactive' Text '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'funcname' Text '\n ' Text 'while' Keyword ' ' Text 'set' Keyword ' ' Text '-q' Text ' ' Text 'argv' Text '[' Operator '1' Text ']' Operator '\n ' Text 'switch' Keyword ' ' Text '$argv' Name.Variable '[' Operator '1' Text ']' Operator '\n ' Text 'case' Keyword ' ' Text '-h' Text ' ' Text '--help' Text '\n ' Text '__fish_print_help' Text ' ' Text 'funced\n ' Name.Builtin 'return' Keyword ' ' Text '0' Text '\n\n ' Text 'case' Keyword ' ' Text '-e' Text ' ' Text '--editor' Text '\n ' Text 'set' Keyword ' ' Text 'editor' Text ' ' Text '$argv' Name.Variable '[' Operator '2' Text ']' Operator '\n ' Text 'set' Keyword ' ' Text '-e' Text ' ' Text 'argv' Text '[' Operator '2' Text ']' Operator '\n\n ' Text 'case' Keyword ' ' Text '-i' Text ' ' Text '--interactive' Text '\n ' Text 'set' Keyword ' ' Text 'interactive' Text ' ' Text '1' Text '\n\n ' Text 'case' Keyword ' ' Text '--' Text '\n ' Text 'set' Keyword ' ' Text 'funcname' Text ' ' Text '$funcname' Name.Variable ' ' Text '$argv' Name.Variable '[' Operator '2' Text ']' Operator '\n ' Text 'set' Keyword ' ' Text '-e' Text ' ' Text 'argv' Text '[' Operator '2' Text ']' Operator '\n\n ' Text 'case' Keyword ' ' Text "'-*'" Literal.String.Single '\n ' Text 'set_color ' Name.Builtin 'red' Text '\n ' Text 'printf' Name.Builtin ' ' Text '(' Operator '_' Text ' ' Text '"%s: Unknown option %s\\n"' Literal.String.Double ')' Operator ' ' Text 'funced' Name.Builtin ' ' Text '$argv' Name.Variable '[' Operator '1' Text ']' Operator '\n ' Text 'set_color ' Name.Builtin 'normal' Text '\n ' Text 'return' Keyword ' ' Text '1' Text '\n\n ' Text 'case' Keyword ' ' Text "'*'" Literal.String.Single ' ' Text "'.*'" Literal.String.Single '\n ' Text 'set' Keyword ' ' Text 'funcname' Text ' ' Text '$funcname' Name.Variable ' ' Text '$argv' Name.Variable '[' Operator '1' Text ']' Operator '\n ' Text 'end' Keyword '\n ' Text 'set' Keyword ' ' Text '-e' Text ' ' Text 'argv' Text '[' Operator '1' Text ']' Operator '\n ' Text 'end' Keyword '\n\n ' Text 'if' Keyword ' ' Text 'begin' Keyword ';' Punctuation ' ' Text 'set' Keyword ' ' Text '-q' Text ' ' Text 'funcname' Text '[' Operator '2' Text ']' Operator ';' Punctuation ' ' Text 'or' Keyword ' ' Text 'not' Keyword ' ' Text 'test' Keyword ' ' Text '"' Literal.String.Double '$funcname' Name.Variable '[1]' Literal.String.Double '"' Literal.String.Double ';' Punctuation ' ' Text 'end' Keyword '\n ' Text 'set_color ' Name.Builtin 'red' Text '\n ' Text '_' Text ' ' Text '"funced: You must specify one function name\n"' Literal.String.Double '\n ' Text 'set_color ' Name.Builtin 'normal' Text '\n ' Text 'return' Keyword ' ' Text '1' Text '\n ' Text 'end' Keyword '\n\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'init' Text '\n ' Text 'switch' Keyword ' ' Text '$funcname' Name.Variable '\n ' Text 'case' Keyword ' ' Text "'-*'" Literal.String.Single '\n ' Text 'set' Keyword ' ' Text 'init' Text ' ' Text 'function' Keyword ' ' Text '--' Text ' ' Text '$funcname' Name.Variable '\\n' Literal.String.Escape '\\n' Literal.String.Escape 'end' Text '\n ' Text 'case' Keyword ' ' Text "'*'" Literal.String.Single '\n ' Text 'set' Keyword ' ' Text 'init' Text ' ' Text 'function' Keyword ' ' Text '$funcname' Name.Variable '\\n' Literal.String.Escape '\\n' Literal.String.Escape 'end' Text '\n ' Text 'end' Keyword '\n\n ' Text '# Break editor up to get its first command (i.e. discard flags)\n' Comment ' ' Text 'if' Keyword ' ' Text 'test' Keyword ' ' Text '-n' Text ' ' Text '"' Literal.String.Double '$editor' Name.Variable '"' Literal.String.Double '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'editor_cmd' Text '\n ' Text 'eval ' Name.Builtin 'set' Keyword ' ' Text 'editor_cmd' Text ' ' Text '$editor' Name.Variable '\n ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'type' Name.Builtin ' ' Text '-f' Text ' ' Text '"' Literal.String.Double '$editor_cmd' Name.Variable '[1]' Literal.String.Double '"' Literal.String.Double ' ' Text '>' Operator '/dev/null' Text '\n ' Text '_' Text ' ' Text '"' Literal.String.Double "funced: The value for \\$EDITOR '" Literal.String.Double '$editor' Name.Variable "' could not be used because the command '" Literal.String.Double '$editor_cmd' Name.Variable "[1]' could not be found\n " Literal.String.Double '"' Literal.String.Double '\n ' Text 'set' Keyword ' ' Text 'editor' Text ' ' Text 'fish\n ' Name.Builtin 'end' Keyword '\n ' Text 'end' Keyword '\n\n ' Text '# If no editor is specified, use fish\n' Comment ' ' Text 'if' Keyword ' ' Text 'test' Keyword ' ' Text '-z' Text ' ' Text '"' Literal.String.Double '$editor' Name.Variable '"' Literal.String.Double '\n ' Text 'set' Keyword ' ' Text 'editor' Text ' ' Text 'fish\n ' Name.Builtin 'end' Keyword '\n\n ' Text 'if' Keyword ' ' Text 'begin' Keyword ';' Punctuation ' ' Text 'set' Keyword ' ' Text '-q' Text ' ' Text 'interactive' Text '[' Operator '1' Text ']' Operator ';' Punctuation ' ' Text 'or' Keyword ' ' Text 'test' Keyword ' ' Text '"' Literal.String.Double '$editor' Name.Variable '"' Literal.String.Double ' ' Text '=' Operator ' ' Text 'fish' Name.Builtin ';' Punctuation ' ' Text 'end' Keyword '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'IFS' Text '\n ' Text 'if' Keyword ' ' Text 'functions' Name.Builtin ' ' Text '-q' Text ' ' Text '--' Text ' ' Text '$funcname' Name.Variable '\n ' Text '# Shadow IFS here to avoid array splitting in command substitution\n' Comment ' ' Text 'set' Keyword ' ' Text 'init' Text ' ' Text '(' Operator 'functions' Name.Builtin ' ' Text '--' Text ' ' Text '$funcname' Name.Variable ' ' Text '|' Operator ' ' Text 'fish_indent' Name.Builtin ' ' Text '--no-indent' Text ')' Operator '\n ' Text 'end' Keyword '\n\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'prompt' Text ' ' Text '\'printf "%s%s%s> " (set_color green) \'' Literal.String.Single '$funcname' Name.Variable "' (set_color normal)'" Literal.String.Single '\n ' Text '# Unshadow IFS since the fish_title breaks otherwise\n' Comment ' ' Text 'set' Keyword ' ' Text '-e' Text ' ' Text 'IFS' Text '\n ' Text 'if' Keyword ' ' Text 'read' Name.Builtin ' ' Text '-p' Text ' ' Text '$prompt' Name.Variable ' ' Text '-c' Text ' ' Text '"' Literal.String.Double '$init' Name.Variable '"' Literal.String.Double ' ' Text '-s' Text ' ' Text 'cmd' Text '\n ' Text '# Shadow IFS _again_ to avoid array splitting in command substitution\n' Comment ' ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'IFS' Text '\n ' Text 'eval' Name.Builtin ' ' Text '(' Operator 'echo' Keyword ' ' Text '-n' Text ' ' Text '$cmd' Name.Variable ' ' Text '|' Operator ' ' Text 'fish_indent' Name.Builtin ')' Operator '\n ' Text 'end' Keyword '\n ' Text 'return' Keyword ' ' Text '0' Text '\n ' Text 'end' Keyword '\n\n ' Text 'set' Keyword ' ' Text '-q' Text ' ' Text 'TMPDIR' Text ';' Punctuation ' ' Text 'or' Keyword ' ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'TMPDIR' Text ' ' Text '/tmp' Text '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'tmpname' Text ' ' Text '(' Operator 'printf' Name.Builtin ' ' Text '"' Literal.String.Double '$TMPDIR' Name.Variable '/fish_funced_%d_%d.fish' Literal.String.Double '"' Literal.String.Double ' ' Text '%self' Text ' ' Text '(' Operator 'random' Name.Builtin ')' Operator ')' Operator '\n ' Text 'while' Keyword ' ' Text 'test' Keyword ' ' Text '-f' Text ' ' Text '$tmpname' Name.Variable '\n ' Text 'set' Keyword ' ' Text 'tmpname' Text ' ' Text '(' Operator 'printf' Name.Builtin ' ' Text '"' Literal.String.Double '$TMPDIR' Name.Variable '/fish_funced_%d_%d.fish' Literal.String.Double '"' Literal.String.Double ' ' Text '%self' Text ' ' Text '(' Operator 'random' Name.Builtin ')' Operator ')' Operator '\n ' Text 'end' Keyword '\n\n ' Text 'if' Keyword ' ' Text 'functions' Name.Builtin ' ' Text '-q' Text ' ' Text '--' Text ' ' Text '$funcname' Name.Variable '\n ' Text 'functions' Name.Builtin ' ' Text '--' Text ' ' Text '$funcname' Name.Variable ' ' Text '>' Operator ' ' Text '$tmpname' Name.Variable '\n ' Text 'else' Keyword '\n ' Text 'echo' Keyword ' ' Text '$init' Name.Variable ' ' Text '>' Operator ' ' Text '$tmpname' Name.Variable '\n ' Text 'end' Keyword '\n ' Text 'if' Keyword ' ' Text 'eval' Name.Builtin ' ' Text '$editor' Name.Variable ' ' Text '$tmpname' Name.Variable '\n ' Text '.' Text ' ' Text '$tmpname' Name.Variable '\n ' Text 'end' Keyword '\n ' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'stat' Text ' ' Text '$status' Name.Variable '\n ' Text 'rm' Text ' ' Text '-f' Text ' ' Text '$tmpname' Name.Variable ' ' Text '>' Operator '/dev/null' Text '\n ' Text 'return' Keyword ' ' Text '$stat' Name.Variable '\n' Text 'end' Keyword '\n\n' Text '# -----------------------------------------------------------------------------\n' Comment '# Main file for fish command completions. This file contains various\n' Comment '# common helper functions for the command completions. All actual\n' Comment '# completions are located in the completions subdirectory.\n' Comment '## -----------------------------------------------------------------------------\n' Comment '\n' Text '#\n' Comment '# Set default field separators\n' Comment '#\n' Comment '\n' Text 'set' Keyword ' ' Text '-g' Text ' ' Text 'IFS' Text ' ' Text '\\n' Literal.String.Escape '\\ ' Literal.String.Escape '\\t' Literal.String.Escape '\n\n' Text '#\n' Comment '# Set default search paths for completions and shellscript functions\n' Comment '# unless they already exist\n' Comment '#\n' Comment '\n' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'configdir' Text ' ' Text '~/.config' Text '\n\n' Text 'if' Keyword ' ' Text 'set' Keyword ' ' Text '-q' Text ' ' Text 'XDG_CONFIG_HOME' Text '\n ' Text 'set' Keyword ' ' Text 'configdir' Text ' ' Text '$XDG_CONFIG_HOME' Name.Variable '\n' Text 'end' Keyword '\n\n' Text '# __fish_datadir, __fish_sysconfdir, __fish_help_dir, __fish_bin_dir\n' Comment '# are expected to have been set up by read_init from fish.cpp\n' Comment '\n' Text '# Set up function and completion paths. Make sure that the fish\n' Comment '# default functions/completions are included in the respective path.\n' Comment '\n' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'set' Keyword ' ' Text '-q' Text ' ' Text 'fish_function_path' Text '\n ' Text 'set' Keyword ' ' Text 'fish_function_path' Text ' ' Text '$configdir' Name.Variable '/fish/functions' Text ' ' Text '$__fish_sysconfdir' Name.Variable '/functions' Text ' ' Text '$__fish_datadir' Name.Variable '/functions' Text '\n' Text 'end' Keyword '\n\n' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'contains' Name.Builtin ' ' Text '$__fish_datadir' Name.Variable '/functions' Text ' ' Text '$fish_function_path' Name.Variable '\n ' Text 'set' Keyword ' ' Text 'fish_function_path' Text '[' Operator '-1' Text ']' Operator ' ' Text '$__fish_datadir' Name.Variable '/functions' Text '\n' Text 'end' Keyword '\n\n' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'set' Keyword ' ' Text '-q' Text ' ' Text 'fish_complete_path' Text '\n ' Text 'set' Keyword ' ' Text 'fish_complete_path' Text ' ' Text '$configdir' Name.Variable '/fish/completions' Text ' ' Text '$__fish_sysconfdir' Name.Variable '/completions' Text ' ' Text '$__fish_datadir' Name.Variable '/completions' Text '\n' Text 'end' Keyword '\n\n' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'contains' Name.Builtin ' ' Text '$__fish_datadir' Name.Variable '/completions' Text ' ' Text '$fish_complete_path' Name.Variable '\n ' Text 'set' Keyword ' ' Text 'fish_complete_path' Text '[' Operator '-1' Text ']' Operator ' ' Text '$__fish_datadir' Name.Variable '/completions' Text '\n' Text 'end' Keyword '\n\n' Text '#\n' Comment '# This is a Solaris-specific test to modify the PATH so that\n' Comment '# Posix-conformant tools are used by default. It is separate from the\n' Comment '# other PATH code because this directory needs to be prepended, not\n' Comment '# appended, since it contains POSIX-compliant replacements for various\n' Comment '# system utilities.\n' Comment '#\n' Comment '\n' Text 'if' Keyword ' ' Text 'test' Keyword ' ' Text '-d' Text ' ' Text '/usr/xpg4/bin' Text '\n ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'contains' Name.Builtin ' ' Text '/usr/xpg4/bin' Text ' ' Text '$PATH' Name.Variable '\n ' Text 'set' Keyword ' ' Text 'PATH' Text ' ' Text '/usr/xpg4/bin' Text ' ' Text '$PATH' Name.Variable '\n ' Text 'end' Keyword '\n' Text 'end' Keyword '\n\n' Text '#\n' Comment '# Add a few common directories to path, if they exists. Note that pure\n' Comment '# console programs like makedep sometimes live in /usr/X11R6/bin, so we\n' Comment '# want this even for text-only terminals.\n' Comment '#\n' Comment '\n' Text 'set' Keyword ' ' Text '-l' Text ' ' Text 'path_list' Text ' ' Text '/bin' Text ' ' Text '/usr/bin' Text ' ' Text '/usr/X11R6/bin' Text ' ' Text '/usr/local/bin' Text ' ' Text '$__fish_bin_dir' Name.Variable '\n\n' Text '# Root should also have the sbin directories in the path\n' Comment 'switch' Keyword ' ' Text '$USER' Name.Variable '\n ' Text 'case' Keyword ' ' Text 'root' Text '\n ' Text 'set' Keyword ' ' Text 'path_list' Text ' ' Text '$path_list' Name.Variable ' ' Text '/sbin' Text ' ' Text '/usr/sbin' Text ' ' Text '/usr/local/sbin' Text '\n' Text 'end' Keyword '\n\n' Text 'for' Keyword ' ' Text 'i' Text ' ' Text 'in' Keyword ' ' Text '$path_list' Name.Variable '\n ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'contains' Name.Builtin ' ' Text '$i' Name.Variable ' ' Text '$PATH' Name.Variable '\n ' Text 'if' Keyword ' ' Text 'test' Keyword ' ' Text '-d' Text ' ' Text '$i' Name.Variable '\n ' Text 'set' Keyword ' ' Text 'PATH' Text ' ' Text '$PATH' Name.Variable ' ' Text '$i' Name.Variable '\n ' Text 'end' Keyword '\n ' Text 'end' Keyword '\n' Text 'end' Keyword '\n\n' Text '#\n' Comment '# Launch debugger on SIGTRAP\n' Comment '#\n' Comment 'function' Keyword ' ' Text 'fish_sigtrap_handler' Text ' ' Text '--on-signal' Text ' ' Text 'TRAP' Text ' ' Text '--no-scope-shadowing' Text ' ' Text '--description' Text ' ' Text '"Signal handler for the TRAP signal. Lanches a debug prompt."' Literal.String.Double '\n ' Text 'breakpoint\n' Name.Builtin 'end' Keyword '\n\n' Text '#\n' Comment '# Whenever a prompt is displayed, make sure that interactive\n' Comment '# mode-specific initializations have been performed.\n' Comment '# This handler removes itself after it is first called.\n' Comment '#\n' Comment 'function' Keyword ' ' Text '__fish_on_interactive' Text ' ' Text '--on-event' Text ' ' Text 'fish_prompt\n ' Name.Builtin '__fish_config_interactive' Text '\n ' Text 'functions' Name.Builtin ' ' Text '-e' Text ' ' Text '__fish_on_interactive' Text '\n' Text 'end' Keyword '\n' Text