Skip to content

Latest commit

 

History

History
83 lines (48 loc) · 2.06 KB

prompt.md

File metadata and controls

83 lines (48 loc) · 2.06 KB

⚙ Prompt sequences

📝 contrib/prompt-vim-mode

Source: prompt-vim-mode.bash

Prompt sequence \q{contrib/vim-mode}

This prompt sequence expands to the vim mode name.

# blerc (example)

ble-import contrib/prompt-vim-mode
PS1='[\u@\h \W]\q{contrib/vim-mode}\$ ' # show mode name in PS1
bleopt keymap_vi_mode_show:=            # hide mode line

📝 contrib/prompt-git

Source: prompt-git.bash

# blerc (example)

ble-import contrib/prompt-git
bleopt prompt_rps1='\q{contrib/git-info}'

Prompt sequence \q{contrib/git-info}

This expands to a string that explains the current git status.

Prompt sequence \q{contrib/git-name}

This expands to the directory name of the repository.

Prompt sequence \q{contrib/git-hash N}

This expands to the commit hash. The hash is truncated to the length N. The default value for N is 7.

Prompt sequence \q{contrib/git-branch}

This expands to the branch name (or tag name or hash) of HEAD.

Prompt sequence \q{contrib/git-path}

This expands to the current path relative to the root directory of the repository.

📝 contrib/prompt-elapsed

Source: prompt-elapsed.bash

Measures the time of the previous command execution.

# blerc (example)

ble-import contrib/prompt-elapsed
bleopt prompt_rps1='\g{fg=69,italic}\q{contrib/elapsed}'

Prompt sequence \q{contrib/elapsed}

This expands to the high-resolution elapsed time for the command execution.

Prompt sequence \q{contrib/elapsed-real}

This expands to the real time of time.

Prompt sequence \q{contrib/elapsed-user}

This expands to the user time of time.

Prompt sequence \q{contrib/elapsed-sys}

This expands to the sys time of time.

Prompt sequence \q{contrib/elapsed-cpu}

This expands to the average cpu usage.