esm7 / obsidian-vimrc-support

A plugin for the Obsidian.md note-taking software
MIT License
1.1k stars 51 forks source link

How to chain obcommands and/or vim commands #102

Open thor314 opened 2 years ago

thor314 commented 2 years ago

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?

esm7 commented 2 years ago

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

micimize commented 8 months ago

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
mattcoleanderson commented 7 months ago

@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