Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Vimperator has a very convenient function — using an external editor for filling text fields. By default it uses GVim but I would like to use Gedit or Vim. I tried to add to ~/.vimperatorrc the following lines but without result (the editors is opened but the typed text isn't added to text fields):

:set editor=gedit
:set editor="gnome-terminal -e vim"

How can I set an external editor for filling text fields in Vimperator?

Thanks.

Debian GNU/Linux 5.0.6;

Firefox 3.6.9;

Vimperator 2.3.1.

Update


To configure the Vim external editor the configuration option in ~/.vimperatorrc should be the following:

autocmd LocationChange .* :set editor="gnome-terminal -x vim"
share|improve this question
add comment

3 Answers

up vote 0 down vote accepted

It's completely a mystery to me why the things you tried don't work when placed in .vimperatorrc (though they don't work for me either). It's very strange. But this seems to work:

autocmd LocationChange .* :set editor="gedit"

It takes effect even with the first page that loads.

share|improve this answer
    
It doesn't work either. I start the browser, go to page with a web-form, focus a text field, press Ctrl+i, Gedit starts with the vimperator-<base_url>-<number>.tmp page opened, I start to type text, save it, close the editor and that's all, nothing happens, the text feild is empty. –  Shamaoke Sep 10 '10 at 3:42
    
Sorry, this seems like an unrelated bug. It works for me just fine. (Vimperator 2.3.1 on Firefox 3.6.8 on Arch Linux.) –  frabjous Sep 10 '10 at 3:45
    
It starts working. It seems, it has to restart X-es. Thanks for help, frabjous. –  Shamaoke Sep 10 '10 at 4:23
add comment

To use vim through gnome-terminal v3.4.1.1, I had to tell gnome-terminal to not fork a process but block:

In ~/.vimperatorrc:

:set editor="gnome-terminal --disable-factory -x vim"

or better yet, to have your ~/.bashrc loaded (e.g. in case it conditionally sets TERM or other environment) before launching vim, and to pass some setup commands to vim (e.g. a command ExtEditor defined in ~/.vimrc that e.g. adjusts the linbreak setting):

:set editor="gnome-terminal --maximize --disable-factory -x bash -ic 'vim -c ExtEditor $0'"
share|improve this answer
1  
I discovered this feature recently. This option allowed me to stop using GVim completely. –  Shamaoke Nov 15 '12 at 19:29
add comment

What I did was

:set editor="urxvt -e vim"

Works like a charm. Of course you have to be using vim from the urxvt terminal.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.