September 09, 2007

Vim Omnicomplete Awesomeness

I just discovered, through jerbear in #python, the omnicomplete feature in Vim 7. This is something that I’ve been idly in hope of for ages, and to discover it actually exists in Vim already is awesome (hence the title).

omnicomplete searches through any files you’ve imported (including Python library modules) and completes names you might possibly want to use:

To do this requires the rather awkward0 key combination of Ctrl-X, Ctrl-O. After much effort1, I rebound the key combination so Ctrl-Space will work as well. This requires the addition of the line “inoremap <Nul> <C-x><C-o>” to your .vimrc2. This doesn’t work for the graphical Vim, where you will probably want ‘C-space’ instead of ‘Nul’ (though I can’t be sure).

Everyone may already be aware of this, but for those who aren’t, check it out!




0 And strangely Emacs-y.

1 Thanks again to jerbear, as well as \amethyst and Heptite in #vim.

2 Or the use of the command “:inoremap <Nul> <C-x><C-o>” when within Vim.


- One comment Not publicly viewable

  1. mats

    Nice. Did not know it was that easy, I had a few problems to get it working some time ago.
    Have you checked out the latest vim version? It displays a preview window where you can read the docstrings as you choose which function to call.

    12 Oct 2007, 00:53


Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.

Trackbacks

September 2007

Mo Tu We Th Fr Sa Su
Aug |  Today  | Oct
               1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Search this blog

Tags

Galleries

Most recent comments

  • I should note that the talk info is available at http://linux.conf.au/programme/detail?TalkID=293 an… by on this entry
  • "I X'd you a Y, but I eated it by Lamby on this entry
  • Nice. Did not know it was that easy, I had a few problems to get it working some time ago. Have you … by mats on this entry
  • You can't make progress if you just argue, I try to be constructive. Cheers! by James on this entry
  • Thanks a bunch for doing this. I think that both Guido and Bruce Eckel are right; we really need peo… by Eli on this entry

Blog archive

Loading…
Not signed in
Sign in

Powered by BlogBuilder
© MMXIV