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
santi
October 24, 2020, 7:30pm
40
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
santi
October 24, 2020, 11:54pm
42
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.
I spent some time playing around with the temporary Volcano plugin loader for Obsidian, and figured it’s actually very easy to make this Vimrc feature happen!
So no guarantees whatsoever, but the following seems to work (I called it vimrc.js under ~/volcano/plugins):
class VimrcLoader {
constructor() {
this.id = 'vimrc-loader';
this.name = 'Vimrc loader plugin';
this.description = 'Auto-loader for Obsidian Vim commands on startup.';
this.defaultOn = true; // Whether or not to enable t…
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
santi
October 25, 2020, 12:11am
44
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
santi
November 2, 2020, 12:11pm
47
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
santi
November 2, 2020, 8:15pm
50
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
willcan
December 4, 2020, 2:37pm
55
For some reason my imap jk <esc>
worked for a minute and now just deletes the jk
and remains in insert mode. Any ides?
jtmusky
December 16, 2020, 7:38pm
56
imap jj <Esc>
is working for me. Using Obsidian 0.10.0
2 Likes
jtmusky
December 16, 2020, 8:16pm
57
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.
1 Like