mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2025-06-13 13:03:54 +00:00
Adding directory toggle for prompt
Budspencer sytle PWD toggle
This commit is contained in:
parent
73b3bd0ea3
commit
41f6e47c03
3
bobthefish_keymapping.fish
Normal file
3
bobthefish_keymapping.fish
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
function fish_user_key_bindings
|
||||||
|
bind ' ' __bobthefish_dir_length # toggle PWD on NORMAL with `space bar`
|
||||||
|
end
|
@ -51,6 +51,16 @@
|
|||||||
# and command hg stat > /dev/null ^&1
|
# and command hg stat > /dev/null ^&1
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
function __bobthefish_dir_length -d "Toggle Directory length in prompt"
|
||||||
|
set -q fish_prompt_pwd_dir_length; or set -l fish_prompt_pwd_dir_length 0
|
||||||
|
if [ $fish_prompt_pwd_dir_length -eq 0 ]
|
||||||
|
set -U fish_prompt_pwd_dir_length 1
|
||||||
|
else
|
||||||
|
set -U fish_prompt_pwd_dir_length 0
|
||||||
|
end
|
||||||
|
commandline -f repaint
|
||||||
|
end
|
||||||
|
|
||||||
function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)'
|
function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)'
|
||||||
set -l ref (command git symbolic-ref HEAD ^/dev/null)
|
set -l ref (command git symbolic-ref HEAD ^/dev/null)
|
||||||
and echo $ref | sed "s#refs/heads/#$__bobthefish_branch_glyph #"
|
and echo $ref | sed "s#refs/heads/#$__bobthefish_branch_glyph #"
|
||||||
|
Loading…
Reference in New Issue
Block a user