`bobthefish` is a Powerline-style, Git-aware [fish][fish] theme optimized for awesome.
`bobthefish` is a Powerline-style, Git-aware [fish][btf-fish] theme optimized for awesome.
[![Oh My Fish](https://img.shields.io/badge/Framework-Oh_My_Fish-blue.svg?style=flat)](https://github.com/oh-my-fish/oh-my-fish) [![MIT License](https://img.shields.io/github/license/oh-my-fish/theme-bobthefish.svg?style=flat)](/LICENSE.md)
[![Oh My Fish](https://img.shields.io/badge/Framework-Oh_My_Fish-blue.svg?style=flat)](https://github.com/oh-my-fish/oh-my-fish) [![MIT License](https://img.shields.io/github/license/oh-my-fish/theme-bobthefish.svg?style=flat)](/LICENSE.md)
![bobthefish][screencast]
![bobthefish][btf-screencast]
### Installation
## Installation
Be sure to have Oh My Fish installed. Then just:
Be sure to have Oh My Fish installed. Then just:
omf install bobthefish
omf install bobthefish
You will need a [Powerline-patched font][patching] for this to work, unless you enable the compatibility fallback option:
You will need a [Powerline-patched font][btf-patching] for this to work, unless you enable the compatibility fallback option:
set -g theme_powerline_fonts no
set -g theme_powerline_fonts no
[I recommend picking one of these][fonts]. For more advanced awesome, install a [nerd fonts patched font][nerd-fonts], and enable nerd fonts support:
[I recommend picking one of these][btf-fonts]. For more advanced awesome, install a [nerd fonts patched font][btf-nerd-fonts], and enable nerd fonts support:
set -g theme_nerd_fonts yes
set -g theme_nerd_fonts yes
This theme is based loosely on [agnoster][agnoster].
This theme is based loosely on [agnoster][btf-agnoster].
### Features
## Features
* A helpful, but not too distracting, greeting.
* A helpful, but not too distracting, greeting.
* A subtle timestamp hanging out off to the right.
* A subtle timestamp hanging out off to the right.
@ -35,7 +37,8 @@ This theme is based loosely on [agnoster][agnoster].
* Visual indication that you can't write to the current directory.
* Visual indication that you can't write to the current directory.
### The Prompt
## The Prompt
* Status flags:
* Status flags:
* Previous command failed (**`!`**)
* Previous command failed (**`!`**)
@ -47,7 +50,7 @@ This theme is based loosely on [agnoster][agnoster].
* Current RVM, rbenv or chruby (Ruby) version
* Current RVM, rbenv or chruby (Ruby) version
* Current virtualenv (Python) version
* Current virtualenv (Python) version
* _If you use virtualenv, you will probably need to disable the default virtualenv prompt, since it doesn't play nice with fish: `set -x VIRTUAL_ENV_DISABLE_PROMPT 1`_
* _If you use virtualenv, you will probably need to disable the default virtualenv prompt, since it doesn't play nice with fish: `set -x VIRTUAL_ENV_DISABLE_PROMPT 1`_
* Current NVM version (Nodejs) (inactive by default; see configurations in the next paragraph)
* Current NVM/FNM version (Nodejs) (inactive by default; see configurations in the next paragraph)
* Abbreviated parent directory
* Abbreviated parent directory
* Current directory, or Git or Mercurial project name
* Current directory, or Git or Mercurial project name
* Current project's repo branch (<imgwidth="16"alt="branch-glyph"src="https://cloud.githubusercontent.com/assets/53660/8768360/53ee9b58-2e32-11e5-9977-cee0063936fa.png"> master) or detached head (`➦` d0dfd9b)
* Current project's repo branch (<imgwidth="16"alt="branch-glyph"src="https://cloud.githubusercontent.com/assets/53660/8768360/53ee9b58-2e32-11e5-9977-cee0063936fa.png"> master) or detached head (`➦` d0dfd9b)
@ -63,93 +66,236 @@ This theme is based loosely on [agnoster][agnoster].
* Abbreviated project-relative path
* Abbreviated project-relative path
### Configuration
You can override some of the following default options in your `config.fish`:
## Configuration
You can override theme defaults in a Fish config file (for example `~/.config/fish/conf.d/bobthefish.fish`):
```fish
```fish
set -g theme_display_git no
set -g theme_display_git_dirty no
set -g theme_display_git_untracked no
set -g theme_display_git_ahead_verbose yes
set -g theme_display_git_dirty_verbose yes
set -g theme_display_git_stashed_verbose yes
set -g theme_display_git_default_branch yes
set -g theme_git_default_branches master main
set -g theme_git_worktree_support yes
set -g theme_use_abbreviated_branch_name yes
set -g theme_display_vagrant yes
set -g theme_display_docker_machine no
set -g theme_display_k8s_context yes
set -g theme_display_hg yes
set -g theme_display_virtualenv no
set -g theme_display_nix no
set -g theme_display_ruby no
set -g theme_display_nvm yes
set -g theme_display_user ssh
set -g theme_display_hostname ssh
set -g theme_display_vi no
set -g theme_display_date no
set -g theme_display_cmd_duration yes
set -g theme_title_display_process yes
set -g theme_title_display_path no
set -g theme_title_display_user yes
set -g theme_title_use_abbreviated_path no
set -g theme_date_format "+%a %H:%M"
set -g theme_date_timezone America/Los_Angeles
set -g theme_avoid_ambiguous_glyphs yes
set -g theme_powerline_fonts no
set -g theme_nerd_fonts yes
set -g theme_nerd_fonts yes
set -g theme_show_exit_status yes
set -g theme_display_jobs_verbose yes
set -g default_user your_normal_user
set -g theme_color_scheme dark
set -g theme_color_scheme dark
set -g fish_prompt_pwd_dir_length 0
set -g theme_display_user ssh
set -g theme_project_dir_length 1
set -g default_user bobthecow
set -g theme_newline_cursor yes
set -g theme_newline_prompt '$ '
```
```
**Git options**
See (many) more options below.
- `theme_display_git_default_branch`. By default theme will hide/collapse the branch name in your prompt when you are using a Git _default branch_ i.e. historically `master` and often `main` now. Set to `yes` to stop these branches from being hidden/collapsed.
- `theme_git_default_branches`. The big cloud repos (GitHub, Bitbucket, GitLab et al.) are moving away from using `master` as the default branch name, and allow you to choose your own. As of version **2.28**, Git also supports custom default branch names via the `init.defaultBranch` config option. If our defaults of `master main` don't suit you, you can add/remove names in thist list i.e. `main trunk`. This ensures correct hiding/collapsing behaviour with custom default branch names (unless option above is activated).
**Title options**
### Prompt options
- `theme_title_display_process`. By default theme doesn't show current process name in terminal title. If you want to show it, just set to `yes`.
#### `set -g theme_display_vi yes`
- `theme_title_display_path`. Use `no` to hide current working directory from title.
- `theme_title_display_user`. Set to `yes` to show the current user in the tab title (unless you're the default user).
By default the vi mode indicator will be shown if vi or hybrid key bindings are enabled. Use `no` to always hide the indicator, or `yes` to always show the indicator.
- `theme_title_use_abbreviated_path`. Default is `yes`. This means your home directory will be displayed as `~` and `/usr/local` as `/u/local`. Set it to `no` if you prefer full paths in title.
#### `set -g theme_show_exit_status yes`
**Prompt options**
Use `yes` to show any non-zero exit code next to the exclamation mark.
- `theme_display_ruby`. Use `no` to completely hide all information about Ruby version. By default Ruby version displayed if there is the difference from default settings.
- `theme_display_nvm`. If set to `yes`, will display current NVM node version.
#### `set -g theme_display_jobs_verbose yes`
- `theme_display_vagrant`. This feature is disabled by default, use `yes` to display Vagrant status in your prompt. Please note that only the VirtualBox and VMWare providers are supported.
- `theme_display_vi`. By default the vi mode indicator will be shown if vi or hybrid key bindings are enabled. Use `no` to hide the indicator, or `yes` to show the indicator.
Use `yes` to display the number of currently running background jobs next to the percent sign.
- `theme_display_k8s_context`. This feature is disabled by default. Use `yes` to show the current kubernetes context (`> kubectl config current-context`).
- `theme_display_k8s_namespace`. This feature is disabled by default. Use `yes` to show the current kubernetes namespace.
#### `set -g theme_display_user yes`
- `theme_display_aws_vault_profile`. This feature is disabled by default. Use `yes` to show the currently executing [AWS Vault](https://github.com/99designs/aws-vault) profile.
- `theme_display_user`. If set to `yes`, display username always, if set to `ssh`, only when an SSH-Session is detected, if set to no, never.
Set to `yes` to always display the username, to `ssh` to display only when an SSH session is active, or to `no` to never display the username.
- `theme_display_hostname`. Same behaviour as `theme_display_user`.
- `theme_display_sudo_user`. If set to `yes`, displays the sudo-username in a root shell. For example, when calling `sudo -s` and having this option set to `yes`, the username of the user, who called `sudo -s`, will be displayed.
#### `set -g default_user your_normal_user`
- `theme_show_exit_status`. Set this option to `yes` to have the prompt show the last exit code if it was non_zero instead of just the exclamation mark.
- `theme_display_jobs_verbose`. If set to `yes` this option displays the number of currently running background jobs next to the percent sign.
If a `default_user` is provided, the username will only be shown when it differs from the default.
- `theme_git_worktree_support`. If you do any git worktree shenanigans, setting this to `yes` will fix incorrect project-relative path display. If you don't do any git worktree shenanigans, leave it disabled. It's faster this way :)
- `theme_use_abbreviated_branch_name`. Set to `yes` to truncate git branch names in the prompt.
#### `set -g theme_display_sudo_user yes`
- `fish_prompt_pwd_dir_length`. bobthefish respects the Fish `$fish_prompt_pwd_dir_length` setting to abbreviate the prompt path. Set to `0` to show the full path, `1` (default) to show only the first character of each parent directory name, or any other number to show up to that many characters.
- `theme_project_dir_length`. The same as `$fish_prompt_pwd_dir_length`, but for the path relative to the current project root. Defaults to `0`; set to any other number to show an abbreviated path.
If set to `yes`, displays the sudoer's username in a root shell. For example, when calling `sudo -s` with this option set to `yes`, the user who called `sudo -s` will be displayed.
- `theme_newline_cursor`. Use `yes` to have cursor start on a new line. By default the prompt is only one line. When working with long directories it may be preferrend to have cursor on the next line. Setting this to `clean` instead of `yes` suppresses the caret on the new line.
- `theme_newline_prompt`. Use a custom prompt with newline cursor. By default this is the chevron right glyph or `>` when powerline fonts are disabled.
#### `set -g theme_display_hostname yes`
**Color scheme options**
Set to `yes` to always display the hostname, to `ssh` to display only when an SSH session is active, or to `no` to never display the hostname.
Bobthefish respects the Fish `$fish_prompt_pwd_dir_length` setting to abbreviate the prompt path; set to `0` to show the full path, `1` (default) to show only the first character of each parent directory name, or any other number to show up to that many characters.
The same as `$fish_prompt_pwd_dir_length`, but for the path relative to the current project root. Defaults to `0`; set to any other number to show an abbreviated path.
#### `set -g theme_show_project_parent no`
Use `no` to only show the project directory name, and not its parent path, when inside a project.
#### `set -g theme_newline_cursor yes`
Use `yes` to place the cursor on the next line, rather than the same line as the prompt. Setting this to `clean` instead of `yes` suppresses the caret on the new line.
#### `set -g theme_newline_prompt "\$"`
Use a custom prompt with newline cursor. By default this is the chevron right glyph or `>` when powerline fonts are disabled.
#### `set -g theme_avoid_ambiguous_glyphs yes`
You probably don't need this option, unless your terminal doesn't like Unicode. Setting to `yes` will avoid ambiguous-width characters in an attempt to
#### `set -g theme_powerline_fonts no`
Bobthefish really likes Powerline-enhanced fonts. If you can't make that work, set to `no` to use plaintext fallbacks.
#### `set -g theme_nerd_fonts yes`
Bobthefish likes Nerd Fonts even better! Use `yes` if you've got Nerd Font capable fonts.
#### `set -g theme_color_scheme dark`
See below for all the color scheming you can handle.
### Virtual environments and version manager options
#### `set -g theme_display_vagrant yes`
This feature is disabled by default, use `yes` to display Vagrant status in your prompt. Please note that only the VirtualBox and VMWare providers are supported.
#### `set -g theme_display_docker_machine no`
Use `no` to disable the current Docker machine name.
#### `set -g theme_display_ruby no`
Use `no` to disable Ruby version information. By default, the Ruby version is displayed unless it's your system Ruby version.
#### `set -g theme_display_virtualenv no`
Use `no` to disable Python version information. By default, the Python version is shown when it's interesting, along with the Virtualenv or Conda environmenmt.
#### `set -g theme_display_go verbose`
Use `no` to disable the Go version information. Set to `verbose` to show both the required and current Go version.
#### `set -g theme_display_node yes`
This feature is disabled by default. Use `yes`, display the version if an `.nvmrc`, `.node-version` or `package.json` file is found in the parent path. Set to `always` to always display the current NPM, NVM or FNM node version.
#### `set -g theme_display_nix no`
Use `no` to disable Nix environment information.
#### `set -g theme_display_k8s_context yes`
This feature is disabled by default. Use `yes` to show the current Kubernetes context (`> kubectl config current-context`).
#### `set -g theme_display_k8s_namespace yes`
This feature is disabled by default. Use `yes` to show the current Kubernetes namespace.
#### `set -g theme_display_aws_vault_profile yes`
This feature is disabled by default. Use `yes` to show the currently executing [AWS Vault](https://github.com/99designs/aws-vault) profile.
### Git (and other VCS) options
#### `set -g theme_display_git no`
Use `no` to disable Git integration. If you're doing this for performance reasons, try some of the options below before disabling it entirely!
#### `set -g theme_display_git_dirty no`
Use `no` to hide Git dirty state. Set the Git `bash.showDirtyState` option on a per-repository basis to disable it just for especially large repos.
#### `set -g theme_display_git_dirty_verbose yes`
This feature is disabled by default. Use `yes` to show more verbose dirty state information.
#### `set -g theme_display_git_untracked no`
Use `no` to hide Git untracked file state. Set the Git `bash.showUntrackedFiles` option on a per-repository basis to disable it just for especially large repos.
#### `set -g theme_display_git_ahead_verbose yes`
This feature is disabled by default. Use `yes` to show more verbose ahead/behind state information.
By default, Bobthefish hides the default branch name (e.g. `main` or `master`). Use `yes` to always show these branche names.
#### `set -g theme_git_default_branches main trunk`
By default, Bobthefish hides default branch names (e.g. `main` or `master`). To hide other branch names, you can set a custom default branch name via the `init.defaultBranch` Git config option, or override the list entirely.
This feature is disabled by default. Use `yes` to truncate extremely long Git branch names.
#### `set -g theme_git_worktree_support yes`
If you do any Git worktree shenanigans, setting this to `yes` will fix incorrect project-relative paths. If you don't do any Git worktree shenanigans, leave it disabled. It's faster this way :)
#### `set -g theme_display_hg yes`
This feature is disabled by default. Use `yes` to enable Mercurial support in Bobthefish. If you don't use Mercurial, leave it disabled because it's ... not fast.
Supply a TZ argument variable for date formatting. See `man date` for more information.
#### `set -g theme_display_cmd_duration no`
Use `no` to disable command duration in the right prompt.
### Title options
#### `set -g theme_title_display_process yes`
This feature is disabled by default. Use `yes` to show current process name in the terminal title.
#### `set -g theme_title_display_path no`
Use `no` to hide current working directory from the terminal title.
#### `set -g theme_title_display_user yes`
Use `yes` to show the current user in the tab title (unless you're the default user).
#### `set -g theme_title_use_abbreviated_path no`
By default, directory names will be abbreviated in the terminal title, for example `~` instead of `$HOME` and `/u/local` instead of `/usr/local`. Set to `no` toalways show full paths in the title.
You can use the function `bobthefish_display_colors` to preview the prompts in
You can use the function `bobthefish_display_colors` to preview the prompts in
any color scheme.
any color scheme.
@ -164,7 +310,7 @@ one of the following options to change the prompt colors.
- `base16` (or `base16-dark`), `base16-light`. Dark and light variants of the
- `base16` (or `base16-dark`), `base16-light`. Dark and light variants of the
default Base16 theme.
default Base16 theme.
- `zenburn`. An adaptation of Zenburn.
- `zenburn`. An adaptation of Zenburn.
- `gruvbox`. An adaptation of gruvbox.
- `gruvbox`, `gruvbox-light`. An adaptation of gruvbox dark and light variants.
- `dracula`. An adaptation of dracula.
- `dracula`. An adaptation of dracula.
- `nord`. An adaptation of nord.
- `nord`. An adaptation of nord.
@ -201,10 +347,8 @@ variables to set the colors of the prompt. See the "Colors" section of
`fish_prompt.fish` for details.
`fish_prompt.fish` for details.
**VCS options**
- `set -g theme_vcs_ignore_paths /some/path /some/other/path{foo,bar}`. Ignore project paths for Git or Mercurial. Supports glob patterns.
### Overrides
## Overrides
You can disable the theme default greeting, vi mode prompt, right prompt, or title entirely— or override with your own — by adding custom functions to `~/.config/fish/functions`:
You can disable the theme default greeting, vi mode prompt, right prompt, or title entirely— or override with your own — by adding custom functions to `~/.config/fish/functions`:
# showing the prompt -- but plain (for'yes') or verbose?
if["$theme_display_go"="verbose"]
if["$actual_go_version" !="0"]
# show the prompt with the required version AND the currently available
# version;same color rules as above
echo-ns" ($actual_go_version)"
end
end
end
function__bobthefish_virtualenv_python_version-S-d'Get current Python version'
function__bobthefish_virtualenv_python_version-S-d'Get current Python version'
switch(python--version2>&1|tr'\n'' ')
switch(python--version2>&1|tr'\n'' ')
case'Python 2*PyPy*'
case'Python 2*PyPy*'
@ -860,14 +893,29 @@ function __bobthefish_virtualenv_python_version -S -d 'Get current Python versio
end
end
function__bobthefish_prompt_virtualfish-S-d"Display current Python virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself) or conda environment."
function__bobthefish_prompt_virtualfish-S-d"Display current Python virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself) or conda environment."