3.8 KiB
syl20bnr theme
Sylvain Benner personal, compact (hmmm...) yet complete (almost :-)) oh-my-fish theme.
Table of Contents generated with DocToc
Segments
pwd: Compact current working directory
The pwd
segment format is X:P(N)
where:
X
is eitherhome
or/
P
is the current working path base name (name of the current directory)N
is the depth of the path starting fromX
If the pwd
is home
or /
then the prompt format is simplified to home
and /
respectively without the current directory and depth.
Examples
git
If the current directory is a git repository then the pwd
segment is
replaced by the git
segment (I should know where I am).
The git
segment format is X:YI@Z:P(N)
where:
X
isgit
Y
is the current branch nameI
is the information about the current repository stateZ
is the name of the repositoryP
is the current working path basename (name of the current directory) IfP
=Z
thenP(N)
is not displayedN
is the depth of the path starting from base directory of the repository
The displayed information I
is:
- Dirtiness is indicated by a little dot after the branch name.
- Unpushed commits are indicated with up arrows
- The number of unpushed commits is indicated right after the up arrows
Examples
In a sub-directory of the repository:
vi-mode
This segment display the current vi-mode
if the plugin is used.
See the [n]
in the previous screenshots.
end
The color of the end of the prompt depends on the $status
value of the
last executed command. It is green
or red
depending on the success or
failure of the last command.
Since I often use ranger and its shift+s
key binding to bring
a new child shell session, there is a discreet indicator when the parent
process of the current shell is a ranger
process: the end of the prompt
is written twice (ie: >>
instead of just >
).
With this indicator I quickly see if I can ctrl+d
to end the current shell
process and go back to the parent ranger
process.
where
The where
segment format is X@Y
where:
X
is the user nameY
is the host name
This segment is displayed in the right prompt.
Functions
Some functions come with the theme:
toggle_right_prompt
will... toggle the right prompt! (alias:trp
)
Cygwin compatibility
In order to make this theme work on Cygwin, make sure to install the following packages:
bc
formath
fish functionpsmisc
forpstree
git
if you want to use thegit
segment.