How to create an “obsidian.vimrc”
Step: download the plugin “obsidian-vimrc-support” (link)
Step: create an “.obsidian.vimrc” file in your iCloud folder for obsidian
- Note: you will see an “.obsidian” file in the same folder
- If you are on a Mac you can drag the folder from the finder into iTerm
Here are some mappings:
- “fd” to escape vim
- “za” to toggle folds
" https://github.com/esm7/obsidian-vimrc-support/issues/4
imap fd <Esc>
" https://stackoverflow.com/questions/9713967/how-can-i-intuitively-move-cursor-in-vimnot-by-line/9713982#9713982
:nmap j gj
:nmap k gk
" https://forum.obsidian.md/t/what-are-the-fold-unfold-keybinds-in-vim-mode/3133
exmap unfoldall obcommand editor:unfold-all
nmap zR :unfoldall
exmap foldall obcommand editor:fold-all
nmap zM :foldall
exmap foldtoggle obcommand editor:toggle-fold
nmap za :foldtoggle