Skip to content

Commit a98b2af

Browse files
committed
Add instructions for setting the command prompt in the fish shell
In addition to those for bash
1 parent 019c115 commit a98b2af

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ $ git edit-coauthor bb --name="Barry Butterworth"
177177
$ git edit-coauthor bb --email="barry@butterworth.org"
178178
```
179179

180-
### Add initials of current mob to `PS1`, in `~/.bashrc`
180+
### Add initials of current mob to your prompt
181+
182+
#### Bash
183+
184+
Add the initials to `PS1`, in `~/.bashrc`
181185

182186
```bash
183187
function git_initials {
@@ -190,6 +194,23 @@ function git_initials {
190194
export PS1="\$(pwd)\$(git_initials) -> "
191195
```
192196

197+
#### Fish
198+
199+
Add the following functions to `.config/fish/config.fish`
200+
201+
```fish
202+
function git_initials --description 'Print the initials for who I am currently pairing with'
203+
set -lx initials (git mob-print --initials)
204+
if test -n "$initials"
205+
printf ' [%s]' $initials
206+
end
207+
end
208+
209+
function fish_prompt
210+
printf "%s%s ->" (pwd) (git_initials)
211+
end
212+
```
213+
193214
<sup>\* [If you have git-duet installed, you'll need to uninstall it](https://github.com/findmypast-oss/git-mob/issues/2) since it conflicts with the git-solo command.</sup>
194215

195216
Find out more with `git mob --help`

0 commit comments

Comments
 (0)