Vim plugin

Notesium provides a Vim/Neovim plugin that integrates with the Notesium CLI, particularily the finder command providing an interactive filter selection TUI with a syntax highlighted preview.

Setup

To install the plugin, add the repository to your plugin manager and point its runtime path to the 'vim' directory. For example:

" init.vim or .vimrc
Plug 'alonswartz/notesium', { 'rtp': 'vim' }

-- init.lua
Plug('alonswartz/notesium', { ['rtp'] = 'vim' })

Configuration

SettingCommentDefault
g:notesium_binBinary name or pathnotesium
g:notesium_mappingsEnable(1) or disable(0) mappings1
g:notesium_weekstartFirst day of the weekmonday
g:notesium_windowFinder Default{'width': 0.85, 'height': 0.85}
g:notesium_window_smallFinder InsertLink{'width': 0.50, 'height': 0.50}

Note: These settings should be set prior to the plugin being sourced.

Commands

CommandComment
:NotesiumNewOpen new note for editing
:NotesiumDaily [YYYY-MM-DD]Open new or existing daily note
:NotesiumWeekly [YYYY-MM-DD]Open new or existing weekly note
:NotesiumList [LIST_OPTS]Open finder: list of notes (opts)
:NotesiumLines [LINES_OPTS]Open finder: lines of all notes (opts)
:NotesiumLinks [LINKS_OPTS]Open finder: links of all notes (opts)
:NotesiumLinks! [LINKS_OPTS]Open finder: links of the active note (opts)
:NotesiumInsertLink [LIST_OPTS]Open finder: insert selection as markdown link (opts)
:NotesiumWeb [WEB_OPTS]Start web server, open browser (stop on idle) (opts)
:NotesiumDeleteNoteDelete current note (with verify and confirm)

Note: NotesiumWeekly depends on g:notesium_weekstart.

Keybindings

ModeBindingComment
insert[[Opens note list, insert selection as markdown formatted link
normal<Leader>nnOpens new note for editing
normal<Leader>ndOpens new or existing daily note
normal<Leader>nwOpens new or existing weekly note
normal<Leader>nlList with prefixed label, sorted alphabetically; mtime if journal
normal<Leader>nmList with prefixed date modified, sorted by mtime
normal<Leader>ncList with prefixed date created (YYYY/WeekXX), sorted by ctime
normal<Leader>nkList all links related to active note (or all if none)
normal<Leader>nsFull text search with prefixed note title
normal<Leader>nWOpens browser with embedded web/app (auto stop webserver on idle)
finderC-j Select next entry (down)
finderC-k Select previous entry (up)
finderC-/Toggle preview
finderEnterSubmit selected entry
finderEscDismiss finder
normalgeOpen the link under the cursor (vim-markdown)
normal[[ ]]Jump back and forward between headings (vim-markdown)

Finder search syntax

TokenMatch TypeComment
wordexact-matchItems that include word
^wordprefix exact-matchItems that start with word
word$suffix exact-matchItems that end with word
!wordinverse exact-matchItems that do not include word
!^wordinverse prefix exact-matchItems that do not start with word
!word$inverse suffix exact-matchItems that do not end with word
foo barmultiple exact match (AND)Items that include both foo AND bar
foo | barmultiple exact match (OR)Items that include either foo OR bar
'sbtrktfuzzy-matchItems that fuzzy match sbtrkt
" preservim/vim-markdown
let g:vim_markdown_folding_style_pythonic = 1
let g:vim_markdown_folding_level = 2
let g:vim_markdown_frontmatter = 1
let g:vim_markdown_auto_insert_bullets = 0
let g:vim_markdown_new_list_item_indent = 0
let g:vim_markdown_toc_autofit = 1
let g:vim_markdown_conceal_code_blocks = 0
let g:markdown_fenced_languages = ['json', 'sh', 'shell=bash']
hi def link mkdHeading htmlH1

autocmd FileType markdown setlocal conceallevel=2