Add fish config
This commit is contained in:
parent
c4af1c28aa
commit
f1d4f3fd36
16 changed files with 215 additions and 0 deletions
16
config/fish/functions/prompt_pwd.fish
Normal file
16
config/fish/functions/prompt_pwd.fish
Normal file
|
@ -0,0 +1,16 @@
|
|||
function prompt_pwd --description 'Print the current working directory'
|
||||
set -l options 'h/help'
|
||||
argparse -n prompt_pwd --max-args=0 $options -- $argv
|
||||
or return
|
||||
|
||||
if set -q _flag_help
|
||||
__fish_print_help prompt_pwd
|
||||
return 0
|
||||
end
|
||||
|
||||
# Replace $HOME with "~"
|
||||
set realhome ~
|
||||
set -l tmp (string replace -r '^'"$realhome"'($|/)' '~$1' $PWD)
|
||||
|
||||
basename $tmp
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue