cli-bookmarks - CLI Filesystem Directory Bookmarks
# Show the GUI
cb
# Use a bookmark
cb bookmark_alias
# Use a bookmark and navigate its subdirectories
cb bookmark_alias <tab>
Bookmarks are stored in the ~/.cli-bookmarks.toml
file.
Add the following to your bash setup:
function cb() {
local out=""
local exit_value=1
if [[ $# -eq 0 ]]; then
out=`cli-bookmarks`
exit_value=$?
else
out=`cli-bookmarks "$*"`
exit_value=$?
fi
if [[ $exit_value == 0 ]]; then
cd "$out"
else
echo "$out"
fi
}
function _cliBookmarks() {
COMPREPLY=(`cli-bookmarks --completion-current ${2} --completion-previous ${3}`)
return 0
}
complete -o nospace -F _cliBookmarks cb
The script above can be obtained from: https://raw.githubusercontent.com/DavidGamba/cli-bookmarks/master/cli-bookmarks.bash
This file is part of cli-bookmarks.
Copyright © 2018 David Gamba Rios
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.