My personal fish prompt configuration. I prefer it on a black background but it can fit with other background colors.
Screenshots made using iTerm2 app (not from the OS X Terminal app)
Mainly:
- Prompt using two lines
- Custom Git prompt using a nerdfont
- Add custom aliases for git and some CLIs with private aliases
- Add some useful functions like
pupgrade(see./functionsdirectory) - Handle environment configuration when needed (see the environments part)
- Handle private/local aliases, environment or configuration (see the private/local configuration part)
This configuration handle some environments if it found the related command (see ./env directory):
- [if
nodenvinstalled] Initialize a Node environment using nodenv - [if
bunenvinstalled] Initialize a Ruby environment using rbenv - [if
rbenvinstalled] Initialize a Ruby environment using rbenv - [if
pyenvinstalled] Initialize a Python environment using pyenv with virtualenv management (pyenv-virtualenv) - [if
goinstalled] Set Go environment variables - [if
[email protected]installed] Set environment variables and CLIs paths for [email protected] - [if
pnpminstalled] Set the$PNPM_HOMEenvironment variable for pnpm global binaries and packages
You can install all these packages if you use brew as a packages manager:
brew install nodenv jonathanphilippou/tap/bunenv rbenv go pyenv pyenv-virtualenv [email protected] pnpm
You can add private/local only configurations/environments/aliases if you need to. Just add a private.fish which will be ignored by git and won't be commited:
- in the root folder for a private fish configuration
- in the
env/folder for a private environment set up - in the
aliases/folder for private aliases
-
If it's not done yet, install
fishusing brew by doingbrew install fish. Then runfishin your terminal to use thefishshell. This configuration need a recent fish version (v3.1+). -
Install the nerdfont of your choice and use it in your terminal. As the prompt will use some special characters from these fonts, you will need it if you want to have all icons.
-
Put all the config files and folders (this repository content) in your
~/.config/fishfolder. This latter should already be present if you've installedfish. You can also simply remove the original config folder andgit clonelike following:mv ~/.config/fish /tmp/ git clone https://github.com/CPatchane/config-fish.git ~/.config/fish -
Load your config by doing
source ~/.config/fish(it should be run by default when opening a new shell withfish)

