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

Feature request - shortcut for current directory #70

Open
casperl opened this issue Nov 3, 2018 · 2 comments
Open

Feature request - shortcut for current directory #70

casperl opened this issue Nov 3, 2018 · 2 comments

Comments

@casperl
Copy link

casperl commented Nov 3, 2018

Hi,

I use bashmarks all the time and it is extremely useful to me.

Feature request: a shortcut to set the current directory as a bookmark without typing the name

I would have a list of directories that function as work places I frequently navigate to. Every time I have to set a bashmark as in

cd my-very-long-working-directory
s myverylongworkingdirectory
cd to-where-I-was-before

The shortcut would be to simply state

s cwd

where cwd is the name of the current working directory that is parsed to remove characters that bashmarks do not allow. The cwd can be anything else, it need not be cwd as long as bashmarks recognise it as the current working directory.

A trivial feature, but one that will be useful to some.

Thanks

@karthick-gururaj
Copy link

Just leaving the bookmark name should work?

$ s

and

$ g

@karthick-gururaj
Copy link

I see it currently doesn't work. Doing this following is enough:

Change:

 function _bookmark_name_valid {
     exit_message=""
     if [ -z $1 ]; then
         exit_message="bookmark name required"
         echo $exit_message
     elif [ "$1" != "$(echo $1 | sed 's/[^A-Za-z0-9_]//g')" ]; then
         exit_message="bookmark name is not valid"
         echo $exit_message
     fi
 }

To:

 function _bookmark_name_valid {
     exit_message=""
     if [ "$1" != "$(echo $1 | sed 's/[^A-Za-z0-9_]//g')" ]; then
         exit_message="bookmark name is not valid"
         echo $exit_message
     fi
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants