I’m a noncoding writer who had/has a comfortable configuration of MacVim for writing on my notebook. The promise of Vim with Obsidian is powerfully appealing, but it continues to elude me.
Things I have tried
j and k are configured to move down/up a screen width line. I don’t remember a problem with them, but yesterday I could not predict what they would do.
I’ve appealed for help getting H and L configured to ^ and $ and jj to <Esc> But none of the much appreciated suggestions have worked.
This is my minimalist .vimrc:
set clipboard=unnamed
inoremap jj <Esc>
nnoremap <Up> gk
nnoremap k gk
nnoremap <Down> gj
nnoremap j gj
nnoremap H g^
nnoremap L g$
I sense many have been able to get this and much more working. Explanations/insights/suggestions appreciated.
set clipboard=unnamed
imap jj <Esc>
nmap k gk
nmap j gj
nmap H g^
nmap L g$
I also moved my .vimrc. I had it in the .obsidian folder in the Obsidian root folder. I moved it to the .obsidian folder in my vault.
None of those mappings seem to be working.
jj enters jj. j and k move the cursor from either the first character in a paragraph or the last position of the cursor and either the next blank line or last blank line. H and L move the cursor to the top or bottom of the file.
Things that seem to be working for others are not working for me.
Hallelujah! Two changes: changed the name of my .vimrc to .obsidian.vimrc; moved the renamed file from the .obsidian folder in my vault into the vault itself, i.e., on the same level as my md files. All my mappings, including of <Esc>, work.
I thought that when people wrote .obsidian.vimrc they meant the .vimrc in the .obsidian folder. So all this time–it’s been a couple weeks at least that I’ve struggled with my vim keybindings–the problem was the name and the location of the file.