VIM Mode - Quality of Life Improvements

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

Here’s my latest struggle: I can navigate to the link under the cursor with Alt+Enter, but when I try to remap this using the following command, it doesn’t work. :frowning:
nmap gd <A-CR>

Anyone have any luck remapping this?

3 Likes

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

Hi, holdiing down j/k/l/h for moving the cursor indeed does not work for me. I have to resort to f command to move around in the same line.
Do you know any fix for this while we all waiting for the neovim backend?

1 Like