mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2026-10-08 20:11:19 +00:00
Improve git prompt performance
This commit is contained in:
13
functions/__bobthefish_prompt_git_pwd.fish
Normal file
13
functions/__bobthefish_prompt_git_pwd.fish
Normal file
@@ -0,0 +1,13 @@
|
||||
function __bobthefish_prompt_git_pwd -S -a git_root_dir -a real_pwd -d 'Display the in-project path segment'
|
||||
set -l project_pwd (__bobthefish_project_pwd $git_root_dir $real_pwd)
|
||||
[ "$project_pwd" ]
|
||||
or return
|
||||
|
||||
if [ -w "$real_pwd" ]
|
||||
__bobthefish_start_segment $color_path
|
||||
else
|
||||
__bobthefish_start_segment $color_path_nowrite
|
||||
end
|
||||
|
||||
echo -ns $project_pwd ' '
|
||||
end
|
||||
Reference in New Issue
Block a user