Skip to content
Permalink
Browse files

[hot] manually check `path_pretty_redux.fish` for html linking

  • Loading branch information...
ipatch committed Aug 23, 2019
1 parent 1bc73b4 commit afec39f149a643a9e3c29e7d4ec976838581d4dc
Showing with 41 additions and 0 deletions.
  1. +41 −0 config/fish/functions/path_pretty_redux.fish
@@ -0,0 +1,41 @@
function path_pretty_redux --description 'print a pretty listing of the $PATH'
# https://github.com/fish-shell/fish-shell/issues/2639#issuecomment-301896209
# NOTE: the below cmd will split path entries on a ␣ `space` char thus falsely reporting the number of path entries
#
# echo $PATH | tr " " "\n" | nl
# NOTE: see above note
###

set -l p (echo $PATH[1..-1])

# DEBUG
# echo "$p"

set -l p_colon (echo "$p" | sed s'/\ \//:\//g; s/\ ~/:~/g; s/\ .:/:.:/g')

# NOTE: the above `sed` expression uses 3 seek and replace queries to place a `:` entires in the `p_colon` env var.

# DEBUG
# echo "================================================"

# DEBUG
# echo "$p_colon"

# DEBUG
# echo "================================================"

echo "$p_colon" | string split ":" | nl
echo "The above list are the ordered entries in the \$PATH"

echo "$fish_user_paths"
echo "The above list are the ordered entries in the \$fish_user_paths"

# NOTE: the above cmd will split the entries contained with the `p_colon` env var at the `:` char

####
# NOTE: removing entries from $PATH
##
# PATH entries can be removed with the below commands
# set --erase -g PATH[1]
# set -eg PATH[4]
end

0 comments on commit afec39f

Please sign in to comment.
You can’t perform that action at this time.