Thank you. Yeah thats a better implementation. I didnt know you can listen to it.

Is there any way to put j k navigation in document view mode? Wildly annoying in viewing mode that you can not use VIM combinations to navigate the document. I would really appreciate your help.

Do you mean use Vim keybindings in Markdown Preview mode (e.g. for scrolling)? AFAIK the Markdown preview is an entirely different component, it’s like adding Vim bindings to a web browser (like Vimium etc.)
If that’s what you mean then it’s definitely possible for a plugin to catch these keys and make them scroll but I think this needs to be a different plugin.

1 Like

I understood. Thanks.

1 Like

@esm90
Thank you so much for your effort creating the plugin.
I’m really sorry, but I’m having trouble locating/creating the vimrc file.

Can you kindly advise how I maybe able to address this issue?

Thank you!

you have to create a file called .obsidian.vimrc in your obsidian vault (in the same folder where all your obsidian notes are created)
This will be a hidden file, if you turn on the community plug in, it should read it.

That’s the long story short, if you still have trouble let us know!

2 Likes

I have no idea if this is technically feasible, but adding ctrl-p and crtl-n for autocomplete backwards and forwards would be wonderful.

Dear @santi,
Thank you for your kind response!
I think the part I am struggling is the more rudimentary (and novice) issue with actually creating a .obsidian.vimrc file. I don’t know how to make the file in the first place :joy:
Would there a command prompt that I run?

Thank you so much for your time and support!

1 Like

No worries @hanjae87 , it’s a hidden file which makes it confusing.

It’s a file at the same level as .obsidian (root folder with the rest of your notes)

It follows the same concepts as the .obsidian folder, but the .obsidian.vimrc is a file not a folder.

I wrote a blogpost on .obsdian so it’s not exactly the same, but it will definitely help you out

Let me know if you got any questions, since I know these things can be confusing

1 Like

Dear @santi,
Thank you for the explanation!
Unfortunately, I still can’t seem to find the .vimrc file anywhere.
I turned on the option to view hidden files as well.
Would I need to create/touch this file or is it automatically created?

The odd thing is I see the .obsidian file whether or not I have the option to view hidden files toggled on or off.

Thank you again!
HJ

1 Like

No worries, so you need to create the file. It won’t be there by default.

It has to be named .obsidian.vimrc

Let me know if it worked for you

Dear @santi,
I created the vimrc via vscode, and it is working like a gem now!
Thank you so much for your support!!
HJ

1 Like

perfect happy to know you got it working!

Replying to myself: the Autocomplete plugin by Yeboster does exactly this, and it’s great.

Hi santi, I’ve been trying to get my escape key mapped to jk. It is something that I’m familiar with - I have inoremap jk <esc> mapped in my .vimrc file, and map jk <Esc> in my .ideavimrc for PyCharm.

For some reason, I’m struggling to get it working with Obsidian.

I’ve followed the instructions so that:

  1. Editor → Vim Key Bindings is Enabled.

  2. Comunity Plugins → Vimrc Support is Enabled

  3. In the root of my vault, I’ve created a file called .obsidian.vimrc and inside this file I have just these two lines

imap jk
imap jk

  1. Restart Obsidian (v.0.12.3)

Is there a step that I am missing?

Thanks.

Resolved - I was editing .obsidian.vimrc on my vault that was located in a different location.

I have the same vault on DropBox and iCloud. I recently moved it to iCloud so that I can continue to work on Obsidian mobile … Anyway, I was making a change to.obsidian.vimrc on my Dropbox vault, but opening up the vault on iCloud.

For others that may encounter this issue, one of the things I found helpful was to type in the command in obsidian.

So, in obsidian, I typed in : imap jk <Esc> and verified that this worked. When it did, I found it strange that the change was not persistent when obsidian restarted. So that’s when I realized that the change I made was not the right .obsidian.vimrc file.

1 Like

Just putting this solution to a common problem here so that it can be found.

On Windows, Ctrl-C needs to be remapped to make it copy selected text in vim mode. Several people recommend putting unmap <C-c> into the .obsidian.vimrc file but that does not work.

What works is iunmap <C-c> — the troublesome mapping is only operative in insert mode, so you need to unmap it with a preceding i

1 Like

Sorry,I am working on the Windows, but I Set “Vimrc file name” = “C:\Users\ryanzhuo.obsidian.vimrc”, i put the file named “.obsidian.vimrc” which has been written “set clipboard=unnamed”, but it didn’t work.

anybody can tell me what’s wrong in my settings?

Yes: if you typed C:\Users\ryanzhuo.obsidian.vimrc literally, it won’t work. You need to set the vimrc file name to C:\Users\ryanzhuo\YOURVAULTNAME\.obsidian.vimrc — with a slash after ryanzhou\YOURVAULTNAME and a period after that. (assuming that your vault isn’t just called ryanzhou!)