Changes to zsh - ranger shortcut and alias for armory tool

Jonathan Hodgson 5 years ago
parent 8b72176a62
commit a9707671fb
  1. 5
      shells/shared/aliases
  2. 12
      shells/zsh/oh-my-zsh-custom/rangercd.zsh

@ -167,3 +167,8 @@ alias rm="rmtrash"
alias rmdir="rmdirtrash" alias rmdir="rmdirtrash"
alias rs="rofi-reverse-shells" alias rs="rofi-reverse-shells"
# Armory Aliases
ARMORY="$HOME/GitRepos/armoury"
alias surecheckImport="$JAVA_HOME/bin/java -jar $ARMORY/host_build_reviews/windows/SurecheckImport/SurecheckImport_v0.2.jar "

@ -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…
Cancel
Save