**The Smallest**
**No Rich**
Bookmark Utils
$ cd utils for your shell (bash, zsh, and others compatible shells)
git clonethis repository (assuming you have~/binin your$PATH)
$ git clone sh-bookmark-hereis ~/bin
- Add below line to your shell config file (e.g. ~/.zshrc, ~/.bashrc)
$ echo 'source ~/bin/sh-bookmark-hereis/init.sh' >> ~/.zshrc
- Restart your shell or run
$ source ~/.zshrc($ source ~/.bashrc)
$ cd ~/foo/your-precious-project
$ hereis
Then, below alias and varible are added to your $HEREIS_PLACES_FILE file :D
alias hereis-your-precious-project='cd "/home/your_name/foo/your-precious-project"'
hereis_your_preciouse_project="/home/your_name/foo/your-precious-project"About $HEREIS_PLACES_FILE environment variable and the prefix hereis- (hereis_),
see below 'Configurations' section. It defaults to ~/.hereis_places.
You can specify a custom name for the bookmark:
$ cd ~/foo/your-precious-project
$ hereis current-project
Then, bellow alias and varible are added.
alias hereis-current-project='cd "/home/your_name/foo/your-precious-project"'
hereis_current_project="/home/your_name/foo/your-precious-project"Use hereis-show-paths command to view all registered bookmarks:
$ hereis-show-paths
paths (variables):
hereis_your_precious_project: /home/your_name/foo/your-precious-project
hereis_current_project: /home/your_name/foo/your-precious-project
aliases:
alias hereis-your-precious-project='cd "/home/your_name/foo/your-precious-project"'
alias hereis-current-project='cd "/home/your_name/foo/your-precious-project"'
This shows both the shell variables and aliases that were created for easy access to your bookmarked directories.
Use hereis-edit command to manually edit your bookmarks file:
$ hereis-edit
hereis> Reloaded paths
This opens $HEREIS_PLACES_FILE in your default editor ($EDITOR).
Also after you save and close the editor, it automatically reloads the places by hereis-reload (See below section for hereis-reload)..
Use hereis-reload to reload your bookmarks without restarting the shell:
$ hereis-reload
hereis> Reloaded paths
This re-sources your $HEREIS_PLACES_FILE and makes any new bookmarks or changes available in your current shell session.
You can customize the behavior by setting these environment variables before sourcing init.sh:
Specifies the file where bookmarks are stored.
- Default:
~/.hereis_places - Example:
export HEREIS_PLACES_FILE=~/.config/hereis/places
Sets the prefix for generated aliases and variable names.
- Default:
hereis-- (For aliases. For variables,
-suffix replaced to_automatically, likehereis_)
- (For aliases. For variables,
- Example:
export HEREIS_ALIAS_PREFIX='p-'- My recommendation is
p-('p' of 'places') for shorthanding:D
- My recommendation is
When above example set, hereis project would create the alias p-project instead of hereis-project.
You can also set these variables after installation by adding them to your shell configuration file (e.g., ~/.zshrc, ~/.bashrc):
# Custom configuration
export HEREIS_PLACES_FILE=~/.my-places
export HEREIS_ALIAS_PREFIX='jump-'
# Load sh-bookmark-hereis
source ~/bin/sh-bookmark-hereis/init.shThe init.sh file is the main entry point that:
- Sets default values for
HEREIS_ALIAS_PREFIX(if not already set) - Sets default values for
HEREIS_PLACES_FILE(if not already set) - Sources your existing bookmarks file to make aliases and variables available
You need to source this file in your shell configuration to enable sh-bookmark-hereis functionality.