bobthefish
is a Powerline-style, Git-aware fish theme optimized for awesome.
Be sure to have Oh My Fish installed. Then just:
omf install bobthefish
You will need a Powerline-patched font for this to work, unless you enable the compatibility fallback option:
set -g btf_powerline_fonts no
I recommend picking one of these. For more advanced awesome, install a nerd fonts patched font, and enable nerd fonts support:
set -g btf_nerd_fonts yes
This theme is based loosely on agnoster.
- A helpful, but not too distracting, greeting.
- A subtle timestamp hanging out off to the right.
- Powerline-style visual hotness.
- More colors than you know what to do with.
- An abbreviated path which doesn't abbreviate the name of the current project.
- All the things you need to know about Git in a glance.
- Visual indication that you can't write to the current directory.
- Flags:
- Previous command failed (
!
) - Background jobs (
%
) - You currently have superpowers (
$
) - Cursor on newline
- Previous command failed (
- Current vi mode
User@Host
(unless you're the default user)- Current RVM, rbenv or chruby (Ruby) 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:
- Abbreviated parent directory
- Current directory, or Git or Mercurial project name
- Current project's repo branch ( master) or detached head (
➦
d0dfd9b) - Git or Mercurial status, via colors and flags:
- Dirty working directory (
*
) - Untracked files (
…
) - Staged changes (
~
) - Stashed changes (
$
) - Unpulled commits (
-
) - Unpushed commits (
+
) - Unpulled and unpushed commits (
±
) - Note that not all of these have been implemented for hg yet :)
- Dirty working directory (
- Abbreviated project-relative path
You can override some of the following default options in your config.fish
:
set -g btf_title_display_process yes
set -g btf_title_display_path no
set -g btf_title_display_user yes
set -g btf_title_use_abbreviated_path no
set -g btf_date_format "+%a %H:%M"
set -g btf_avoid_ambiguous_glyphs yes
set -g btf_powerline_fonts no
set -g btf_nerd_fonts yes
set -g btf_prompt_status_show_exit_status yes
set -g default_user your_normal_user
set -g btf_color_scheme dark
set -g fish_prompt_pwd_dir_length 0
set -g btf_prompt_vcs_project_dir_length 1
set -g btf_newline_prompt '$ '
Title options
btf_title_display_process
- By default theme doesn't show current process name in terminal title. If you want to show it, just set toyes
.btf_title_display_path
- Useno
to hide current working directory from title.btf_title_display_user
- Set toyes
to show the current user in the tab title (unless you're the default user).btf_title_use_abbreviated_path
- Default isyes
. This means your home directory will be displayed as~
and/usr/local
as/u/local
. Set it tono
if you prefer full paths in title.
Prompt options
btf_left_prompts
- Define the prompt segments that will appear in the left prompt.btf_right_prompts
- Define the prompt segments that will appear in the right prompt.btf_right_colorized
- Set toyes
to enable colorized segments of the right prompt.btf_newline_prompt
- Use a custom prompt with newline cursor. By default this is the chevron right glyph or>
when powerline fonts are disabled.btf_date_format
- Use a custom format when printing dates.fish_prompt_pwd_dir_length
- bobthefish respects the Fish$fish_prompt_pwd_dir_length
setting to abbreviate the prompt path. Set to0
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.
Color scheme options
You can use the function bobthefish_display_colors
to preview the prompts in
any color scheme.
Set btf_color_scheme
in a terminal session or in your fish startup files to
one of the following options to change the prompt colors.
dark
- The default bobthefish theme.light
- A lighter version of the default theme.solarized
(orsolarized-dark
),solarized-light
- Dark and light variants of Solarized.base16
(orbase16-dark
),base16-light
- Dark and light variants of the default Base16 theme.zenburn
- An adaptation of Zenburn.gruvbox
- An adaptation of gruvbox.dracula
- An adaptation of dracula.
Some of these may not look right if your terminal does not support 24 bit color,
in which case you can try one of the terminal
schemes (below). However, if
you're using Solarized, Base16 (default), or Zenburn in your terminal and the
terminal does support 24 bit color, the built in schemes will look nicer.
There are several scheme that use whichever colors you currently have loaded into your terminal. The advantage of using the schemes that fall through to the terminal colors is that they automatically adapt to something acceptable whenever you change the 16 colors in your terminal profile.
terminal
(orterminal-dark
orterminal-dark-black
)terminal-dark-white
- Same asterminal
, but use white as the foreground color on top of colored segments (in case your colors are very dark).terminal-light
(orterminal-light-white
)terminal-light-black
- Same asterminal-light
, but use black as the foreground color on top of colored segments (in case your colors are very bright).
For some terminal themes, like dark base16 themes, the path segments in the
prompt will be indistinguishable from the background. In those cases, try one of
the following variations; they are identical to the terminal
schemes except
for using bright black (brgrey
) and dull white (grey
) in the place of black
and bright white.
terminal2
(orterminal2-dark
orterminal2-dark-black
)terminal2-dark-white
terminal2-light
(orterminal2-light-white
)terminal2-light-black
Finally, you can specify your very own color scheme by setting
btf_color_scheme
to user
. In that case, you also need to define some
variables to set the colors of the prompt. See the "Colors" section of
fish_prompt.fish
for details.
VCS (VCS/Git/Hg)
btf_prompt_vcs_ignore_paths /some/path /some/other/path{foo,bar}
- Ignore project paths for Git or Mercurial. Supports glob patterns.btf_prompt_vcs_project_dir_length
- The same as$fish_prompt_pwd_dir_length
, but for the path relative to the current project root. Defaults to0
; set to any other number to show an abbreviated path.btf_prompt_git_worktree_support
- If you do any git worktree shenanigans, setting this toyes
will fix incorrect project-relative path display. If you don't do any git worktree shenanigans, leave it disabled. It's faster this way :)btf_prompt_git_dirty
(defaultyes
) -btf_prompt_git_untracked
(defaultyes
) -btf_prompt_git_ahead_verbose
(defaultno
) -btf_prompt_git_dirty_verbose
(defaultno
) -btf_prompt_git_master_branch
(defaultno
) -btf_prompt_git_worktree_support
(defaultno
) -
status
btf_prompt_status_show_exit_status
- Set this option toyes
to have the prompt show the last exit code if it was non_zero instead of just the exclamation mark.
ruby
Displays information about the current Ruby version
vagrant (disabled by default)
Display information about the Vagrant status of the current project.
Please note that only the VirtualBox and VMWare providers are supported.
vi
Display a vi mode indicator if vi or hybrid key bindings are enabled.
btf_prompt_vi_always
- Set toyes
to always show this segment.
k8s_context (disabled by default)
Shows the current kubernetes context (> kubectl config current-context
).
user
If set to yes
, display username always, if set to ssh
, only when an SSH-Session is detected, if set to no
, never.
hostname
Same behaviour as theme_display
.
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
:
~/.config/fish/functions/fish_greeting.fish
~/.config/fish/functions/fish_mode_prompt.fish
~/.config/fish/functions/fish_right_prompt.fish
~/.config/fish/functions/fish_title.fish
To disable them completely, use an empty function:
function fish_right_prompt; end
… Or copy one from your favorite theme, make up something of your own, or copy/paste a bobthefish default function and modify it to your taste!
function fish_greeting
set_color $fish_color_autosuggestion
echo "I'm completely operational, and all my circuits are functioning perfectly."
set_color normal
end