4

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?

3 Answers 3

2

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.

3
  • 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, 2010 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, 2010 at 3:45
  • It starts working. It seems, it has to restart X-es. Thanks for help, frabjous.
    – Shamaoke
    Sep 10, 2010 at 4:23
2

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'"
3
  • 1
    I discovered this feature recently. This option allowed me to stop using GVim completely.
    – Shamaoke
    Nov 15, 2012 at 19:29
  • GNOME developers have removed the --disable-factory option from gnome-terminal, unfortunately. Any workaround? Jul 5, 2015 at 10:14
  • Doesn't work any more. GNOME Terminal 3.14.2, running gnome-terminal --disable-factory -e vim; echo foo prints foo immediately and doesn't wait for gnome-terminal to close, hence, it forked.
    – cprn
    Aug 31, 2015 at 14:03
1

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.

1
  • I get "Error: no file name" when I try to save the file using this method
    – gypaetus
    Dec 17, 2015 at 0:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .