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

Ability to save macros in .vimrc

Open Vilhelm-Ian opened this issue 1 year ago • 3 comments

Please make sure this feature request is within the scope of this plugin.

  • [ x ] I understand that if my request is about supporting some Vim feature, it probably belongs here.

Describe the feature that you'd like:

A clear and concise description of what you want to happen. let @a = "dw"

Additional context:

Add any other context or screenshots about the feature request here.

Vilhelm-Ian avatar Sep 10 '22 05:09 Vilhelm-Ian

I found a workaround. You can bind vim with singular commands and then use the "shell commands" community plugin to run a zsh script that keystrokes your vim binding for you, and this plugin has the ability create hotkeys which you can use obcommand for.

Serralq avatar Sep 28 '22 01:09 Serralq

why don't you just bind this to a keymap? eg nmap A dw or maybe it's nmap <S-a> dw

tjex avatar Mar 24 '23 14:03 tjex

Some macros are more complex than that. For example, in my normal .vimrc I have a macro to surround a single word with code quotes, as follows:

let @c='i`^[wea`^['

where ^[ is the special escape character, entered using ctrl+v -> esc.

Currently, every time I launch obsidian I have to save it manually into the reg, since I use it so much. This feature would be extremely useful, since I have plenty more macros like this one coming from my time using vimwiki. Thanks.

0xjmux avatar Jul 10 '23 22:07 0xjmux