FISH

Why FISH?

  • Autosuggestions
  • Man Page Completions
  • Syntax Highlighting
  • Right arrow completion (history)
  • Pretty scripting language
  • Nice packages

Some Annoyances

  • Not BASH based (bass)
  • Different scripting language and config stuff

Package Managers

  • Oh My Fish (omf)
  • fisher
  • fundle

Fun FISH Functions

extract function

function extract --description "Extracts almost any file"
  set file $argv[1]
  if test -f $file
    switch $file
      case *.tar.bz2
        tar xvjf $file
      case *.tar.gz
        tar xvzf $file
      case *.tar.xz
        tar -xvf $file
      case *.bz2
        bunzip2 $file
      case *.rar
        unrar x $file
      case *.gz
        gunzip $file
      case *.tar
        tar xvf $file
      case *.tbz2
        tar xvjf $file
      case *.tgz
        tar xvzf $file
      case *.zip
        unzip $file
      case *.Z
        uncompress $file
      case *.7z
        7z x $file
      case '*'
        echo "'$file' cannot be extracted via >extract<"
    end
  else
    echo "'$file' is not a valid file!"
  end
end

On Login

function fish_greeting
  fortune | cowsay | lolcat
  if [ "$TERM" != "screen" ]; or [ -z $TMUX ]
    tmux a
    if [ $status -ne 0 ]
      tmux
    end
  end
end

tmux

.tmux.conf

# Bad to set to 0 (messes with other command stuff)
set -s escape-time 50

# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1

# Change split-window key bindings
bind | split-window -h
bind - split-window -v

# Set default Shell
set-option -g default-shell /usr/local/bin/fish

(neo)vi(m)

.vimrc

set number

syntax enable
filetype plugin indent on

" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4

Resources

  • https://fishshell.com/docs/current/tutorial.html
  • https://rootnroll.com/d/fish-shell/
  • https://asciinema.org/
  • https://github.com/oh-my-fish/oh-my-fish/blob/master/docs/Themes.md
  • https://github.com/jorgebucaran/fisher
  • https://github.com/jorgebucaran/awsm.fish
  • https://missing.csail.mit.edu/2020/course-shell/
  • https://missing.csail.mit.edu/2020/shell-tools/

fish

By Ethan Brouwer

fish

  • 94