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
yupgrade
(see./functions
directory) - 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
nodenv
installed] Initialize a Node environment using nodenv - [if
rbenv
installed] Initialize a Ruby environment using rbenv - [if
pyenv
installed] Initialize a Python environment using pyenv with virtualenv management (pyenv-virtualenv) - [if
go
installed] Set Go environment variables - [if
[email protected]
installed] Set environment variables and CLIs paths for [email protected]
You can install all these packages if you use brew as a packages manager:
brew install nodenv rbenv go pyenv pyenv-virtualenv [email protected]
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
fish
using brew by doingbrew install fish
. Then runfish
in your terminal to use thefish
shell. 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/fish
folder. This latter should already be present if you've installedfish
. You can also simply remove the original config folder andgit clone
like 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
)