bobthefish Theme

repository·master·Indexed 23 days ago

https://github.com/oh-my-fish/theme-bobthefish

A highly configurable Powerline-style Fish shell theme providing a rich prompt with Git/VCS status, Kubernetes context, and environment information for Ruby, Python, and Node.js. It features multiple color schemes, Nerd Font support, and extensive customization options for prompt display, path handling, and terminal titles.

Tokens
3.2K
Snippets
6
Records
12
Agent score
31%

What's inside bobthefish

  1. Overview of bobthefish features

    master

    bobthefish is a Powerline-style, Git-aware fish theme. Key features include:

    • Visuals: Powerline-style segments, multiple color schemes, and a subtle timestamp on the right.
    • Path Handling: Abbreviated parent directories and project-relative paths that preserve the current project name.
    • Status Indicators: Visual cues for directory write permissions, command success/failure, and background jobs.
    • VCS Integration: Comprehensive Git and Mercurial status indicators (dirty, untracked, staged, stashed, etc.).
    • Environment Awareness: Displays Ruby (RVM, rbenv, chruby), Python (virtualenv), and Node.js (NVM, FNM) versions.
  2. Override or disable theme components via custom functions

    master

    You can disable or customize specific parts of the bobthefish theme by creating custom functions in your ~/.config/fish/functions directory. This allows you to completely remove a feature or replace the theme's default behavior with your own logic.

    Supported functions for overriding:

    • fish_greeting.fish: Controls the greeting message shown when starting a session.
    • fish_mode_prompt.fish: Controls the prompt behavior in vi mode.
    • fish_right_prompt.fish: Controls the right-hand side prompt.
    • fish_title.fish: Controls the terminal window title.

    To disable a component entirely, define the function with an empty body.

    # To disable the right prompt completely
    function fish_right_prompt; end
    
    # To override the greeting with a custom message
    function fish_greeting
      set_color $fish_color_autosuggestion
      echo "I'm completely operational, and all my circuits are functioning perfectly."
      set_color normal
    end
  3. Configure Python virtualenv prompt compatibility

    master

    If you use Python virtualenv, the default virtualenv prompt may conflict with the bobthefish prompt. To prevent display issues, disable the default virtualenv prompt by setting the VIRTUAL_ENV_DISABLE_PROMPT environment variable to 1:

    set -x VIRTUAL_ENV_DISABLE_PROMPT 1
  4. Configure bobthefish theme settings

    master

    You can override the theme's default behavior by setting global variables in your Fish configuration files (e.g., ~/.config/fish/conf.d/bobthefish.fish).

    Example configuration:

    set -g theme_nerd_fonts yes
    set -g theme_color_scheme dark
    set -g theme_display_user ssh
    set -g default_user bobthecow
  5. Configure Powerline and Nerd Font support

    master

    The bobthefish theme uses Powerline-style visuals. To ensure symbols render correctly, you should use a Powerline-patched font.

    If you do not have a Powerline font, you can disable the requirement using:

    set -g theme_powerline_fonts no

    For advanced usage with Nerd Fonts, install a Nerd Font and enable support in your fish configuration:

    set -g theme_nerd_fonts yes
  6. Configure virtual environments and version managers

    master

    Control the visibility of environment-specific information in the prompt:

    • theme_display_screen: Set to no to disable screen session info.
    • theme_display_vagrant: Set to yes to display Vagrant status (supports VirtualBox and VMWare).
    • theme_display_docker_machine: Set to no to disable the current Docker machine name.
    • theme_display_ruby: Set to no to disable Ruby version info.
    • theme_display_virtualenv: Set to no to disable Python version/Virtualenv/Conda info.
    • theme_display_go: Set to no to disable Go info, or verbose to show both required and current versions.
    • theme_display_node: Set to yes to show version if .nvmrc, .node-version, or package.json is found, or always to always show.
    • theme_display_nix: Set to no to disable Nix environment info.
    • theme_display_k8s_context: Set to yes to show the current Kubernetes context.
    • theme_display_k8s_namespace: Set to yes to show the current Kubernetes namespace.
    • theme_display_aws_vault_profile: Set to yes to show the active AWS Vault profile.
  7. Configure right prompt and title options

    master

    Right Prompt

    The right prompt can be customized via variables or by overriding the fish_right_prompt function:

    • theme_display_date: Set to no to disable the date.
    • theme_date_format: Customize date formatting (use date command syntax).
    • theme_date_timezone: Specify a TZ argument.
    • theme_display_cmd_duration: Set to no to disable command duration display.

    Terminal Title

    • theme_title_display_process: Set to yes to show the current process name in the terminal title.
    • theme_title_display_path: Set to no to hide the current working directory from the title.
    • theme_title_display_user: Set to yes to show the current user in the tab title.
    • theme_title_use_abbreviated_path: Set to no to always show full paths in the title.
  8. Configure prompt display options

    master

    Use the following global variables to customize the main prompt appearance:

    • theme_display_vi: Set to yes to always show the vi mode indicator, no to always hide it, or leave default (shows if vi/hybrid bindings are enabled).
    • theme_show_exit_status: Set to yes to show non-zero exit codes next to the exclamation mark.
    • theme_display_jobs_verbose: Set to yes to display the number of running background jobs.
    • theme_display_user: Set to yes (always), ssh (only during SSH sessions), or no (never).
    • default_user: Provide a username; the prompt will only show the user if it differs from this value.
    • theme_display_sudo_user: Set to yes to display the sudoer's username in a root shell.
    • theme_display_hostname: Set to yes (always), ssh (only during SSH sessions), or no (never).
    • fish_prompt_pwd_dir_length: Abbreviates the prompt path (0 for full path, 1 for first character of each parent directory).
    • theme_project_dir_length: Abbreviates the path relative to the current project root (defaults to 0).
    • theme_show_project_parent: Set to no to show only the project directory name, not its parent path.
    • theme_newline_cursor: Set to yes to place the cursor on a new line. Set to clean to suppress the caret on the new line.
    • theme_newline_prompt: Custom prompt string used when theme_newline_cursor is enabled (default is > or chevron).
    • theme_avoid_ambiguous_glyphs: Set to yes to avoid ambiguous-width characters for terminals with poor Unicode support.
    • theme_powerline_fonts: Set to no to use plaintext fallbacks if Powerline fonts are unavailable.
    • theme_nerd_fonts: Set to yes if using Nerd Fonts.
    • theme_color_scheme: Set the color palette (see Color Schemes).
  9. Configure Git and VCS options

    master

    Customize Version Control System (VCS) integration:

    • theme_display_git: Set to no to disable Git integration.
    • theme_display_git_dirty: Set to no to hide dirty state.
    • theme_display_git_dirty_verbose: Set to yes to show more detailed dirty state.
    • theme_display_git_untracked: Set to no to hide untracked file state.
    • theme_display_git_ahead_verbose: Set to yes to show more detailed ahead/behind state.
    • theme_display_git_stashed_verbose: Set to yes to show more detailed stashed state.
    • theme_display_git_default_branch: Set to yes to always show default branch names (e.g., main, master).
    • theme_git_default_branches: Override the list of default branches (e.g., set -g theme_git_default_branches main trunk).
    • theme_use_abbreviated_branch_name: Set to yes to truncate long branch names.
    • theme_git_worktree_support: Set to yes to fix incorrect project-relative paths when using Git worktrees.
    • theme_display_hg: Set to yes to enable Mercurial support.
    • theme_display_fossil: Set to yes to enable Fossil support.
    • theme_vcs_ignore_paths: A list of paths (supporting glob patterns) to ignore for Git or Mercurial.
  10. Create a custom color scheme

    master

    To override specific colors, define a bobthefish_colors function in your configuration. You can optionally call ___bobthefish_colors default to inherit a base scheme before overriding specific segments using set -x.

    Example of overriding specific colors:

    function bobthefish_colors -S -d 'Define a custom bobthefish color scheme'
      ___bobthefish_colors default
    
      set -x color_initial_segment_exit     ffffff ce000f --bold
      set -x color_path                     333333 999999
      set -x color_repo                     addc10 0c4801
      # ... other color overrides
    end
    function bobthefish_colors -S -d 'Define a custom bobthefish color scheme'
    
      # optionally include a base color scheme...
      ___bobthefish_colors default
    
      # then override everything you want! note that these must be defined with `set -x`
      set -x color_initial_segment_exit     ffffff ce000f --bold
      set -x color_initial_segment_private  ffffff 255e87
      set -x color_initial_segment_su       ffffff 189303 --bold
      set -x color_initial_segment_jobs     ffffff 255e87 --bold
      set -x color_path                     333333 999999
      set -x color_path_basename            333333 ffffff --bold
      set -x color_path_nowrite             660000 cc9999
      set -x color_path_nowrite_basename    660000 cc9999 --bold
      set -x color_repo                     addc10 0c4801
      set -x color_repo_work_tree           333333 ffffff --bold
      set -x color_repo_dirty               ce000f ffffff
      set -x color_repo_staged              f6b117 3a2a03
      set -x color_vi_mode_default          999999 333333 --bold
      set -x color_vi_mode_insert           189303 333333 --bold
      set -x color_vi_mode_visual           f6b117 3a2a03 --bold
      set -x color_vagrant                  48b4fb ffffff --bold
      set -x color_aws_vault
      set -x color_aws_vault_expired
      set -x color_username                 cccccc 255e87 --bold
      set -x color_hostname                 cccccc 255e87
      set -x color_rvm                      af0000 cccccc --bold
      set -x color_virtualfish              005faf cccccc --bold
      set -x color_virtualgo                005faf cccccc --bold
      set -x color_desk                     005faf cccccc --bold
      set -x color_nix                      005faf cccccc --bold
    end
  11. Select a color scheme

    master

    Set theme_color_scheme to change the prompt colors.

    Available Schemes:

    • dark (default), light
    • solarized, solarized-dark, solarized-light
    • base16, base16-dark, base16-light
    • zenburn
    • gruvbox, gruvbox-light
    • dracula
    • nord
    • catpuccin-latte, catpuccin-frappe, catpuccin-macchiato, catpuccin-mocha

    Terminal-Adaptive Schemes: If your terminal doesn't support 24-bit color, use terminal schemes which adapt to your terminal's 16 colors:

    • terminal, terminal-dark, terminal-dark-black, terminal-dark-white
    • terminal-light, terminal-light-white, terminal-light-black
    • terminal2 variants (uses bright black/grey for better visibility in some themes).