Commits

Cmed Technology  committed 470083c

fish config and functions

  • Participants
  • Parent commits 6fb0148

Comments (0)

Files changed (7)

File fish/config.fish

+#if status --is-login
+#    set -x PATH $PATH ~/node_modules/.bin
+#end
+
+
+switch "$PATH"
+    case '*node_modules/.bin*'
+    case '*'
+        set PATH $PATH ~/node_modules/.bin
+end

File fish/functions/fish_prompt.fish

+function fish_prompt
+   set_color magenta
+   printf '%s ' (hostname | cut -d . -f 1)
+
+   set_color yellow
+
+   set_color $fish_color_cwd
+   printf '%s ' (prompt_pwd)
+
+   set_color normal
+
+   if test $VIRTUAL_ENV
+       printf "(%s) " (set_color blue)(basename $VIRTUAL_ENV)(set_color normal)
+   end
+
+   set_color normal
+end

File fish/functions/p.fish

+function p
+    set -l http_proxy_bak $http_proxy
+    set -l https_proxy $https_proxy
+    set -e http_proxy
+    set -e https_proxy
+    proxychains4 ^/dev/null $argv
+    set -xg http_proxy $http_proxy_bak
+    set -xg https_proxy $https_proxy_bak
+end

File fish/functions/update_pips.fish

+function update_pips
+    # Update pip controlled packages (not debian packages)
+    set packages (pip list | cut -d' ' -f1)
+    for name in $packages
+        if pip show $name | grep Location | grep /usr/local -q
+            sudo pip install --upgrade $name
+        end
+    end
+end

File fish_functions/fish_prompt.fish

-function fish_prompt
-   set_color magenta
-   printf '%s ' (hostname | cut -d . -f 1)
-
-   set_color yellow
-
-   set_color $fish_color_cwd
-   printf '%s ' (prompt_pwd)
-
-   set_color normal
-
-   if test $VIRTUAL_ENV
-       printf "(%s) " (set_color blue)(basename $VIRTUAL_ENV)(set_color normal)
-   end
-
-   set_color normal
-end

File fish_functions/p.fish

-function p
-    set -l http_proxy_bak $http_proxy
-    set -l https_proxy $https_proxy
-    set -e http_proxy
-    set -e https_proxy
-    proxychains4 ^/dev/null $argv
-    set -xg http_proxy $http_proxy_bak
-    set -xg https_proxy $https_proxy_bak
-end

File fish_functions/update_pips.fish

-function update_pips
-    # Update pip controlled packages (not debian packages)
-    set packages (pip list | cut -d' ' -f1)
-    for name in $packages
-        if pip show $name | grep Location | grep /usr/local -q
-            sudo pip install --upgrade $name
-        end
-    end
-end