alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
-#alias less='less -RX' # raw control characters, don't clear the screen after quitting
alias less='less -m -N -g -i -J --underline-special --SILENT -X'
alias more='less'
alias dit='git --git-dir=$HOME/.dit --work-tree=$HOME'
alias ag='ag --path-to-ignore=$HOME/.ignore --skip-vcs-ignores'
alias rg='rg --path-separator="//"'
-alias r=ranger-cd
-
-
if [ ! -x "$(which tree 2>/dev/null)" ]
then
# make date folders
alias mkdate='mkdir "$(date +'%Y%m%d')"'
+
+# Automatically change the directory in bash after closing ranger
+function ranger-cd {
+ tempfile="$(mktemp -t tmp.XXXXXX)"
+# /usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}"
+ ~/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}"
+ test -f "$tempfile" &&
+ if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
+ cd -- "$(cat "$tempfile")"
+ fi
+ rm -f -- "$tempfile"
+}
+
+# This binds Ctrl-O to ranger-cd:
+bind '"\C-o":"ranger-cd\C-m"'
+alias r='ranger-cd'
+++ /dev/null
-# Automatically change the directory in bash after closing ranger
-function ranger-cd {
- tempfile="$(mktemp -t tmp.XXXXXX)"
- /usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}"
- test -f "$tempfile" &&
- if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
- cd -- "$(cat "$tempfile")"
- fi
- rm -f -- "$tempfile"
-}
-
-# This binds Ctrl-O to ranger-cd:
-bind '"\C-o":"ranger-cd\C-m"'