obsidian-vimrc-support
obsidian-vimrc-support copied to clipboard
`"+y`, `"+p`, etc. support
Currently we have the option to always yank, paste, etc. from the system clipboard by adding
set clipboard=unnamed
or
set clipboard=unnamedplus
However, there is no way to make vim work normally, where "+ means system clipboard and without that, CodeMirror Vim just uses it's default buffer.
This is a very very minor quality-of-life feature, so I won't blame you at all if you prioritize basically any other feature over this one.
That's not something that can be implemented here.
https://github.com/esm7/obsidian-vimrc-support/pull/107#issuecomment-1172909748
A basic implementation of the plus register is available in codemirror-vim (and also in Obsidian‘s version of it), so this issue can be closed.
I can see that it is implemented in obsidian, e.g., "_dd will delete the line without being added to the register or the clipboard for that matter if set clipboard=unnamed. However, how can I add that to a mapping, so d deletes without yanking. I tried nmap/map/noremap d "_d, but it doesn't work.
Thanks in advance!
+1 to this, I saw in a different thread that noremap is supported, but it isn't working for this specific usecase
Is there a way to save the content to some random register that I can ignore if nmap d "_d does not work ?
For deleting lines (edit: without saving the line to the clipboard), I found a work around that consists of using the "code editor shortcuts" plugin (as with any plugin use at your any risk) and defining dd to run the deleteLine command there. This forced me to unmap d but I can use ctrl+backspace in insert mode for deleting words and accept to use c for everything else with the same issue of it copying to the clipboard.
After installing and enabling the code editor shortcuts plugin
One can add this to their vimrc file
unmap d
exmap delL obcommand obsidian-editor-shortcuts:deleteLine
nmap dd :delL