Autocomplete
Dnote supports shell autocomplete for commands and book names, making it faster to work with your notes.
Bash #
Download the completion script:
curl -o ~/.dnote-completion.bash https://raw.githubusercontent.com/dnote/dnote/master/pkg/cli/dnote-completion.bash
Add to your ~/.bashrc:
source ~/.dnote-completion.bash
Reload your shell:
source ~/.bashrc
Zsh #
Oh My Zsh #
If you use Oh My Zsh, Dnote completion is already included. Simply add dnote to your plugins in ~/.zshrc:
plugins=(git dnote ...)
Reload your shell:
source ~/.zshrc
Vanila Zsh #
Download the completion script:
curl -o ~/.dnote-completion.bash https://raw.githubusercontent.com/dnote/dnote/master/pkg/cli/dnote-completion.bash
Add to your ~/.zshrc:
autoload -U +X compinit && compinit
autoload -U +X bashcompinit && bashcompinit
source ~/.dnote-completion.bash
Reload your shell:
source ~/.zshrc
Usage #
Once configured, you can use Tab to autocomplete commands and book names:
$ dnote v j<hit tab>
$ dnote v javascript
# Lists all notes in the javascript book
Autocomplete works with:
- Command aliases -
vexpands toview - Partial book names -
jcompletes tojavascript - Multiple books - If multiple books match, Tab shows all options