VIM Mode - Quality of Life Improvements

If you’re like me who’s new to Obsidian and can’t write anywhere else without Vim keybindinds, my current solution is to add a shortcut to Open in Default App (which the extension .md is set to Vim).

After that, when you want to write, trigger the hotkey and write in the real Vim. I know it’s not pretty but it’s the only want I can write without typing jk over and over and over.

2 Likes

I managed to cofigure vim mode to work really nice in obsidan, I’ve taken notes on some fixes for Linux and Mac.

What is it that’s not working in your obsidian vim mode, I might be able to help.

Does holding down one of the hjkl keys not work for you?

holding down one of the hjkl keys

@santi if you’re replying to kohane27 typing “jk”, I presume they are mapping the key sequence “jk” to <ESC> in insert mode in Vim, which is a common ergonomic trick. It’s not about navigating or repeatedly pressing j or k.

2 Likes

Hey @rigmarole yeah forgot to tag @kohane27 on my reply

Got you, thanks for the clarification. I thought jk was referring to pressing and holding j or k

I wasn’t familiar with that way of using escape. I’ve tried fd and currently I useCAPSLK

but what I can recommend is this volcano plug in (linked below) for setting up an .obsidian.vimrc to configure it

I currently have this settings

nmap j gj
nmap k gk

and it works great so far.

2 Likes

@santi

Apologies for my lack of clarity! Yes I meant remapping jk for Escape in Vim.

@rigmarole thanks for clearing that up!

1 Like

no worries, @kohane27 give that plug in a try, I think it might be what you need

My vim feature request: using ‘o’ should insert the - [ ] or whatever block you’re in. Not necessary, but would rule.

1 Like

This one is crucial for me. Added matchbrackets.js manually and it seems to work fine. Asked developers to added in next versions. If not, will provide a plugin which adds this file.

1 Like

that’s be awesome @mrjackphil in the mid-time do you have the matchbrackets.js to put on the console?

I use Ctrl+C or Ctrl+[ for esc on vim-mode. F.Y.I.
It would be hoped to use vim-mode feature for search, command palette, open note, …

1 Like

It’s here

1 Like

thank you @mrjackphil it works great, hope it’s implemented with the next update of obsidian, if not a plug in would be amazing thanks!!

1 Like

I use :imap jj

This has be be applied with every session though.

I use this plugin https://github.com/esm7/obsidian-vimrc-support to load imap jj <Esc>. It works great for me.

3 Likes

I was missing matchbrackets functionality so much so did a plugin

3 Likes

For some reason my imap jk <esc> worked for a minute and now just deletes the jk and remains in insert mode. Any ides?

imap jj <Esc> is working for me. Using Obsidian 0.10.0

2 Likes

thank you for providing this plugin

imap jk <ESC> deletes jk without exiting insert mode for me on OSX with Obisidan 0.10.6 and the obsidian-vimrc-support plugin

EDIT Changing this to imap jk <Esc> did the trick

1 Like

If I can use Vim navigation keys like j, k, ctrl+u, ctrl+d and search using /word in preview mode would be great. :smile:

1 Like