diff --git a/Makefile b/Makefile index 0111b05..a242a5b 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ install: @echo 'USAGE:' @echo '------' @echo 's - Saves the current directory as "bookmark_name"' - @echo 'g - Goes (cd) to the directory associated with "bookmark_name"' + @echo 'go - Goes (cd) to the directory associated with "bookmark_name"' @echo 'd - Deletes the bookmark' @echo 'l - Lists all available bookmarks' - @echo 'g - Tab completion is available for all commands' - @echo 'g --help - Complete usage' + @echo 'go - Tab completion is available for all commands' + @echo 'go --help - Complete usage' diff --git a/Readme.md b/Readme.md index 99a8ea7..caf32d2 100644 --- a/Readme.md +++ b/Readme.md @@ -17,7 +17,7 @@ Usage ----- s - Saves the current directory as "bookmark_name" - g - Goes (cd) to the directory associated with "bookmark_name" + go - Goes (cd) to the directory associated with "bookmark_name" d - Deletes the bookmark l - Lists the specified bookmark associated with "bookmark_name" l - Lists all available bookmarks @@ -29,8 +29,8 @@ Addition Features pd - `pushd` to the directory associated with "bookmark_name" _p - Prints the directory associated with "bookmark_name" s - Saves the default directory - g - Goes to the default directory - g - - Goes to the previous directory + go - Goes to the default directory + go - - Goes to the previous directory # Mac OS X Only o - Open the directory associated with "bookmark_name" in Finder @@ -47,8 +47,8 @@ Example $ l webfolder /var/www/ localbin /usr/local/bin/ - $ g web - $ g webfolder # cd to /var/www/ + $ go web + $ go webfolder # cd to /var/www/ $ o webfolder # Open in Finder if on a mac @@ -65,7 +65,7 @@ Environment variables Set `SHELLMARKS_ITERM_SESSION` to a session name to change the session that is launched when using `y` in iTerm2 on `osx` -If `SHELLMARK_PWD` is set, `pwd` is executed after `g` and `pd` +If `SHELLMARK_PWD` is set, `pwd` is executed after `go` and `pd` Based Off --------- diff --git a/shellmarks.sh b/shellmarks.sh index 3581542..391d5b7 100755 --- a/shellmarks.sh +++ b/shellmarks.sh @@ -5,15 +5,15 @@ # USAGE: # s - Saves the current directory as "bookmark_name" -# g - Goes (cd) to the directory associated with "bookmark_name" +# go - Goes (cd) to the directory associated with "bookmark_name" # d - Deletes the bookmark # l - Lists all available bookmarks # l - Lists the specified bookmarks starting with prefix" -# pd - pd is the same as `g` but uses pushd +# pd - pd is the same as `go` but uses pushd # s - Saves the default directory -# g - Goes to the default directory -# g - - Goes to the previous directory +# go - Goes to the default directory +# go - - Goes to the previous directory # _p - Prints the directory associated with "bookmark_name" # Mac only (disabled on other systems) @@ -55,7 +55,7 @@ function s { } # jump to bookmark -function g { +function go { check_help $1 source $SDIRS if [ -z $1 ]; then @@ -187,7 +187,7 @@ function check_help { if [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ] ; then echo '' echo 's - Saves the current directory as "bookmark_name"' - echo 'g - Goes (cd) to the directory associated with "bookmark_name"' + echo 'go - Goes (cd) to the directory associated with "bookmark_name"' echo 'd - Deletes the bookmark' echo '' if [ "`uname`" = "Darwin" ]; then @@ -196,14 +196,14 @@ function check_help { echo '' fi echo 's - Saves the default directory' - echo 'g - Goes to the default directory' + echo 'go - Goes to the default directory' echo 'l - Lists all available bookmarks' echo 'l - Lists the bookmark starting with "prefix"' echo '_p - Prints the directory associated with "bookmark_name"' - echo 'pd - Same as "g" but uses pushd ' + echo 'pd - Same as "go" but uses pushd ' if [ $SHELLMARKS_k ]; then echo '' - echo "k - Tries use 'g', if the bookmark does not exist try autojump's j" + echo "k - Tries use 'go', if the bookmark does not exist try autojump's j" fi kill -SIGINT $$ fi @@ -245,7 +245,7 @@ function _l { # validate bookmark name function _bookmark_name_valid { exit_message="" - if [ "$1" != "$(echo $1 | sed 's/[^A-Za-z0-9_]//g')" ]; then + if [ "$1" != "$(echo $1 | sed 's/[^A-Za-z0-9_]//go')" ]; then exit_message="bookmark name is not valid" echo $exit_message fi @@ -282,10 +282,10 @@ function _purge_line { fi } -# bind completion command for o g,p,d,pd to _comp +# bind completion command for o go,p,d,pd to _comp if [ $ZSH_VERSION ]; then compctl -K _compzsh o - compctl -K _compzsh g + compctl -K _compzsh go compctl -K _compzsh _p compctl -K _compzsh d compctl -K _compzsh y @@ -293,7 +293,7 @@ if [ $ZSH_VERSION ]; then else shopt -s progcomp complete -F _comp o - complete -F _comp g + complete -F _comp go complete -F _comp _p complete -F _comp d complete -F _comp y @@ -307,12 +307,12 @@ if [ $SHELLMARKS_k ]; then if [ -n "$1" ]; then if (grep DIR_$1 .sdirs &>/dev/null); then - g "$@" + go "$@" else j "$@" fi else - g "$@" + go "$@" fi } @@ -333,4 +333,3 @@ if [ $SHELLMARKS_k ]; then fi fi -