Monday, November 30, 2009

Re: Need to know how to load script in Vim

On Nov 29, 3:36 am, satuon <sasho...@gmail.com> wrote:
> > you can get a complete list of all scripts currently sourced by
> > issuing the
>
> >     :scriptnames
>
> > command -- the command to load a script is
>
> >     :source <scriptname>
>
> Thanks, I used that and it showed me that pythoncomplete was loaded. But I
> still have only the default autocomplete when hit Ctrl+N/Ctrl+P. Ctrl+X just
> outputs this at the bottom of the screen:
> -- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)
>

Since you have a script loaded that is supposed to give you
completion, you probably need to use CTRL-X CTRL-O or *possibly* CTRL-
X CTRL-U to use the script-based completion. CTRL-N and CTRL-P are
just the built-in completion.

Since CTRL-X CTRL-O can be inconvenient to type, it is easy to map
this to another easier key such as CTRL-<Spacebar>.

I have this in my .vimrc:

imap <C-Space> <C-X><C-O>

I actually have another (somewhat complicated) mapping for completion
that sets up the selection menu behavior to be more intuitive to me,
so I used imap rather than inoremap. inoremap may be better for you,
or you can check out the tip I based my other mappings on here:

http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE

A further note on the "autoload" directory. "autoload" is for scripts
that define functions in a special way, so that the functions are not
defined until they are actually used. "plugin" is the directory for
scripts that define things that should always be defined, or
"ftplugin" for scripts that define things that should always be
defined for certain file types.

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: