Commits

j committed 596fcea

Install fish as default shell with minimal config

Comments (0)

Files changed (4)

+syntax: glob
+
+fish/completions
+fish/fish_history
+fish/fishd*
         test -L "$PROJECTS_HOME" || ln -s "$HOME/Dropbox/Projects" "$PROJECTS_HOME"
         test -L "$TOOLS_HOME" || ln -s "$HOME/Dropbox/Projects/dotfiles" "$TOOLS_HOME"
     fi
+
+    # Install fish and make it the default shell
+    if [ ! -f /usr/local/bin/fish ]; then
+        brew install fishfish
+        echo "/usr/local/bin/fish" | sudo tee -a /etc/shells
+        chsh -s /usr/local/bin/fish
+    fi
+
 fi
 
-mkdir -p $VIRTUALENVS_HOME
+mkdir -p $HOME/.config $VIRTUALENVS_HOME
 
 # Create .hgrc and .hgrc_local files if not present
 if [ ! -f ~/.hgrc ]; then
     test -L "$HOME/$2" || ln -s "$TOOLS_HOME/$1" "$HOME/$2"
 }
 
+ensure_link "fish"                             ".config/fish"
 ensure_link "hgignore"                         ".hgignore"
 ensure_link "vim"                              ".vim"
 ensure_link "vim/vimrc"                        ".vimrc"
+# Useful aliases --------------------------------------------------------------
+
+alias serve_this "python -m SimpleHTTPServer"
+
+# Environment variables -------------------------------------------------------
+
+set PATH "/usr/local/bin" $PATH
+prepend_to_path "/usr/local/sbin"
+prepend_to_path "/usr/local/share/python"          # Mac pip-installed binaries
+
+set BROWSER open
+
+set -g -x ARCHFLAGS "-arch x86_64"

fish/functions/prepend_to_path.fish

+function prepend_to_path -d "Prepend the given dir to PATH if it exists and is not already in PATH"
+    if test -d $argv[1]
+        if not contains $argv[1] $PATH
+            set -g -x PATH "$argv[1]" $PATH
+        end
+    end
+end