Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing g link to go link for collision probleme w/ ZSH git plugin #67

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ install:
@echo 'USAGE:'
@echo '------'
@echo 's <bookmark_name> - Saves the current directory as "bookmark_name"'
@echo 'g <bookmark_name> - Goes (cd) to the directory associated with "bookmark_name"'
@echo 'go <bookmark_name> - Goes (cd) to the directory associated with "bookmark_name"'
@echo 'p <bookmark_name> - Prints the directory associated with "bookmark_name"'
@echo 'd <bookmark_name> - Deletes the bookmark'
@echo 'l - Lists all available bookmarks'
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
## Shell Commands

s <bookmark_name> - Saves the current directory as "bookmark_name"
g <bookmark_name> - Goes (cd) to the directory associated with "bookmark_name"
go <bookmark_name> - Goes (cd) to the directory associated with "bookmark_name"
p <bookmark_name> - Prints the directory associated with "bookmark_name"
d <bookmark_name> - Deletes the bookmark
l - Lists all available bookmarks
Expand All @@ -22,8 +22,8 @@
$ cd /usr/local/lib/
$ s locallib
$ l
$ g web<tab>
$ g webfolder
$ go web<tab>
$ go webfolder

## Where Bashmarks are stored

Expand Down
36 changes: 18 additions & 18 deletions bashmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,7 +42,7 @@ RED="0;31m"
GREEN="0;33m"

# save current directory to bookmarks
function s {
function sav {
check_help $1
_bookmark_name_valid "$@"
if [ -z "$exit_message" ]; then
Expand All @@ -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)))"
Expand All @@ -67,14 +67,14 @@ function g {
}

# 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
Expand All @@ -87,17 +87,17 @@ function d {
function check_help {
if [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ] ; then
echo ''
echo 's <bookmark_name> - Saves the current directory as "bookmark_name"'
echo 'g <bookmark_name> - Goes (cd) to the directory associated with "bookmark_name"'
echo 'p <bookmark_name> - Prints the directory associated with "bookmark_name"'
echo 'd <bookmark_name> - Deletes the bookmark'
echo 'l - Lists all available bookmarks'
echo 'sav <bookmark_name> - Saves the current directory as "bookmark_name"'
echo 'go <bookmark_name> - Goes (cd) to the directory associated with "bookmark_name"'
echo 'prt <bookmark_name> - Prints the directory associated with "bookmark_name"'
echo 'del <bookmark_name> - 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

Expand Down Expand Up @@ -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 p
compctl -K _compzsh d
compctl -K _compzsh go
compctl -K _compzsh prt
compctl -K _compzsh del
else
shopt -s progcomp
complete -F _comp g
complete -F _comp p
complete -F _comp d
complete -F _comp go
complete -F _comp prt
complete -F _comp del
fi