Author: John Stableford
Date: 11/07/2018
- iTerm terminal emulator link
- Solarized Dark Terminal theme
- PragmataPro font w/ ligatures
- Fish shell link
- Oh My Fish plugin manager link
- Color theme
- Set font
- Enable font ligatures
Install: brew install fish
Fish config lives in ~/.config/fish
~/.config/fish/config.fish
Gets loaded on initialization~/.config/fish/functions/*.fish
are also implicitly loaded by fish if the function/filename match
Files:
├── conf.d
│ └── omf.fish
├── config.fish
├── functions
│ └── fish_prompt.fish
└── my-config
├── helpers
│ ├── adobe.fish
│ ├── docker.fish
│ └── dynamo.fish
├── init-general.fish
└── watch-nvm.fish
config.fish
set -l fish_config_location (dirname (status -f))
# source $fish_config_location/my-config/helpers/adobe.fish
# source $fish_config_location/my-config/helpers/docker.fish
# source $fish_config_location/my-config/helpers/dynamo.fish
source $fish_config_location/my-config/init-general.fish
source $fish_config_location/my-config/watch-nvm.fish
init-general.fish
set fish_greeting ""
set -g -x PATH /usr/local/bin $PATH
alias fishconfig "code ~/.config/fish"
alias vimconfig "code ~/.config/nvim"
# marlin comma completion filter
set -g FILTER ''
# Flutter setup
set -gx PATH "~/Development/tools/flutter/bin" $PATH
# Projects folder
alias cdp "cd ~/Development/Projects"
alias cdpd "cd ~/Development/Projects/DigIO"
alias cdpp "cd ~/Development/Projects/Punters"
watch-nvm.fish
function __check_nvm --on-variable PWD --description 'Do nvm stuff'
nvm use > /dev/null
end
__check_nvm
functions/fish_prompt.sh (taken and modified from somewhere at some point)
function fish_prompt -d 'Write out the prompt'
set -l last_status $status
# Just calculate this once, to save a few cycles when displaying the prompt
if not set -q __fish_prompt_hostname
set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
end
set -l normal (set_color normal)
# Hack; fish_config only copies the fish_prompt function (see #736)
if not set -q -g __fish_classic_git_functions_defined
set -g __fish_classic_git_functions_defined
function __fish_repaint_user --on-variable fish_color_user -d "Event handler, repaint when fish_color_user changes"
if status --is-interactive
commandline -f repaint ^/dev/null
end
end
function __fish_repaint_host --on-variable fish_color_host -d "Event handler, repaint when fish_color_host changes"
if status --is-interactive
commandline -f repaint ^/dev/null
end
end
function __fish_repaint_status --on-variable fish_color_status -d "Event handler; repaint when fish_color_status changes"
if status --is-interactive
commandline -f repaint ^/dev/null
end
end
function __fish_repaint_bind_mode --on-variable fish_key_bindings -d "Event handler; repaint when fish_key_bindings changes"
if status --is-interactive
commandline -f repaint ^/dev/null
end
end
# initialize our new variables
if not set -q __fish_classic_git_prompt_initialized
set -qU fish_color_user; or set -U fish_color_user -o green
set -qU fish_color_host; or set -U fish_color_host -o cyan
set -qU fish_color_status; or set -U fish_color_status red
set -U __fish_classic_git_prompt_initialized
end
end
set -l color_cwd
set -l prefix
switch $USER
case root toor
if set -q fish_color_cwd_root
set color_cwd $fish_color_cwd_root
else
set color_cwd $fish_color_cwd
end
set suffix '#'
case '*'
set color_cwd $fish_color_cwd
set suffix '>'
end
set -l prompt_status
if test $last_status -ne 0
set prompt_status ' ' (set_color $fish_color_status) "[$last_status]" "$normal"
end
set -l mode_str
switch "$fish_key_bindings"
case '*_vi_*' '*_vi'
# possibly fish_vi_key_bindings, or custom key bindings
# that includes the name "vi"
set mode_str (
echo -n " "
switch $fish_bind_mode
case default
set_color --bold --background red white
echo -n "[N]"
case insert
set_color --bold green
echo -n "[I]"
case visual
set_color --bold magenta
echo -n "[V]"
end
set_color normal
)
end
echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $fish_color_host) "$__fish_prompt_hostname" $normal ' ' (set_color $color_cwd) (prompt_pwd) $normal (__fish_git_prompt) $normal $prompt_status "$mode_str" " -> "
end
List of other potentially useful things
Install: curl -L https://get.oh-my.fish | fish
I use the following plugins (omf install <pluginname>
):
- fish-spec: built in test utils
- omf: built in oh-my-fish CLI
- expand
- nvm: Node version manager wrapper for Fish shell
- marlin: comma based based autocompletion from history
- export: simulate bash
export
- foreign-env: Run foreign bash scripts and capture exported environment variables
- fuck: similar to
sudo !!
- osx: some osx utils
- yarn-binpath: make yarn cli work
- battery: look at the battery
- wifi-password: get the wifi password that you're currently connected to