It is not my script, I found in in the internet, but because it is codemirror, you can use it in obsidian as well. I didnt make a public plugin, because I am not sure with the rights and so on with this script.
To use it you have to
- create you own plugin with this template
- put the
yank.ts in your plugin folder
- register it with
this.registerEvent(this.app.on('codemirror', (cm: CodeMirror.Editor) => {
CodeMirror.Vim.defineOperator("yank", yankGenerator(CodeMirror.Vim.getRegisterController(), true))
}));
somewhere in your main.ts
Honestly I dont know what the last argument stands for, I noticed no differene between true and false, but it works. EDIT: I found some info, but I guess true is the right choice.
It will throw some types error, because it cant find Vim and so on, but I guess it is just not well documentated.