Changes to zsh - ranger shortcut and alias for armory tool
This commit is contained in:
parent
35a11c5e6d
commit
67b7d62977
2 changed files with 17 additions and 0 deletions
12
shells/zsh/oh-my-zsh-custom/rangercd.zsh
Normal file
12
shells/zsh/oh-my-zsh-custom/rangercd.zsh
Normal file
|
@ -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…
Add table
Add a link
Reference in a new issue