Saturday, July 7, 2012

Re: how to override system ftplugin settings with user custom ?

On 2012-07-08, chris wrote:
>
> I set one option omnifunc in `~/.vim/ftplugin/python/python.vim` like this:
> setlocal omnifunc=3Dpython3complete#Complete
> But this can not work.
> When I open a python file. I checked omnifunc setting with command:
> `:verbose set omnifunc?`
> I get output:
> omnifunc=3Dpythoncomplete
> Last set /usr/share/vim/vim73/ftplugin/python.vim
>
> I want to override the system omnifunc setting with my own setting:
> setlocal omnifunc=3Dpython3complete#Complete
>
> Does anybody know why my custom option can not work ?

Vim sources plugins in the order determined by 'runtimepath',
typically

~/.vim
/usr/local/share/vim/vimfiles
/usr/local/share/vim/vim73
/usr/local/share/vim/vimfiles/after
~/.vim/after

so anything you set in ~/.vim/ftplugin/python/python.vim may be
overwritten in /usr/local/share/vim/vim73/ftplugin/python.vim. You
can add code to your plugin to prevent the contents of Vim's plugin
from being executed, but that isn't what you want to do here.
Instead, you should put your option setting in
~/.vim/after/python.vim or ~/.vim/after/python/python.vim so that
yours is set after Vim's.

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: