Dynamic bleopt prompt_rps1 #503
-
Hi, how can I can get the RPS to show me (full path cwd) of non-git directory on the right side and show git details only when inside a git repo directory?
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
You can define your own prompt sequence as described in §4.13.2. For the specific setup of switching between the current working directory and the git information based on the current directory, Recipe 4 actually provides an example. Recipe 4 implements the git information by itself, but this example is old. We now have a module # blerc
ble-import contrib/prompt-git
function ble/prompt/backslash:Strykar/git-info {
local "${_ble_contrib_prompt_git_vars[@]/%/=}"
if ble/contrib/prompt-git/initialize; then
# Inside a git repository
ble/prompt/process-prompt-string '\q{contrib/git-info}'
else
# In a non-git directory
ble/prompt/process-prompt-string '\w'
fi
}
bleopt prompt_rps1='\q{Strykar/git-info}' |
Beta Was this translation helpful? Give feedback.
-
Thank you so much! IMO, the example should be updated with your's above. Now I can free |
Beta Was this translation helpful? Give feedback.
-
@akinomyoga One last request, could the example be updated to use symbols for even more git information, like:
Possible for RPS to be shown in Powerline style? |
Beta Was this translation helpful? Give feedback.
You can define your own prompt sequence as described in §4.13.2. For the specific setup of switching between the current working directory and the git information based on the current directory, Recipe 4 actually provides an example. Recipe 4 implements the git information by itself, but this example is old. We now have a module
contrib/prompt-git
, so one can set it up more easily usingcontrib/prompt-git
: