Skip to content

Instantly share code, notes, and snippets.

@pseudo-su
Last active January 20, 2020 13:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pseudo-su/35524911d93b772ac9ddb39542978210 to your computer and use it in GitHub Desktop.
Save pseudo-su/35524911d93b772ac9ddb39542978210 to your computer and use it in GitHub Desktop.

My Terminal config

Author: John Stableford

Date: 31/07/2019

Overview

  • Kitty terminal emulator link

  • Solarized Dark Terminal theme

  • PragmataPro font w/ ligatures

  • Fish shell link

  • Oh My Fish plugin manager link

  • Starship cross-platform shell prompt link

Kitty setup

Install: curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin

Kitty config file (~/.config/kitty/kitty.conf)

conf
font_family      PragmataPro Mono Liga
bold_font        auto
italic_font      auto
bold_italic_font auto

font_size 16.0

remember_window_size  yes

draw_minimal_borders yes
editor code
clipboard_control write-clipboard write-primary
macos_quit_when_last_window_closed yes

# Color theme

background_opacity 0.9

background              #002b36
foreground              #839496
cursor                  #93a1a1

selection_background    #81908f
selection_foreground    #002831

color0                  #073642
color1                  #dc322f
color2                  #859900
color3                  #b58900
color4                  #268bd2
color5                  #d33682
color6                  #2aa198
color7                  #eee8d5
color9                  #cb4b16
color8                  #002b36
color10                 #586e75
color11                 #657b83
color12                 #839496
color13                 #6c71c4
color14                 #93a1a1
color15                 #fdf6e3

Fish setup

Install Fish: brew install fish

Install Starship: cargo install starship

Fish configuration structure

Fish config lives in ~/.config/fish

  • ~/.config/fish/conf.d/*.fish are implicitly sourced before config.fish is loaded

  • ~/.config/fish/config.fish Gets loaded on initialization

  • ~/.config/fish/functions/*.fish are also implicitly loaded by fish if the function/filename match

My \*.fish Files

Files:

├── conf.d
│   ├── _sdkman.fish
│   ├── adobe.fish
│   ├── dynamo.fish
│   ├── docker.fish
│   ├── nvm.fish
│   └── omf.fish
├── config.fish
└── functions/

config.fish

set -g -x PATH /usr/local/bin $PATH
set fish_greeting ""

# marlin comma completion filter
set -g FILTER ''

# Shortcuts
alias fishconfig "code ~/.config/fish"
alias vimconfig "code ~/.config/nvim"
alias termconfig "code ~/.config/alacritty"

# Projects folder
alias cdp "cd ~/Development/Projects"

# Playground folder
alias cdpg "cd ~/Development/Playground"

# Cheeky unix tool aliases
# alias grep "rg"
alias ls "exa"
alias vim "nvim"

# JAVA
sdk use java 8.0.212-amzn > /dev/null

# Golang Setup
set -gx PATH $GOBIN $PATH

# Rust setup
set -gx PATH "/Users/johnstableford/.cargo/bin" $PATH

# Starship prompt
eval (starship init fish)

init.d/nvm.fish (auto-load correct node version when chaning into nodejs projects)

function __check_nvm --on-variable PWD --description 'Do nvm stuff'
  nvm use > /dev/null
end

__check_nvm

init.d/_sdkman.fish (load sdkman before omf.fish)

set -g SDKMAN_DIR "/Users/johnstableford/.sdkman"

init.d/git.fish

alias gdiffd 'git difftool --no-symlinks --dir-diff'
alias gdiff 'kitty +kitten diff'

Oh My Fish Plugins

Install: curl -L https://get.oh-my.fish | fish

Note
In order to use omf with starship you need to switch to the pure theme instead of the default
omf install pure
omf theme pure

I use the following plugins (omf install <pluginname>):

Built-in (I think)

  • fish-spec: built in test utils

  • omf: built in oh-my-fish CLI

  • expand

Very Useful

  • 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

Less important but useful

  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment