vim & python
Simon Burton
simonb at NOTTHISBIT.webone.com.au
Tue Mar 2 18:59:27 EST 2004
On Mon, 01 Mar 2004 11:51:24 -0800, sb wrote:
> Hello
>
> I have a bunch of questions about using python scripting in vim and about
> editing python with vim.
>
>
I'm very happy with word completion.
>From ":help ins-complet":
For example, the following will map <Tab> to either actually insert a <Tab> if
the current line is currently only whitespace, or start/continue a CTRL-N
completion operation: >
function! CleverTab()
if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
return "\<Tab>"
else
return "\<C-N>"
endfunction
inoremap <Tab> <C-R>=CleverTab()<CR>
I found out about this wrt "pydiction" which parses python files
and outputs a diction file with words for vim to complete on. However,
I don't use it, as it pollutes the completion namespace too much.
Simon.
More information about the Python-list
mailing list