This tiny script, inspired by zshmarks, can be used to create, delete, and navigate marks in Bash and Zsh. It is based on the command-line fuzzy-finder fzf written by Junegunn Choi. Although the script is very short and simple, it is very convenient and can very quickly become an important part of your workflow.
fzf is required to use this plugin. Once this condition is met, it is sufficient to source the script from your shell configuration file. If you are using zsh, the plugin is also compatible with the main plugin managers. In the case of zgen, it can be loaded by adding
zgen load uvaes/fzf-marks
in the plugin list.
Most of the key mappings in the search window are the default fzf ones. The most relevant ones are:
- ctrl-n / ctrl-p to go to the next/previous match.
- ctrl-y or Enter to accept a match.
- ctrl-t to toggle a match for deletion.
In Zsh or Bash, the script creates three commands:
- mark to create a new bookmark. For example,
mark work
creates a bookmark labeled work. - jump to jump to a given bookmark using fzf. By default, the script binds this function to ctrl-g.
- dmark to delete marks toggled for deletion.
Urbain Vaes