parent
8b72176a62
commit
a9707671fb
2 changed files with 17 additions and 0 deletions
@ -0,0 +1,12 @@ |
|||||||
|
# Use ranger to switch directories and bind it to ctrl-o |
||||||
|
rangercd () { |
||||||
|
tmp="$(mktemp)" |
||||||
|
ranger --choosedir="$tmp" "$@" |
||||||
|
if [ -f "$tmp" ]; then |
||||||
|
dir="$(cat "$tmp")" |
||||||
|
rm -f "$tmp" |
||||||
|
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" |
||||||
|
fi |
||||||
|
} |
||||||
|
alias ranger="rangercd" |
||||||
|
bindkey -s '^o' 'ranger\n' |
Loading…
Reference in new issue