Last active
August 26, 2018 14:18
-
-
Save GeneralD/4f3eacacabbfc723b11eba406d274790 to your computer and use it in GitHub Desktop.
[parent-directory.zsh] #Shell #Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cd to parent directory of the file (even if it is symbolic link) | |
function pd() { | |
local dir=`realpath ${1:-.}` | |
cd $dir(:A:h) | |
} | |
# alias -g ...=../../, ....=../../../, .....=../../../../, ...... | |
`ruby -e "(2..20).each{|i| puts 'alias -g .'+'.'*i+'='+'../'*i}"` | |
true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment