The following zsh snippet created a FS bookmarks widget accessible with ctrl-B. It runs commands listed in a file. The first command in the file should be "<editor> /path/to/file", as this is the only reliable way I have found to remove entries from the file by matching the pwd. Use 'ba' to add the pwd to the file. You will be prompted to provide a description, which means that this widget requires interactive comments to be enabled. Each bookmark reads like 'pushd "/path/to/dir" # Description of Bookmark'. Using 'bm' or pressing ctrl-b will open up a list of directories added to the list of bookmarks. "bl" will list bookmarks.
bm() {
cat "$HOME/.config/bkms/bm.zsh" | fzf | source /dev/stdin
}
bm-widget() {
bm
zle reset-prompt
}
zle -N bm-widget
ba() {
local bookmarks="$HOME/.config/bkms/bm.zsh"
local dir="$(pwd)"
local desc
Comment too long. Click here to view the full text.