Is it possible to make the vim mode from codemirrror remember a vim macro created on a different tiddler?

65 views
Skip to first unread message

Rafael Oliveira

unread,
Jul 29, 2020, 5:08:23 PM7/29/20
to tiddl...@googlegroups.com
When I use the vim mode with codemirror on a tiddler I can successfully create vim macros while I'm inside it. However, after saving that tiddler and opening a new one the editor completely forgets the previous macro that I had created... Is there any way I can force TiddlyWiki to remember a previous macro that I have created on a different tiddler? So I can reuse a fast created macro on different tiddlers?

Mark S.

unread,
Jul 29, 2020, 7:01:52 PM7/29/20
to TiddlyWiki
What do you mean by "remember a macro" ? Do you mean remember a (vim) register?

A macro in TW is just a bit of text defined at the top of a tiddler :

\define mymacro()
do stuff
\end

Vim doesn't know anything about TW macros, per se.

You can make the macro available everywhere by marking the tiddler as containing a global macro using the special tag $:/tags/Macro


Rafael Oliveira

unread,
Jul 29, 2020, 7:54:40 PM7/29/20
to TiddlyWiki
Ah yeah... I meant remembering the vim register just so I can execute this vim macro again on a different tiddler. Let's say I create a macro inside the register a, I'd like to be able to execute it with @a on a different tiddler...

I still don't know a lot about TW macros actually :)

Mark S.

unread,
Jul 29, 2020, 8:20:14 PM7/29/20
to TiddlyWiki
I just posted a question "Is there a way to save and update a tiddler without closing it?"
and got a good answer from Mat.

Once you close a tiddler, you lose your vim settings. But the solution mentioned in the other thread will allow you to save the tiddler without closing the tiddler. This will allow you to extend your Vim working day, only occasionally having to close out tiddlers. Well, I think it will. I haven't tried it yet (https://tid.li/tw5/plugins.html#%24%3A%2Fplugins%2Ftelmiger%2FEditButtons)

For marking text, I sometimes put in an html mark like <!-- bookmark a --> and then use the vim search routine to quickly find the text and set my bookmarks again.

Back in the good old days, there was an extension called "It's all text" which allowed you to edit the contents of a tiddler in an actual Vim editor and then, when it closed out, put the text back into the tiddler.

Rafael Oliveira

unread,
Jul 29, 2020, 9:02:06 PM7/29/20
to tiddl...@googlegroups.com
Thanks. The plugin worked fine :)

Good thing that it keep the registers while the tiddler is still open for this workaround to work. But which vim command are you using to distribute your html bookmarks inside the registers as markers?

About the old extension... Have you already checked firenvim working with neovim? It's a browser extension that opens neovim on the top of any text editor on the web. It's worth checking it :)

TW Tones

unread,
Jul 29, 2020, 10:30:46 PM7/29/20
to TiddlyWiki
Rafael

I am not longer a vim user since the 80's when I learned Vax mini computers.

However if your macros within vim session are defined using a set of keystrokes, you could have a list in the sidebar, where you can drag and drop the macros you want on to your vim session, which the payload would be the text/keystrokes to define your macros. 

Regards
Tony
Reply all
Reply to author
Forward
0 new messages