esm7 / obsidian-vimrc-support

A plugin for the Obsidian.md note-taking software
MIT License
1.11k stars 52 forks source link

Unable to remap `cc` #92

Open twio142 opened 2 years ago

twio142 commented 2 years ago

It has always bothered me that using cc inside of a list, it clears the whole line including the list index - or 1.. So I wrote my own JS snippet to clear the current line just after those -, 1., >, - [x] and whatsoever. It works as expected (tested in Obsidian interactively), but I'm having trouble mapping it in the .vimrc file.

Here's my .vimrc:

unmap cc
exmap clearLine jsfile mdHelpers.js { clearLine() }
nmap & :clearLine
nmap cc &a        " In order to enter insert mode after the line is cleared

It does not change the behaviour of cc. Yet the same mapping with some other key instead (i.e. gc) works perfectly. Any idea how to fix that?

esm7 commented 2 years ago

Seems like the CodeMirror Vim integration doesn't allow to map cc, among its many strange quirks :shrug: