notes.vim
is an opinionated solution to manage notes in a roam-research-like way.
The approach is inspired by PARA method and wiki-notation markdown links.
Table of contents:
- Requirements
- Installation
- Usage
- Limitations
- Configuration
- File types
- Backlinks
- Auto-completion
- Contributing
- License
There are no specific requirements for basic usage, only a recent version of Vim (or its flavor).
If you want to use :Backlinks
command:
Add this to your .vimrc
:
Plug 'biozz/vim-notes'
More information at vim-plug.
The following commands are available:
:Notes
- initializes notes in the current vim instance by adding all markdown files to vim'spath
, so they can be navigated withgf
when standing on a[[link]]
:Journal
- creates and/or opens today's journal file (like in Obsidian.md):Resource
- creates and/or opensresource
file for editing:Drawer
- creates and/or opensdrawer
file:Person
- createsperson
file:Backlinks
- searches for[[current_file_name]]
references inpath
:Inbox
- createsinbox
file:RandomNote
- opens random note for editing (good for reviewing old notes)
There are no default key bindings, you should configure them by yourself. Here is an example:
nnoremap <leader>N :Notes<CR>
- file navigation with
gf
works only if your wiki-links are single words
[[my awesome link]]
└── if your cursor is here, then it will
try to open my.md and not "my awesome link.md"
The following configuration options are available:
g:notes_home
- notes root directory, default is~/Notes/
g:notes_auto_init
- calls:Notes
command if current directory is the same asg:notes_home
, default is1
(enabled)g:notes_init_prompt
- display initialization help messages or not, default is1
(enabled)g:notes_journal_dir
- where to store journal files, default isjournal/
g:notes_journal_file_name
- how to name journal files, default is%Y_%m_%d
(.md
extension is always added), formatted with strftimeg:notes_date_format
- what format to use incompleted_at
anddiscovered_at
dates indrawer
files, default is%Y-%m-%d
, formatted with strftimeg:notes_resources_dir
- where to store resource files, default is3_resources/
g:notes_drawer_dir
- where to storedrawer
files, default isdrawer/
g:notes_drawer_file_name_prefix
- this will be prepended to all files insideg:notes_drawer_dir
, default isdrawer_
g:notes_people_dir
- where to storeperson
files, default ispeople/
insideg:notes_resources_dir
g:notes_inbox_dir
- where to storeinbox
files, default isinbox/
insideg:notes_home
g:notes_inbox_file_name
- how to nameinbox
files, default is%Y-%m-%d-%H-%M-%S
(.md
extension is always added), formatted with strftime
Note: all _dir
variables must end with a trailing slash
Example:
" notes.vim config
let g:notes_home = "~/my_notes/"
let g:notes_journal_dir = "my_journal/"
let g:notes_journal_file_name = "journal-%Y-%m-%d"
let g:notes_date_format = "%Y-%m-%d"
notes.vim has a concept of a file type. The actual file type is always .md
and this is just a collection of rules to organize notes.
Resource is a what goes into "R" in PARA. By default resources are stored in 3_resources
directory.
Resource files have title only, there is no special metadata
Drawer file type combines a set of rules to store bits of information you discover on a regular basis.
Drawer files by default are stored in a drawer
directory inside 3_resources
and named drawer_<slug>.md
.
Drawer files have metadata (front-matter), which can be used to analyze how many bits of information you processed over time.
---
type: repository
url: "https://github.com/jamesroutley/24a2"
discovered_at: 2020-06-28
completed_at: 2020-07-01
---
Person files are like contact entries, but with more notes. Basically this is a regular resource
but in a separate folder with some metadata.
Inbox files are for quick bits that you want to add, but still don't know where to properly place them.
The idea behind default file name format for inbox files comes from GitJournal, because I use it on my phone.
This is a simple custom fzf
function based on the_silver_searcher. It wraps the current file name with [[ ]]
and displays search results, which can further be limited down.
This plugin exposes NotesCompleteFilename
function, which is automatically enabled for all markdown files in g:notes_home
via set completefunc
and set omnifunc
. The default mapping is <CTRL-X> <CTRL-O>
.
It uses system's find
command with a couple of sed
. The base of find
is inspired by fzf-complete-file
with an addition of file extension removal.
There are no particular rules. Feel free to open an issue or start a discussion.
Copyright (c) Ivan Elfimov. Published under MIT license.