Skip to content

Commit

Permalink
Replaced <C-x><C-p> completion with omni completion (if &omnifunc is …
Browse files Browse the repository at this point in the history
…empty), documented it

--HG--
branch : purgecxcp
  • Loading branch information
ZyX-I committed Jan 25, 2012
1 parent 6e7790c commit d66aca0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 1 addition & 8 deletions autoload/vam.vim
Expand Up @@ -364,13 +364,6 @@ command! -nargs=* -complete=customlist,vam#install#UninstallCompletion Uninstall


" plugin name completion function:
augroup VAM
function! s:CompleteAddonName()
let savedof=&l:omnifunc
let &l:omnifunc='vam#install#CompleteAddonName'
return "\<C-x>\<C-o>\<C-r>=['', setbufvar('%', '&omnifunc', ".string(savedof).")][0]\n"
endfunction
autocmd FileType vim inoremap <buffer> <expr> <C-x><C-p> <SID>CompleteAddonName()
augroup END
autocmd FileType vim if empty(&omnifunc) | setlocal omnifunc=vam#install#CompleteAddonName | endif

" vim: et ts=8 sts=2 sw=2
8 changes: 7 additions & 1 deletion doc/vim-addon-manager.txt
Expand Up @@ -244,7 +244,7 @@ Or overwrite the MergeSources function: >


------------------------------------------------------------------------------
2.3 Example: personal configurable setup *VAM-complex-setup-sample*
2.3 Example: personal configurable setup *VAM-complex-setup-sample*
>
call vam#ActivateAddons(["github:YOURNAME"],{'auto_install' : 0})
" this initializes Vim the way *you* want also loading more plugins:
Expand Down Expand Up @@ -411,6 +411,12 @@ vam#install#RewriteName({name}) *vam#install#RewriteName()*
"url": "git://github.com/{N}/{Repo}"}
git:{URL} {"type": "git", "url": {URL}} (experimental)

vam#install#CompleteAddonName *vam#install#CompleteAddonName()*
Function suitable to be a completion function for omni completion
('omnifunc'). Completes addon names. Value of 'omnifunction' option will
be set by VAM for files with “vim” filetype iff this option is empty (uses
|FileType| event).

==============================================================================
4. Options *VAM-options*
*g:vim_addon_manager*
Expand Down

0 comments on commit d66aca0

Please sign in to comment.