kis9a / vimsidian

Vim plugin for PKM like obsidian.md
Do What The F*ck You Want To Public License
55 stars 0 forks source link

vimsidian

Vim plugin to help edit Obsidian notes in Vim. Links, backlink resolution and jumps, search and completion and highlighting. Even if you don't use Obsidian, you can use it to manage your notes locally.

This plugin was made for me, but I hope it will be useful for those who want to easily edit Obsidian notes with vim as I do. If you have trouble using it, please post an issues below. Contributions, edits and distribution are also welcome.


Motivation

In my earlier days, I used to divide notes in directories and manage note relationships by describing relative paths. However, I had trouble categorizing notes and spent a lot of time resolving note paths. I needed to achieve the following.

For me, vimsidian is the plugin that solves these issues and complements my PKM (personal knowledge managment).

Features

Extensions

Initialization

Requirements

Installation

Use your favorite plugin manager.

Plug 'kis9a/vimsidian'

Configuration

  1. make .obsidian file or directory in your obsidian vault directory.

If the current working directory contains a .obsidian file or directory, it will be recognized as an Obsidian vault.

  1. configure mappings

~/.vim/ftplugin/vimsidian.vim

if exists("b:loaded_vimsidian_ftplugin_mappings")
  finish
endif
let b:loaded_vimsidian_ftplugin_mappings = 1

nnoremap <silent> <buffer> <C-k> :VimsidianJump<CR>
nnoremap <silent> <buffer> <2-LeftMouse> :VimsidianJump<CR>
nnoremap <silent> <buffer> sk :VimsidianPrevLink<CR>
nnoremap <silent> <buffer> sj :VimsidianNextLink<CR>
nnoremap <silent> <buffer> sl :VimsidianFindLinks<CR>
nnoremap <silent> <buffer> sg :VimsidianFindBacklinks<CR>
nnoremap <silent> <buffer> st :VimsidianFindTags<CR>
nnoremap <silent> <buffer> sN :VimsidianSearchNotes<Space>
nnoremap <silent> <buffer> sL :VimsidianSearchLinks<Space>

autocmd WinEnter,BufEnter <buffer> silent! VimsidianMatchBrokenLinks
autocmd CursorMoved <buffer> silent! VimsidianMatchCursorLink
Use fzf to list note names
Open listings using fzf instead of quick fix window. See fzf installation at ```vim # e.g Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' if executable('fzf') let g:vimsidian_use_fzf = 1 endif ```

Help

See Vim doc - Syntax highlight, Variables and Commands help

:h vimsidian

Developments

If you contribute to this repository, please use the following tools for linting and testing
### Linting Use [vim-parser](https://github.com/ynkdir/vim-vimlparser), [vim-vimlint](https://github.com/syngan/vim-vimlint) ``` make init make lint ``` When using [vint](https://github.com/Vimjas/vint) ``` make vint-int make lint-vint ``` ### Testing Use [vim-themis](https://github.com/thinca/vim-themis/issues), CI [.github/workflows/test.yml](./.github/workflows/test.yml) ``` make init make test ```

LICENSE

WTFPL license - Do What The F*ck You Want To Public License