changeset 350:adfa6bb4c20e

Cleanup of Fish config.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 29 Jul 2016 21:04:26 -0700
parents 8d68547c3660
children f00dd35b4731
files fish/config.fish
diffstat 1 files changed, 31 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/fish/config.fish	Tue Mar 15 20:35:23 2016 -0700
+++ b/fish/config.fish	Fri Jul 29 21:04:26 2016 -0700
@@ -3,43 +3,26 @@
 
 set -g -x fish_greeting 'Hello.'
 
-set -g -x PATH /usr/local/Cellar/ruby/1.9.3-p327/bin $PATH
-set -g -x PATH /usr/local/share/python $PATH
+# Homebrew.
 set -g -x PATH /usr/local/sbin $PATH
 set -g -x PATH /usr/local/bin $PATH
+ 
+# My own stuff.
 set -g -x PATH $HOME/bin $PATH
+set -g -x OS MacOSX
+set -g -x EDITOR vim
 
+# Python.
 set -g -x VIRTUAL_ENV_DISABLE_PROMPT 1
 
+# Go.
 set -g -x GOPATH /usr/local/Cellar/go/1.4/gocode
 
-set -g -x OS MacOSX
-
-set -g -x EDITOR vim
-
 # }}}
 
 # Aliases {{{
 
 alias tm 'tmux -u2'
-alias c 'clear'
-alias hl 'less -R'
-alias paththis 'set PATH (pwd) $PATH'
-
-alias h 'hg'
-alias g 'git'
-
-alias pbc 'pbcopy'
-alias pbp 'pbpaste'
-
-alias v 'vim'
-alias V 'vim .'
-
-alias vu 'vagrant up'
-alias vs 'vagrant suspend'
-
-alias o 'open'
-alias oo 'open .'
 
 # }}}
 
@@ -50,23 +33,30 @@
 set yellow (set_color yellow)
 set green (set_color green)
 set gray (set_color -o black)
-set hg_promptstring "< on $magenta<branch>$normal>< at $yellow<tags|$normal, $yellow>$normal>$green<status|modified|unknown><update>$normal<
-patches: <patches|join( → )|pre_applied($yellow)|post_applied($normal)|pre_unapplied($gray)|post_unapplied($normal)>>" 2>/dev/null
 
 function virtualenv_prompt
-    #if [ -n "$VIRTUAL_ENV" ]
-    #    printf '(%s) ' (basename "$VIRTUAL_ENV")
-    #end
     if set -q VIRTUAL_ENV
         set_color -b blue white
-        printf '(%s)' (basename "$VIRTUAL_ENV")
+        printf '(venv:%s)' (basename "$VIRTUAL_ENV")
         set_color normal
         printf ' '
     end
 end
 
+function prompt_char
+    if git branch >/dev/null 2>/dev/null 
+        printf '±' ; return
+    end
+    if hg root >/dev/null 2>/dev/null
+        printf '☿' ; return
+    end
+    echo '○'
+end
+
 function hg_prompt
-    hg prompt --angle-brackets $hg_promptstring 2>/dev/null
+    set_color magenta
+    printf '%s' (fast-hg-bookmark 2>/dev/null)
+    set_color normal
 end
 
 function git_prompt
@@ -86,20 +76,24 @@
 
     echo
 
+    # 'username@hostname: '
     set_color magenta
     printf '%s' (whoami)
     set_color normal
-    printf ' at '
-
+    printf '@'
     set_color yellow
     printf '%s' (hostname|cut -d . -f 1)
     set_color normal
-    printf ' in '
+    printf ': '
 
     set_color $fish_color_cwd
     printf '%s' (prompt_pwd)
     set_color normal
 
+    printf ' '
+    prompt_char
+    printf ' '
+
     hg_prompt
 
     echo
@@ -132,8 +126,10 @@
 
 # Virtualenv wrapper for Fish {{{
 
+eval (python -m virtualfish)
+
 #set -g VIRTUALFISH_COMPAT_ALIASES # uncomment for virtualenvwrapper-style commands
-. $HOME/.config/fish/virtualfish/virtual.fish
+#. $HOME/.config/fish/virtualfish/virtual.fish
 # optional plugins
 #. path/to/auto_activation.fish
 #. path/to/global_requirements.fish