vim help

163 views
Skip to first unread message

kelsang sherab

unread,
Feb 2, 2017, 5:11:19 PM2/2/17
to TiddlyWiki
on linux
the whereis command retruns:


whereis vim
vim: /usr/bin/vim /usr/bin/vim.tiny /usr/bin/vim.basic /etc/vim /usr/share/vim /usr/share/man/man1/vim.1.gz


 the which  command returns

 /usr/bin/vim

I added the path to the firefox addon its all text
and when i try working with it here's what firefox returns:

I ran this command: /usr/bin/vim /home/sherab/.mozilla/firefox/mwad0hks.default/itsalltext/tiddlywiki.com_.1w1x371h.txt

...and it exited with a status of 1.

any ideas what to do?

Also any advice on how to use TW with vim?

I know there is a plug in but it says to add it to vim/syntax/
and i just cannot find /.vim/syntax.
cheers
 


Danielo Rodríguez

unread,
Feb 2, 2017, 5:32:43 PM2/2/17
to TiddlyWiki
yes,there is a plugin, codemirror.But it has a big problem: the ESC key discards the current tiddlers being edited . You can workaround this using a different keyboard shortcut for exiting edit mode (like KK for example )

tony

unread,
Feb 3, 2017, 3:36:48 AM2/3/17
to TiddlyWiki
Hi,

This is what i do to use vim as the editor for long tiddler bodies or run a quick s/find/replace/g

Using vim as one editor helps me keep continuity working between TiddlyWiki and VimWiki

On windows cygwin, you can call vim directly with the path to the vim.exe in the ItsAllText preferences just like you normally do.

I don't remember the path offhand.

but if I'm on my Chromebook running Linux via Crouton

I make a shell script, called say editor.sh

Where editor.sh is 

#!/bin/bash /usr/bin/xfce4-terminal -e "vim '$1'" 

I then put the path to this editor.sh script in the ItsAllText preferences 
in my case it is 

/home/<myusername>/editor.sh

Basically the script just tells the terminal to open vim and is called by ItsAllText as set in the preferences.

Depending on your setup you may need to substitute with the name of your terminal 

Other configs are found here:

hth

Best,
tony

tony

unread,
Feb 3, 2017, 3:44:06 AM2/3/17
to TiddlyWiki
Opps forgot to mention

Once you create the editor.sh script, make it executable by

$chmod +x ~/editor.sh

Then add the path to this editor.sh in the ItsAllText preferences


Best,
tony

kelsang sherab

unread,
Feb 3, 2017, 11:53:39 AM2/3/17
to TiddlyWiki
Hi Danielo

Did you mean this http://www.vim.org/scripts/script.php…?

I dropped it in my TW but am not sure what next?

Any ideas?
Cheers

tony

unread,
Feb 3, 2017, 3:06:47 PM2/3/17
to TiddlyWiki
Hi

You don't need vim installed if you go the CodeMirror route to get vim bindings
Ex commands like s/find/replace/g will work but you won't get full vim usage of your .vimrc

CodeMirror is still good though :-)
The standard ctrl-c and ctrl-[ binds to ESC switching normal and insert modes

Do this

Install the CodeMirror plugin from control panel > plugins tab > get more plugins button

Go to $:/plugins/TiddlyWiki/CodeMirror/usage

Which will tell you to make a config json tiddler called:

$:/config/CodeMirror

Set field type as application/json in the type field drop down

In the body of your $:/config/CodeMirror use the for example configuration in the $:/plugins/TiddlyWiki/CodeMirror/usage
Note it has vim and emacs key bindings to lessen flame wars ;-)

That's it

Open up a new tiddler in edit mode, you should see a blinking green cursor in normal mode vim

If you want to set what type of tiddler gets what kind of EditorType go to ControlPanel > Info > Advanced > EditorTypes to edit the Editor value to either text or CodeMirror

hth

Best,
tony

kelsang sherab

unread,
Feb 3, 2017, 4:26:43 PM2/3/17
to TiddlyWiki

Cheers Tony!!
Will give it a try.

many thanks for helping

kelsang sherab

unread,
Feb 3, 2017, 4:55:34 PM2/3/17
to TiddlyWiki
Hi again tony.
This worked!!!
Cheers!!!

kelsang sherab

unread,
Feb 3, 2017, 5:00:40 PM2/3/17
to TiddlyWiki
Hi Tony
A question.
After my success with the vim on it'salltext, I'd rather not use the codemirror plugin.
I'd like to use the vim.
but what I realized is that I am using my TiddlyDesktop for my work, more than the web browser.
Can vim be used with TDesktop? or only with browser editing?

Cheers for your patience:-)

On Friday, February 3, 2017 at 9:06:47 PM UTC+1, tony wrote:

tony

unread,
Feb 3, 2017, 8:40:17 PM2/3/17
to TiddlyWiki
Sorry Kelsang Sherab

I'm not familiar with TiddlyDesktop TD but it looks like an app wrapper for node js version of TiddlyWiki if TD is serving html files then vim will only work if ItsAllText plugin can be installed in TD as it works on the text area tiddler body. I don't think that will work since ItsAllText doesn't even support Chrome
If TD exposes tiddlers as plain text .tid files then vim can edit if you have access to the folder structure.
Else TD only supports vim functionality via CodeMirror vim key bindings

I vaguely recall early on getting node js working with CodeMirror or ItsAllText to test calling TW node as a VimWiki wiki but now I just use TW in the Firefox browser and/or VimWiki
Less is more😊

Play around and test it and post to share with us

Thanks,
tony

Anton Aylward

unread,
Feb 4, 2017, 7:04:31 AM2/4/17
to TiddlyWiki
On my machine for both Firefox and Thunderbird, which has a similar tool, I use "gvim" rather than "vim".  This is the graphical version of the editor... Vim alone needs to open in a text window.  I also use the "-nofork" option for reasons that should be self apparent.
Reply all
Reply to author
Forward
0 new messages