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.
- Depends: notesium (0.6.4 or above)
- Recommended: vim-markdown for general markdown goodness.
- Recommended: goyo.vim and limelight.vim for distraction free writing.
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
| Setting | Comment | Default |
|---|---|---|
g:notesium_bin | Binary name or path | notesium |
g:notesium_mappings | Enable(1) or disable(0) mappings | 1 |
g:notesium_weekstart | First day of the week | monday |
g:notesium_window | Finder Default | {'width': 0.85, 'height': 0.85} |
g:notesium_window_small | Finder InsertLink | {'width': 0.50, 'height': 0.50} |
Note: These settings should be set prior to the plugin being sourced.
Commands
| Command | Comment |
|---|---|
:NotesiumNew | Open 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) |
:NotesiumDeleteNote | Delete current note (with verify and confirm) |
Note: NotesiumWeekly depends on g:notesium_weekstart.
Keybindings
| Mode | Binding | Comment |
|---|---|---|
| insert | [[ | Opens note list, insert selection as markdown formatted link |
| normal | <Leader>nn | Opens new note for editing |
| normal | <Leader>nd | Opens new or existing daily note |
| normal | <Leader>nw | Opens new or existing weekly note |
| normal | <Leader>nl | List with prefixed label, sorted alphabetically; mtime if journal |
| normal | <Leader>nm | List with prefixed date modified, sorted by mtime |
| normal | <Leader>nc | List with prefixed date created (YYYY/WeekXX), sorted by ctime |
| normal | <Leader>nk | List all links related to active note (or all if none) |
| normal | <Leader>ns | Full text search with prefixed note title |
| normal | <Leader>nW | Opens browser with embedded web/app (auto stop webserver on idle) |
| finder | C-j ↓ | Select next entry (down) |
| finder | C-k ↑ | Select previous entry (up) |
| finder | C-/ | Toggle preview |
| finder | Enter | Submit selected entry |
| finder | Esc | Dismiss finder |
| normal | ge | Open the link under the cursor (vim-markdown) |
| normal | [[ ]] | Jump back and forward between headings (vim-markdown) |
Finder search syntax
| Token | Match Type | Comment |
|---|---|---|
word | exact-match | Items that include word |
^word | prefix exact-match | Items that start with word |
word$ | suffix exact-match | Items that end with word |
!word | inverse exact-match | Items that do not include word |
!^word | inverse prefix exact-match | Items that do not start with word |
!word$ | inverse suffix exact-match | Items that do not end with word |
foo bar | multiple exact match (AND) | Items that include both foo AND bar |
foo | bar | multiple exact match (OR) | Items that include either foo OR bar |
'sbtrkt | fuzzy-match | Items that fuzzy match sbtrkt |
Related Vim settings
" 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