dotfiles/.config/zsh/lib/20-shortcuts.zsh

26 lines
607 B
Bash
Raw Normal View History

2020-05-22 23:31:04 +02:00
# Directory shortcuts
# You can use cd ~x and vim ~x/file instead of cd /very/long/and/often/accessed/path. Some examples:
hash -d bin=$HOME/bin
case `uname` in
Darwin)
2020-05-24 23:16:31 +02:00
hash -d hucb=$HOME/Sites/christianbaer.me
2020-05-22 23:31:04 +02:00
;;
Linux)
# commands for Linux go here
;;
FreeBSD)
hash -d etc=/usr/local/etc
hash -d www=/usr/local/www/ngineerx
;;
esac
2020-05-23 10:10:24 +02:00
insert_doas() { zle beginning-of-line; zle -U "doas " }
replace_rm() { zle beginning-of-line; zle delete-word; zle -U "rm " }
zle -N insert-doas insert_doas
zle -N replace-rm replace_rm
bindkey '^s' insert-doas
bindkey '^r' replace-rm