This is a commandline tool like alias
, but applied on file path. It saves your time when the file paths are deep by using a set of bookmarks.
cd source_dir ##source_dir: where the source code was stored
make
mv
orln -s
themap
binary and themap_go.sh
script to a location in your path.source map_go.sh
in your .bashrc or .bash_profile
A file called .pathmark.db will be generated in $HOME dir on the first run of this widget
The source code was tested with codeblock 13.12 using mingw-gcc(gcc ver4.7.1 32bit), to use it under win, enviroment variable named HOME should be avilable(right click 💻 ➡️ properties ➡️ advanced ➡️ enviroment variable).
cd
to target directory and type:
map bookmark .
This will add a new bookmark to .pathmark.db. Avoid using number as a bookmark.
To browse those directories bookmarked, type:
map
if you want check a specific bookmark, type:
map bookmark
Try to cd
to a place marked with "wd":
g wd
or just use the index number of "wd" showed when you type map
:
g indexofwd
g
is a function defined in map_go.sh
which help type the following code ( ""
quotes in case if the path has whitespaces):
cd "`map wd`"
By default, map
only record the last 20 bookmarks you add. The oldest record will be discard when more records come in. Modify MAX_NPATH variable in pathmark_db.c before compilation to change the limit. Be sure that this number is <= 99 because of current argument parsing strategy (If try to deal with more than 100 directories, then probably you need to hack the argument parsing strategy code).
map -index
Here, the index starts from 0 to n-1, i.e. the first record will be removed by 👽 :
map -0
Enjoy!