On Thu, 13 Jul 2006 at 12:04pm, Maciej Kalisiak wrote:

> I'm using Vim 7.0 on WinXP SP2.  I don't think I did anything specific
> to turn on omni-completion (perhaps it's on by default? I'm editing
> Python files), and I'm in no rush to start using it, although if it
> was non-intrusive I wouldn't mind leaving it on.  The problem is that
> I've recently modified my path variable in Vim, and now whenever
> omni-completion kicks in -- and it's often -- Vim comes to a loooong
> stop, 'scanning tags'.  I take it that the scan goes through all files
> in my path.  Admittedly my path is now fairly deep:
>     let home='C:\Documents\ and\ Settings\Maciek\My\ Documents\Home'
>     let &path.=','.home.'\python\**'
>     let &path.=','.home.'\research\**'
>     let &path.=',c:\Python24\Libs\**'
> Probably the last entry is the killer.  Still, I chose to include
> these directories/trees in my path as I find the :find command very
> useful, much more than the omni-completion; hence if push comes to
> shove, I'll ditch omni-complete first.
>
> My question: can anything be done to improve the situation on the
> omni-completion front?  Obviously the constant scanning is killing me;
> making it faster without sacrificing path variable would be nice.
> Also, I'd like to be able to trigger it only when I ask for it, and
> not have it automatic.  Also, since I use ctrl-n and ctrl-p a lot to
> complete the word under cursor *using only the current file*, I'd
> prefer omni-completion to be under a different key combo.
>
> Also, I would've thought omni-completion would use some sort of
> caching mechanism, rather than rescanning all the files every single
> time.  Doesn't it do that?  Most of the time I hit Ctrl-C to interrupt
> the scanning of tags, so I can get on with my work, but I could have
> sworn I let it run once or twice to completion before, with no
> discernible improvement on subsequent completions...
>

You are probably talking about the insert-mode completion rather than
the omni-completion. Omni completion is meant is similar to the MS
intellisense, and is not turned on by default. You also need specific
plugins to use that. In contrast, the insert-mode completion is on by
default, and gets triggered when you use ^N, ^P etc. in insert mode.
Also, this completion doesn't use your 'path' but by default your tags
setting, and all the loaded buffers etc. This can be customized by using
the 'complete' option (e.g., you can completely avoid looking into the
tags files). It is possible that you recently added more tags files
which is causing this delay in completion. Actually, without any change
in tags files, I also saw a difference in performance of the insert-mode
completion in Vim7 compared to Vim6.3, and not sure if disabling the
menu will make any difference. You might want to check removing "menu"
and "menuone" from 'completeopt' will make any difference (this should
disable popup menu).

Since you mentioned that you find the :find command very useful, might I
put in a plug for my lookupfile.vim plugin? When you use LUPath command,
it cleverly takes advantage of the Vim7 completion menu (which works
even when you disable it in 'completeopt') to lookup matching files as
you type in a partial filename. You can download it from:

http://www.vim.org//script.php?script_id=1581

-- 
HTH,
Hari

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to