Stories
Slash Boxes
Comments

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

Ovid
  (email not shown publicly)
http://publius-ovidius.livejournal.com/
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Sunday April 27, 2008
08:46 AM

Vim Help Needed

[ #36253 ]

Searching through the vim documentation can be, um, painful. What I'm trying to do is create 'context menus'. For example, if I type {ctrl-p} for keyword completion, I often get a helpful menu offering choices I can scroll through. Is this available via a public API I can populate myself with bog-standard vim? (not the GUI version).

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • run: :help dictionary

    i think this is what you need.

    you might want to add this to your .vimrc:

    function! MyFileStartup()
            set complete-=k complete+=k
            if exists("b:current_syntax")
                    let &dictionary = substitute("~/.vim/dict/FT.dict", "FT", b:current_syntax, "")
            endif
    endfunction

    autocmd BufRead,BufNewFile * call MyFileStartup()

    with this - you can store per-filet
  • I really did get a lot of of the Vim Hacking book, including how to do things like this: http://www.packtpub.com/Vim/book [packtpub.com]
  • :help completion

    And hey lookit. That gets you to insert.txt chapter 7, which is all about the completion feature.

    • I think I didn't explain myself well. I don't care about the completion feature. I care about the little menu with completion possibilities that pops up in my editor [wikimedia.org]. I very much want to create my own menus and take actions based on user selection. For example, if someone types ',gt' (goto test), I'd like a pop up showing all tests which cover the current program and let the user scroll through the tests for the one they want.

      • One easy avenue might be :help console-menus.

        The customary way is do what the explorer and quickfix features do, though: create a new window that binds a bunch of keys to special functions.

  • There is an autocomplete example in my vim presentation [redhotpenguin.com] that I gave to SF.pm. It might have some useful parts.