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

How to chain obcommands and/or vim commands

Open thor314 opened this issue 2 years ago • 3 comments

When chaining vim commands, I would do something like:

nmap T dawbP

I'd like to chain vim commands with obcomminds, something like the following:

exmap insert_time obcommand insert-current-time 
nmap <A-;> :insert_time :insert_time
" or
nmap <A-;> I##<esc> :insert_time

This doesn't work however. Is there a way to do so?

thor314 avatar May 25 '22 23:05 thor314

The CodeMirror Vim module doesn't support it :( But I'll add it as a feature request to make a "command chaining" Ex command.

esm7 avatar Jun 01 '22 12:06 esm7

As a workaround, the Commander plugin can be used to create macros, and those can then be bound to vim commands after you figure out what they are from the hotkeys.json by assigning something temporarily: image

exmap linktab obcommand cmdr:macro-0
nmap gd :linktab

micimize avatar Mar 04 '24 03:03 micimize

@esm7 CodeMirror now supports chaining commands and motions after commands. Are there any plans to update the plugin to use a newer version of CM6?

https://github.com/replit/codemirror-vim/issues/148

mattcoleanderson avatar Apr 05 '24 21:04 mattcoleanderson