How can I activate the vim mode using the CodeMirror plugin with Tiddlywiki?

148 views
Skip to first unread message

Rafael Oliveira

unread,
Jul 28, 2020, 12:06:11 AM7/28/20
to tiddl...@googlegroups.com
Hi,

I'm willing to edit my tiddlers using the vim mode. I found out that for doing that on tiddlywiki I need to install the CodeMirror plugin because it has a vim mode. Basically, I've read this documentation page:


Then I installed CodeMirror on my tiddlywiki by dragging and dropping $:/plugins/tiddlywiki/codemirror into my local tiddlywiki. I've found this other post where the same question is asked but my level is more basic than this one. What is the procedure I have to execute after dragging and dropping $:/plugins/tiddlywiki/codemirror on my tiddlywiki page? I know I can access its configurations going to the control panel/Plugins but I didn't manage to figure out what I need to do there? How can I activate the vim mode? Do I need to install extra addons after installing CodeMirror? If yes, how can I do it?


Rafael Oliveira

unread,
Jul 28, 2020, 2:20:07 AM7/28/20
to TiddlyWiki
Well, after two hours searching for a solution I've realized that I can install the codemirror addons just by dragging and dropping the ones that I see on the official TiddlyWiki page:
Screenshot from 2020-07-28 03-10-58.png















But the problem now is that on the official page there's only the sublime addon and not the vim addon... I know I can get the javascript code on the codemirror page https://codemirror.net/keymap/vim.js but I didn't manage to figure out how I can make it a vim plugin on my tiddlywiki. Is there any page where I can get this addon ready for using? I think my only missing point here is where I can get this vim addon file...

bimlas

unread,
Jul 28, 2020, 2:36:54 AM7/28/20
to TiddlyWiki
Instead of CodeMirror, you can even use NeoVim itself, which is not just an emulator, but literally a Vim with your own config: https://github.com/glacambre/firenvim/

Rafael Oliveira

unread,
Jul 28, 2020, 2:51:24 AM7/28/20
to tiddl...@googlegroups.com
Hi bimias, thanks for the reply... I already use the firenvim and it's a great tool :)

But in this case I'd like to use a client solution just so I can access the vim mode with a TiddlyWiki page that's public on the internet. Even if it means having a vim mode with limitations comparing to the real one...

Saq Imtiaz

unread,
Jul 28, 2020, 3:01:23 AM7/28/20
to TiddlyWiki
In your TiddlyWiki, go to settings, Control Panel, Plugins.
Click on Get more plugins and then Open Plugin library.

You can install all the official plugins and their addons here.

tony

unread,
Jul 28, 2020, 3:15:26 AM7/28/20
to TiddlyWiki
Steps, just tested:
  1. Download empty.html from https://tiddlywiki.com/#GettingStarted 
  2. Open the $:/ControlPanel tiddler
  3. Click the plugins tab then Get more plugins button
  4. Search for codemirror
  5. Click install button for CodeMirror: CodeMirror editor and CodeMirror Keymap Vim: Keymap compatible with Vim for CodeMirror
  6. Save and refresh when prompted by banner dialog
  7. Open the $:/ControlPanel tiddler
  8. Click the Settings then Codemirror tab
  9. Under CodeMirror keymap select vim in the dropdown control
  10. Optional: check Enable line numbers, cuz it looks cool
  11. Save and refresh the wiki
  12. Test by creating a new tiddler and in edit mode, line numbers should be showing as a visual indicator of success
  13. I use Ctrl-c to return to normal mode
Have fun!

Best,
tony

Rafael Oliveira

unread,
Jul 28, 2020, 12:18:56 PM7/28/20
to tiddl...@googlegroups.com
Thanks for the responses... I've managed to install vim mode but I'm still facing two issues:

1- For some reason when I open Control Panel/Plugins/Get more plugins I don't see any plugin available on the my TiddlyWiki installed with node.js:


It looks like a bug because even if I create a new notebook with tiddlywiki newnotebook --init server and start it as a new server I won't be able to manage the plugins. Does anyone know what could be happening?
I'm running the TiddlyWiki 5.1.22, node.js v12.16.2 and Ubuntu 18.04. (The way I managed to make it work was by downloading the TiddlyWiki html on the official page and  installing the plugins on it. Then I was able to drag and drop the addon to my node.js version. But that's not an ideal solution.)

2- Even though the vim mode is working I'm not able to see the cursor of the line on it. Is there a different addon that I have to add to make it possible? The problem is the following:


I can activate the highlighting of the line on the option Highlight active line but I cannot see the position of the cursor on the line. That makes vim unusable. I've tried changing the themes to check if it was a conflict but it didn't work... Is it the way it's supposed to work?



Saq Imtiaz

unread,
Jul 28, 2020, 12:20:41 PM7/28/20
to TiddlyWiki
There's a different process for installing plugins on node:


On Tuesday, July 28, 2020 at 6:18:56 PM UTC+2, Rafael Oliveira wrote:
Thanks for the responses... I've managed to install vim mode but I'm still facing two issues:

1- For some reason when I open Control Panel/Plugins/Get more plugins I don't see any plugin available on the my TiddlyWiki installed with node.js:


I looks like a bug because even if I create a new notebook with tiddlywiki newnotebook --init server and start it as a new server I won't be able to manage the plugins. Does anyone know what could be happening?
I'm running the TiddlyWiki 5.1.22, node.js v12.16.2 and Ubuntu 18.04. (The way I managed to make it work was by downloading the TiddlyWiki html on the official page and  installing the plugins on it. Then I was able to drag and drop the addon to my node.js version. But that's not an ideal solution.)

Mark S.

unread,
Jul 28, 2020, 12:32:08 PM7/28/20
to TiddlyWiki
Unfortunately, the method you use to get plugins for node isn't as convenient. You need to make entries in your tiddlywiki.info file to activate the plugins.

Once you have the plugins installed, you need to go into your configuration, click on the codemirror tab, and select "vim" as your keyboard mapping. After that a green block cursor will appear to show that you're in Vim mode. You will probably also want to configure your keyboard shortcuts if you are addicted to using "escape" to change modes.



On Tuesday, July 28, 2020 at 9:18:56 AM UTC-7, Rafael Oliveira wrote:
Thanks for the responses... I've managed to install vim mode but I'm still facing two issues:

1- For some reason when I open Control Panel/Plugins/Get more plugins I don't see any plugin available on the my TiddlyWiki installed with node.js:


I looks like a bug because even if I create a new notebook with tiddlywiki newnotebook --init server and start it as a new server I won't be able to manage the plugins. Does anyone know what could be happening?
I'm running the TiddlyWiki 5.1.22, node.js v12.16.2 and Ubuntu 18.04. (The way I managed to make it work was by downloading the TiddlyWiki html on the official page and  installing the plugins on it. Then I was able to drag and drop the addon to my node.js version. But that's not an ideal solution.)

Rafael Oliveira

unread,
Jul 28, 2020, 3:24:56 PM7/28/20
to tiddl...@googlegroups.com
I see, so the procedure is different when I use it on node.js... My only issue now is the green block cursor that is not appearing in my case. Could it be a problem with the node.js version as well?

Mark S.

unread,
Jul 28, 2020, 5:13:31 PM7/28/20
to TiddlyWiki
Did you activate the vim keymapping?

Rafael Oliveira

unread,
Jul 28, 2020, 6:19:11 PM7/28/20
to tiddl...@googlegroups.com
Do you mean changing the option CodeMirror keymap from default to vim? I've only activated this option after installing the plugin... In general vim commands are working fine, the only problem is that I'm not seeing a green block cursor showing where I am (on edit mode, the insert mode works fine). It's like using vim in a blind way because I can't see the word that I'm currently editing.

Mark S.

unread,
Jul 28, 2020, 6:52:12 PM7/28/20
to TiddlyWiki
Also, you have to save and reload before the plugins become active. But you probably knew that.

On Tuesday, July 28, 2020 at 3:19:11 PM UTC-7, Rafael Oliveira wrote:
Do you mean changing the option CodeMirror keymap from default to vim? I've only activated this option after installing the plugin... In general vim commands are working fine. the only problem is that I'm not seeing a green block cursor showing where I am (on edit mode, the insert mode works fine). It's like using vim in a blind way because I can't see the word that I'm currently editing.

Rafael Oliveira

unread,
Jul 28, 2020, 8:05:09 PM7/28/20
to TiddlyWiki
It worked now! The reload part I had done before but it didn't work too... Honestly, I don't know what was the problem. I just erased everything I had installed from codemirror and did it again from zero. After that it worked. I think it was some conflict between plugins because I had installed a lot of codemirror stuff while I was trying to make the vim mode work.

Thanks again for the responses!
Reply all
Reply to author
Forward
0 new messages