ViGedit–Gedit’s Simplicity with Vi(m)’s Power
I’ve been having inner turmoil about text editors for a while. On the one hand, I realize that Vim is super-powerful, and I should use it. On the other hand, I don’t know a lot of commands, and I frequently find that I actually get more work done in gedit. This makes me not use Vim, and then I forget a few commands I used to know, and then when I do use Vim it’s a worse experience than before.
Luckily, there’s a solution: the ViGedit gedit plugin. It lets you use all your favorite Vim commands from within gedit.
Sweetness.
So to install it, do the following:
- Open up a terminal, and create a folder called ViGedit. Or do it in Nautilus. Whatever. Navigate to the folder using the “cd” command in the terminal, and then type in this: “bzr branch http://bazaar.launchpad.net/~tristil/vigedit/main-method“. You may get an error saying bzr (Bazaar) is not installed, but it’ll also give you the apt-get command to install it.
- Type in “cd main-method”.
- Type in “python install.py”.
- Close the terminal, open gedit, and go to Edit->Preferences. Under the “Plugins” tab, put a check mark next to ViGedit, and then close the preferences window.
- Smile, dance, sing, jump around, shout for joy, and then do some editing!
As a sidenote, I’m assuming that eventually I’ll be able to comfortably drop the gedit wrapper, and just use Vim by itself. But training wheels never hurt anyone
.



















































ViGedit doesn’t work:
/home/x/.gtkrc-2.0:1: error: unexpected character `=’, expected keyword – e.g. `style’
x@x-default:~$ gedit
/home/x/.gtkrc-2.0:1: error: unexpected character `=’, expected keyword – e.g. `style’
Traceback (most recent call last):
File “/home/x/.gnome2/gedit/plugins/ViGedit/__init__.py”, line 24, in
from vigtk import VIG_Window
File “/home/x/.gnome2/gedit/plugins/ViGedit/vigtk.py”, line 27, in
from ViGedit.vi import VIG_Vibase
File “/home/x/.gnome2/gedit/plugins/ViGedit/vi.py”, line 30, in
from ViGedit.bindings import VIG_Bindings
File “/home/x/.gnome2/gedit/plugins/ViGedit/bindings/__init__.py”, line 2, in
from ViGedit.actions import act
File “/home/x/.gnome2/gedit/plugins/ViGedit/actions/__init__.py”, line 67, in
exec “import %s” % module
File “”, line 1, in
File “/home/x/.gnome2/gedit/plugins/ViGedit/actions/trace.py”, line 38
info(1, message, *args, color=MAGNETA)
^
SyntaxError: invalid syntax
** (gedit:3946): WARNING **: Cannot load Python plugin ‘vigedit’ since file ‘ViGedit’ cannot be read.
** (gedit:3946): WARNING **: Error activating plugin ‘vigedit’
Hello.
I’m one of the authors of that plugin (infact rewrote it recently)
@author : thanks for noticing
@anon : what version of python do you have installed?
@delfick: i have a same problem as anon, my python version is :
[richy@zeus ViGedit]$ python -V
Python 2.5.1
in fedora9 i386, and gedit 2.22.3
hmm, it seems that what I was doing only works in python 2.6+.
I’ve changed it to work in earlier versions.
(
changed
“info(1, message, *args, color=MAGNETA)”
to
“info(1, message, *args, **{‘color’ : MAGNETA})
)
(and I just noticed MAGENTA is spelt wrong :p…. oh well)
…
reinstall the plugin today and having the same error:
[richy@poseidon main-method]$ gedit
Traceback (most recent call last):
File “/home/richy/.gnome2/gedit/plugins/ViGedit/__init__.py”, line 24, in
from vigtk import VIG_Window
File “/home/richy/.gnome2/gedit/plugins/ViGedit/vigtk.py”, line 27, in
from ViGedit.vi import VIG_Vibase
File “/home/richy/.gnome2/gedit/plugins/ViGedit/vi.py”, line 30, in
from ViGedit.bindings import VIG_Bindings
File “/home/richy/.gnome2/gedit/plugins/ViGedit/bindings/__init__.py”, line 2, in
from ViGedit.actions import act
File “/home/richy/.gnome2/gedit/plugins/ViGedit/actions/__init__.py”, line 67, in
exec “import %s” % module
File “”, line 1, in
File “/home/richy/.gnome2/gedit/plugins/ViGedit/actions/trace.py”, line 38
info(1, message, *args, color=MAGNETA)
^
SyntaxError: invalid syntax
** (gedit:28246): WARNING **: Cannot load plugin ‘ViGedit’ since file ‘/home/richy/.gnome2/gedit/plugins’ cannot be read.
** (gedit:28246): WARNING **: Error activating plugin ‘vigedit’
I open a bug in launchpad for this.
I’ve already said in the bug that problem has already been fixed.
But now I understand why you still have the problem.
It’s fixed in
https://code.launchpad.net/~delfick/vigedit/vigedit-additions
but not in
https://code.launchpad.net/~tristil/vigedit/main-method
thanks, really work now.
just download with:
bzr branch https://code.launchpad.net/~delfick/vigedit/vigedit-additions
Very cool. Seems to be working. Thanks.
Nice. some things do work (missing things like dj)
I’ll give it some time, thanks for the nice work
Hi,
When I try to do ‘di’ from the beginning of a line, it deletes all the empty space AND part of the first word in the line until it hits a character like ‘_’. It should just delete the empty space up to, but not including the first non-white space.
Other than that, i like it.
Thanks
I meant ‘dw’ to delete the white space between the beginning of the line and the first non-white space character in the line
I think you mean “daw”.
“dw” isn’t implemented inside vigedit (yet) unfortunately and my time is even more limited than usual to be able to look into adding it atm
The reason it does that is because it looks for a word to delete and it doesn’t consider whitespace to be a word.
Though when you’re in insert mode you can use a gedit feature where, if you’re already at the start of the line, the home key will bring you to the first non whitespace character on the line
and I’m glad you like the plugin
Stephen.
(maintainer of vigedit)
Great idea, great plugin, painless install, works like a charm. This might be the single most useful plugin for Gedit. Well done guys!
Good plugin, still limiting in use. It would be fantastic to have some sort of keyboard shortcut to enable/disable the plugin, ‘kile’ latex editor has this feature to go back and forth between vi editing mode and normal editing mode, which makes it an extremely powerful latex editor.
Oh, it’s the happiest day of my user-life ;D
[...] write Bengali in Vim, so I used to use gedit for that and it was pretty painful. Here is a vim wrapper for gedit. I am charmed! Like this:LikeBe the first to like this post. « Gedit [...]
Just found ViGedit. I like it.
However, it works a little strange:
the ‘.’ for repeat last command repeats cursor movement instead of insert/delete action as I would have expected.
I’ll give it a chance, nevertheless, since I don’t see an alternative.
Thanks for the work, well done!
Just tried installing this on Ubuntu 11 (using unity), but although the install script seems to work ok, the plugin is not showing up in the ‘Plugins’ tab, under preferences.
It’s probably because you have gedit 3 installed.
The plugin hasn’t been updated to gedit 3 yet. (Somewhat unlikely I’ll be the one doing it anytime soon. Though I do hope to do it one day….)
I have really no idea how to install this. Does it really have to be this hard to install it?
Hello,
When doing the “bzr branch https://code.launchpad.net/~delfick/vigedit/vigedit-additions” command I get the following error:
bzr:ERROR: Connection eror: Couldn’t resolve host ‘bazaar.launchpad.net’ [Errno-2] Name or service not known]
How should I go about downloading this plugin?
Thanks
You want “bzr branch lp:vigedit”
Also, note that it doesn’t have gedit3 support yet….