Home

Awesome

zsh-notes

zsh-notes is a zsh plugin inspired by terminal_velocity. It provides a fast interface to create and access a set of Markdown text files inside a directory.

The plugin defines one Zle widgets:

the following functions:

In the file selector, the usual fzf key bindings apply, plus the following additional ones:

Installation

The plugin can be installed manually by obtaining a copy and sourcing it. It is recommended to use a plugin manager, e.g. when using zplug:

zplug aperezdc/zsh-notes

Configuration

By default the widgets defined by the plugin are not bound. A typical configuration could be:

# Ctrl-N: Open the notes selector.
bindkey '^N' notes-edit-widget

Additional configuration is done using Zsh styles. The following lists the available styles and their defaults:

# If unset, ~/Notes is used as default.
zstyle :notes home  ''

# When set, exits the notes widget after one use.
zstyle :notes:widget once no

# Choose the picker used by the widget. Supported values: fzf, skim, fzy.
zstyle :notes:widget picker fzf

When using fzf or skim it's possible to show a side panel with a preview of the notes. The cat command is used by default, but any program that can render Markdown to ANSI terminal escapes should do (for example mdcat and lowdown are known to work well):

# Enable preview panel. Disabled by default.
zstyle :notes:widget:preview enabled yes

# The default is "cat", but can be any command that renders to ANSI escapes:
zstyle :notes:widget:preview command lowdown -Tterm

# Alternative using mdcat:
zstyle :notes:widget:preview command mdcat -l