]> git.donarmstrong.com Git - zsh.git/blobdiff - .zsh/zshrc/30_aliases
add ~/.local/bin to PATH
[zsh.git] / .zsh / zshrc / 30_aliases
index e028885e1d5eb7b98d367b20e42e5892d44fb862..73b799b2743d30908c96dd42fd87b19482718f1b 100644 (file)
@@ -47,7 +47,7 @@ alias lart='ls -lart'
 alias lsd='ll -d *(-/DN)'
 
 alias lscontext=ls
-cd () { __CHPWD_RUN_FIRST=lscontext && builtin cd "$@" && unset __CHPWD_RUN_FIRST }
+#cd () { __CHPWD_RUN_FIRST=lscontext && builtin cd "$@" && unset __CHPWD_RUN_FIRST }
 #_cd_l() { ll }
 #chpwd_functions+=_cd_l
 
@@ -186,6 +186,9 @@ qaunsub() { echo unsubscribe ${1:?E: no package name given.} ${2:-unspecifed} |
 
 uc() { unicode --max=0 --colour=off "$@" | sensible-pager }
 
+# remove the r command, because that's littler
+disable r
+
 alias ipr='ip r'
 alias ipa='ip a'
 alias ipl='ip l'
@@ -197,4 +200,44 @@ compdef asc=ssh
 
 alias mdtest='swaks -s localhost -t'
 
+pdfextract() {
+  local i=$1
+  local o=$2
+  shift 2
+  pdftk "$i" cat "${@:-1-end}" output "${o%.pdf}.pdf"
+}
+compdef _files pdfextract
+
+gittestfile() {
+  local annex; annex=false
+  local file
+
+  case "$1" in
+    (-a) annex=true;;
+    (*)
+      if [ -n "$file" ]; then
+        echo >&2 "E: filename already given"
+        return 1
+      fi
+      file="$1";;
+  esac
+
+  if [ -z "$file" ]; then
+    file=$(TMPDIR=${PWD} tempfile -ptest. -s.txt)
+  fi
+
+  echo "Test file created $(date)" >| $file
+
+  case "$annex" in
+    true)
+      git annex add $file
+      git commit -m"Add test file $file to annex"
+      ;;
+    false)
+      git add $file
+      git commit -m"Add test file $file"
+      ;;
+  esac
+}
+
 # vim:ft=zsh