forked from c9s/perlomni.vim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
193bbd5
commit 5d1d118
Showing
4 changed files
with
68 additions
and
426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,135 +8,48 @@ http://www.youtube.com/watch?v=hZ7871WcIv0 | |
Description | ||
=========== | ||
|
||
perl-completion plugin supports basic perl completion and Moose / DBIx::Class completion. | ||
Deoplete source completion engine for perl includes Mo* / DBIx::Class completion. | ||
|
||
the rules could be easily extended. see ( ftplugin/perl/perlomni.vim ) | ||
Based off of https://github.com/c9s/perlomni.vim | ||
|
||
core rules including: | ||
|
||
* variable name completion | ||
* function name completion | ||
* package method name completion | ||
* base class method name completion | ||
* basic Moose completion | ||
* basic Moo completion | ||
* basic DBIx completion | ||
|
||
Supports deoplete completion | ||
|
||
|
||
Requirement | ||
=========== | ||
|
||
perlomni completion requires *vim 7.2 or newer.* | ||
perlomni completion requires *neovim* | ||
|
||
and filetype feature should be enabled. | ||
https://github.com/Shougo/deoplete.nvim | ||
|
||
Install | ||
======== | ||
|
||
just run make: | ||
|
||
$ make install | ||
|
||
and add ~/.vim/bin/ to your $PATH env variable , for example, add these lines to your .bashrc or .zshrc: | ||
|
||
export PATH=~/.vim/bin:$PATH | ||
|
||
please make sure you've enable filetype plugin your `.vimrc`: | ||
|
||
filetype on | ||
filetype plugin on | ||
filetype indent on | ||
|
||
NOTE) If you install pathogen.vim , you can make this working without installing. | ||
|
||
If you are you want completion as you type and are using neovim you can install https:://github.com/Shougo/deoplete.vim | ||
|
||
Usage | ||
===== | ||
|
||
In insert mode , press C-x C-o to emit omni completion. | ||
|
||
P.S. The completion works in terminal vim is faster than gvim/MacVim. | ||
|
||
Write your perl omni completion extensions | ||
========================================= | ||
|
||
Perl omni completion plugin is extensible, you can extend completion rules by | ||
simple regular expressions. | ||
|
||
your omni completion extension should put in ~/.vim/after/ftplugin/perl/what-ever.vim. | ||
|
||
## API Functions | ||
|
||
**AddPerlOmniRule(rule)**, for example: | ||
|
||
cal AddPerlOmniRule({ 'only':1, 'head': '^has\s\+\w\+' , | ||
\'context': '\s\+is\s*=>\s*$' , | ||
\'backward': '[''"]\?\w*$' , | ||
\'comp': function('s:CompMooseIs') } ) | ||
|
||
cal AddPerlOmniRule({ | ||
\'only':1, | ||
\'context': '&$', | ||
\'backward': '\<\U\w\+$', | ||
\'comp': function('s:CompBufferFunction') }) | ||
|
||
Available Rule attributes | ||
|
||
only: | ||
if one rule is matched, then rest rules won't be check. | ||
|
||
contains: | ||
if file contains some string (can be regexp) | ||
|
||
context: | ||
completion context pattern | ||
|
||
backward: | ||
regexp for moving cursor back to the completion position. | ||
|
||
head: | ||
pattern that matches paragraph head. | ||
|
||
comp: | ||
completion function reference. | ||
|
||
|
||
### Cache Functions | ||
|
||
**GetCacheNS(ns,key)** | ||
|
||
ns: cache namespace | ||
key: cache key | ||
|
||
**SetCacheNS(ns,key,value)** | ||
|
||
ns: cache namespace | ||
key: cache key | ||
value: cache value | ||
|
||
NeoBundle | ||
NeoBundle 'cazador481/perlomni.vim', 'python' | ||
|
||
|
||
Development | ||
=========== | ||
|
||
Please feel free to ask commit bit of this. just drop me a line. :-) | ||
|
||
|
||
Author | ||
====== | ||
- cazador481 (Edward Ash) [email protected] | ||
|
||
Original Author of perlomni | ||
===== | ||
- Cornelius (林佑安) [email protected] | ||
- Mattn (Yasuhiro Matsumoto) [email protected] | ||
|
||
|
||
Contibutors | ||
========== | ||
- cazador481 (Edward Ash) [email protected] | ||
|
||
|
||
|
||
Samples | ||
======= | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.