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:

  1. 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.
  2. Type in “cd main-method”.
  3. Type in “python install.py”.
  4. 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.
  5. 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 :) .

Share/Save/Bookmark

19 Responses to “ViGedit–Gedit’s Simplicity with Vi(m)’s Power”

  1. anon says:

    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’

  2. delfick says:

    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?

  3. Richzendy says:

    @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

  4. delfick says:

    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)

    :)

  5. Richzendy says:

    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.

  6. delfick says:

    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

    :)

  7. SeanR says:

    Very cool. Seems to be working. Thanks.

  8. Seth says:

    Nice. some things do work (missing things like dj)

    I’ll give it some time, thanks for the nice work

  9. Vic says:

    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

    1. Vic says:

      I meant ‘dw’ to delete the white space between the beginning of the line and the first non-white space character in the line

      1. delfick says:

        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)

  10. MVD says:

    Great idea, great plugin, painless install, works like a charm. This might be the single most useful plugin for Gedit. Well done guys!

  11. mbsuper07 says:

    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.

  12. kate says:

    Oh, it’s the happiest day of my user-life ;D

  13. [...] 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 [...]

  14. bernhard says:

    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!

  15. Pablo says:

    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.

  16. delfick says:

    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….)

  17. Marc says:

    I have really no idea how to install this. Does it really have to be this hard to install it?

Leave a Reply