obsidian-vimrc-support icon indicating copy to clipboard operation
obsidian-vimrc-support copied to clipboard

Unable to remap `cc`

Open twio142 opened this issue 3 years ago • 1 comments

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?

twio142 avatar Apr 07 '22 10:04 twio142

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

esm7 avatar Apr 07 '22 10:04 esm7