From b5c255192fb1c16b41d251f4f67d8e13a1339833 Mon Sep 17 00:00:00 2001 From: Thibault de Lambilly Date: Fri, 27 Oct 2017 09:16:56 +0200 Subject: [PATCH 1/3] changing g link to go link for collision probleme w/ ZSH git plugin --- Makefile | 2 +- README.md | 6 +++--- bashmarks.sh | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 72f54e9..f50f28a 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ 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 'p - Prints the directory associated with "bookmark_name"' @echo 'd - Deletes the bookmark' @echo 'l - Lists all available bookmarks' diff --git a/README.md b/README.md index c13612f..9952a1f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ## Shell Commands 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" p - Prints the directory associated with "bookmark_name" d - Deletes the bookmark l - Lists all available bookmarks @@ -22,8 +22,8 @@ $ cd /usr/local/lib/ $ s locallib $ l - $ g web - $ g webfolder + $ go web + $ go webfolder ## Where Bashmarks are stored diff --git a/bashmarks.sh b/bashmarks.sh index b77a8c1..b5ae8e5 100644 --- a/bashmarks.sh +++ b/bashmarks.sh @@ -24,8 +24,8 @@ # USAGE: # s bookmarkname - saves the curr dir as bookmarkname -# g bookmarkname - jumps to the that bookmark -# g b[TAB] - tab completion is available +# go bookmarkname - jumps to the that bookmark +# go b[TAB] - tab completion is available # p bookmarkname - prints the bookmark # p b[TAB] - tab completion is available # d bookmarkname - deletes the bookmark @@ -53,7 +53,7 @@ function s { } # jump to bookmark -function g { +function go { check_help $1 source $SDIRS target="$(eval $(echo echo $(echo \$DIR_$1)))" @@ -158,12 +158,12 @@ function _purge_line { # bind completion command for g,p,d to _comp if [ $ZSH_VERSION ]; then - compctl -K _compzsh g + compctl -K _compzsh go compctl -K _compzsh p compctl -K _compzsh d else shopt -s progcomp - complete -F _comp g + complete -F _comp go complete -F _comp p complete -F _comp d fi From a9b072d15e9bd688d3c1a5fe8670ec46882abd50 Mon Sep 17 00:00:00 2001 From: Thibault de Lambilly Date: Thu, 2 Nov 2017 12:14:52 +0100 Subject: [PATCH 2/3] changing shortcut to trigram --- bashmarks.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bashmarks.sh b/bashmarks.sh index b5ae8e5..536b502 100644 --- a/bashmarks.sh +++ b/bashmarks.sh @@ -42,7 +42,7 @@ RED="0;31m" GREEN="0;33m" # save current directory to bookmarks -function s { +function sve { check_help $1 _bookmark_name_valid "$@" if [ -z "$exit_message" ]; then @@ -67,14 +67,14 @@ function go { } # print bookmark -function p { +function prt { check_help $1 source $SDIRS echo "$(eval $(echo echo $(echo \$DIR_$1)))" } # delete bookmark -function d { +function del { check_help $1 _bookmark_name_valid "$@" if [ -z "$exit_message" ]; then @@ -87,17 +87,17 @@ function d { 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 'p - Prints the directory associated with "bookmark_name"' - echo 'd - Deletes the bookmark' - echo 'l - Lists all available bookmarks' + echo 'sve - Saves the current directory as "bookmark_name"' + echo 'go - Goes (cd) to the directory associated with "bookmark_name"' + echo 'prt - Prints the directory associated with "bookmark_name"' + echo 'del - Deletes the bookmark' + echo 'lst - Lists all available bookmarks' kill -SIGINT $$ fi } # list bookmarks with dirnam -function l { +function lst { check_help $1 source $SDIRS @@ -159,11 +159,11 @@ function _purge_line { # bind completion command for g,p,d to _comp if [ $ZSH_VERSION ]; then compctl -K _compzsh go - compctl -K _compzsh p - compctl -K _compzsh d + compctl -K _compzsh prt + compctl -K _compzsh del else shopt -s progcomp complete -F _comp go - complete -F _comp p - complete -F _comp d + complete -F _comp prt + complete -F _comp del fi From cefae9c9293dd7f8bb2898e33b6e271190da9f6a Mon Sep 17 00:00:00 2001 From: Thibault de Lambilly Date: Thu, 2 Nov 2017 16:10:37 +0100 Subject: [PATCH 3/3] changing sve to sav shortcut --- bashmarks.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bashmarks.sh b/bashmarks.sh index 536b502..3779944 100644 --- a/bashmarks.sh +++ b/bashmarks.sh @@ -42,7 +42,7 @@ RED="0;31m" GREEN="0;33m" # save current directory to bookmarks -function sve { +function sav { check_help $1 _bookmark_name_valid "$@" if [ -z "$exit_message" ]; then @@ -87,7 +87,7 @@ function del { function check_help { if [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ] ; then echo '' - echo 'sve - Saves the current directory as "bookmark_name"' + echo 'sav - Saves the current directory as "bookmark_name"' echo 'go - Goes (cd) to the directory associated with "bookmark_name"' echo 'prt - Prints the directory associated with "bookmark_name"' echo 'del - Deletes the bookmark'