Skip to content

Dynamic bleopt prompt_rps1 #503

Answered by akinomyoga
Strykar asked this question in Q&A
Discussion options

You must be logged in to vote

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 using contrib/prompt-git:

# 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
    # I…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Strykar
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@akinomyoga
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants