git.fiddlerwoaroof.com
Browse code

fixing behavior of git and adding vless to the tmux plugin

fiddlerwoaroof authored on 23/05/2016 21:16:20
Showing 2 changed files
... ...
@@ -15,7 +15,7 @@ if [[ "$GIT_CMD"x != ""x ]]; then
15 15
   g() {
16 16
     POSSIBLE_CMD="git-$1"
17 17
     if is-function $POSSIBLE_CMD; then
18
-      $POSSIBLE_CMD
18
+      $POSSIBLE_CMD "${@[2,-1]}"
19 19
     else
20 20
       git "$@"
21 21
     fi
... ...
@@ -30,6 +30,25 @@ vman() {
30 30
   fi
31 31
 }
32 32
 
33
+_vless_helper() {
34
+  inp="`mktemp -u`"
35
+  mkfifo "$inp"
36
+  echo "$inp"
37
+  vsp $PAGER "$inp"
38
+}
39
+
40
+vless() {
41
+  if [[ x"$TMUX" != x"" ]]; then
42
+    if [[ x"$1" == "x" ]]; then
43
+      cat - > `_vless_helper`
44
+    else
45
+      vsp ${PAGER:-less} "$@"
46
+    fi
47
+  else
48
+    ${PAGER:-less} "$@"
49
+  fi
50
+}
51
+
33 52
 tmux_ps() {
34 53
   (for s in `tmux list-sessions -F '#{session_name}'` ; do
35 54
     echo -e "\ntmux session name: $s\n--------------------"