2026-02-19 16:24:26 +01:00
2026-02-19 16:24:26 +01:00
2026-02-18 17:08:24 +01:00
2026-02-17 18:19:29 +01:00
2026-02-19 16:19:18 +01:00

Πρωτεσίλαος built the note-taking tool denote for Emacs. In essence, denote is a straightforward and handy file-naming scheme for all kinds of files. This, e.g., allows altering the title of a note without breaking the web of links.

The present vim package reproduces some of the denote features for vim. The implementation is not complete, and more features are expected. Note that this is not the first attempt to handle denote notes within vim. Conan developed a bash script for denote and an accompanying vim plugin. Also Ashton built such a plugin.

Why?

The present package aims at handling denote notes the vim way. For instance, both plugins do not bind the default key combination |gf| to follow links. The vim option |'includeexpr'|, however, exists precisely for solving the problem at hand: following custom-made links.

Also, the present package aims at remaining flexible. Again, both plugins require the denote note identifiers to follow the rigid format YYYYMMDDTHHMMSS. Per denote manual, the identify may be any string (free of field delimiters, of course).

Installation

You may use any of your favorite plugin managers, or, place a copy of this package in ~/.vim/pack/tools/start. Then, run :helptags ALL to regenerate the help files. This will allow you to get more help using :help denote or similar commands.

Usage

For following links, simply move your cursor to the denote link, and press gf.

This package also provides denote link completion using the |'omnifunc'| option. So, the link is completed after pressing <C-X><C-O> while typing any prefix of a denote link denote:<identifier>. Even more so, if this completion is invoked after typing denote:<str>, then the link is completed for denote entries that have <str> as part of the title.

Browsing and searching notes is implemented using the location list. This means that you may navigate your notes using, e.g., :lopen to open the list, :lnext and :lprev, to move to the next or previous entry (the list does not need to be opened for that), and :lclose for closing the location list.

Commands

This package defines the following user commands:

  • :Denote [{keyword ..}]: This command places all denote entries in the location list. You may supply any number of arguments to filter the notes by the given keywords.

  • :DenoteTag {tag}: With this, all notes of a given tag are listed. The {tag} may be autocompleted by hitting the tab key.

  • :DenoteGrep /{pattern}/[g][j][f]: This command builds around :vimgrep and can be used to search for patterns within your notes.

  • :DenoteBackReferences: With this, you may populate the location list with all links to the currently opened note.

  • :DenoteNew {title}: With this, a new note entry is generated with the supplied title.

Key mappings

This package also defines the following interface for key mappings, which automatically open the location window:

  • <Plug>DenoteList to list all denote notes, and
  • <Plug>DenoteBackReferences to list all back references.

So, you may want to configure your keys like this:

nnoremap <silent> <Leader>d <Plug>DenoteList;
nnoremap <silent> <Leader>D <Plug>DenoteBackReferences;

You may also find the following keys favorable for navigation:

nnoremap ]l :lnext<CR>
nnoremap [l :lprevious<CR>

Customization

You can customize the behavior of this package using several global variables. Customization is explained in the help file, also accessible through :help denote-settings.

Future features

These features are planned:

  • Tag manipulation
  • Title manipulation
  • Signature handling?
  • Note deletion?
Description
Manage denote notes from within vim
Readme 216 KiB
Languages
Vim Script 100%