Acp 支援 snipmate trigger completion

135 צפיות
מעבר להודעה הראשונה שלא נקראה

Cornelius

לא נקראה,
15 בדצמ׳ 2009, 3:55:2715.12.2009
עד vim-t...@googlegroups.com
可參見 autocomplpop 的 help 文件,將 

  fun! GetSnipsInCurrentScope()
    let snips = {}
    for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
      call extend(snips, get(s:snippets, scope, {}), 'keep')
      call extend(snips, get(s:multi_snips, scope, {}), 'keep')
    endfor
    return snips
  endf

放入 plugin/snipMate.vim 內。

然後設定 g:acp_behaviorSnipmateLength 為 1

那麼開頭大寫的字母便會自動 trigger snipmate 的 completion。



--
Best Regards.

Cornelius ( Yo-An Lin )
E-mail: corneli...@gmail.com
http://c9s.blogspot.com/

Screen shot 2009-12-15 at 2.36.09 PM.png

Kent Chen

לא נקראה,
15 בדצמ׳ 2009, 4:40:1715.12.2009
עד vim-t...@googlegroups.com
這個好呀!  textmate都沒這麼貼心的吧...XD

2009/12/15 Cornelius <corneli...@gmail.com>

freehaha

לא נקראה,
17 בדצמ׳ 2009, 0:59:4817.12.2009
עד vim-t...@googlegroups.com
autocomplpop 我用了一下感覺還不錯,可是他的auto completefunc 要怎麼設定阿?
本來我用的應該是c omni 按 <C-n> 或 <C-p> 會去找header 裏的keyword 來complete。
可是acp 好像把這個behavior 改掉了.. 有人知道acp 裡面怎麼改嗎?

2009/12/15 Kent Chen <chen...@gmail.com>:

--
cheers,
freehaha.

Cornelius

לא נקראה,
17 בדצמ׳ 2009, 2:33:2017.12.2009
עד vim-t...@googlegroups.com
你可以參考 ~/.vim/plugin/acp.vim 以及 ~/.vim/autoload/acp.vim

裡頭有 configuration

在你的 ~/.vimrc 加上

let g:{ option name } = { value }

即可。
或是參考 :help autocomplpop

:-)

2009/12/17 freehaha <free...@gmail.com>

freehaha

לא נקראה,
17 בדצמ׳ 2009, 5:21:1817.12.2009
עד vim-t...@googlegroups.com
感謝!
原來是 g:acp_completeOption 這個選項,
我設成這樣就可以了:
let g:acp_completeOption = '.,w,b,u,t,i,k'

acp 還真不錯用 :p

2009/12/17 Cornelius <corneli...@gmail.com>:

--
cheers,
freehaha.

c9s

לא נקראה,
17 בדצמ׳ 2009, 7:03:5917.12.2009
עד Vim-Taiwan
如果覺得 acp 在某些 omni completion 太慢
可以考慮使用 neocomplcache 他可以針對 completion 的 item 做 cache
效果不錯。

透過 Vimana 可以直接安裝。

On Dec 17, 6:21 pm, freehaha <freeh...@gmail.com> wrote:
> 感謝!
> 原來是 g:acp_completeOption 這個選項,
> 我設成這樣就可以了:
> let g:acp_completeOption = '.,w,b,u,t,i,k'
>
> acp  還真不錯用 :p
>

> 2009/12/17 Cornelius <cornelius.h...@gmail.com>:


>
>
>
>
>
> > 你可以參考 ~/.vim/plugin/acp.vim 以及 ~/.vim/autoload/acp.vim
> > 裡頭有 configuration
> > 在你的 ~/.vimrc 加上
> > let g:{ option name } = { value }
> > 即可。
> > 或是參考 :help autocomplpop
> > :-)
>

> > 2009/12/17 freehaha <freeh...@gmail.com>


>
> >> autocomplpop 我用了一下感覺還不錯,可是他的auto completefunc 要怎麼設定阿?
> >> 本來我用的應該是c omni 按 <C-n> 或 <C-p> 會去找header 裏的keyword 來complete。
> >> 可是acp 好像把這個behavior 改掉了.. 有人知道acp 裡面怎麼改嗎?
>

> >> 2009/12/15 Kent Chen <chenk...@gmail.com>:
> >> > 這個好呀!  textmate都沒這麼貼心的吧...XD
>
> >> > 2009/12/15 Cornelius <cornelius.h...@gmail.com>


>
> >> >> 可參見 autocomplpop 的 help 文件,將
> >> >>   fun! GetSnipsInCurrentScope()
> >> >>     let snips = {}
> >> >>     for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
> >> >>       call extend(snips, get(s:snippets, scope, {}), 'keep')
> >> >>       call extend(snips, get(s:multi_snips, scope, {}), 'keep')
> >> >>     endfor
> >> >>     return snips
> >> >>   endf
> >> >> 放入 plugin/snipMate.vim 內。
> >> >> 然後設定 g:acp_behaviorSnipmateLength 為 1
> >> >> 那麼開頭大寫的字母便會自動 trigger snipmate 的 completion。
>
> >> >> --
> >> >> Best Regards.
>
> >> >> Cornelius ( Yo-An Lin )

> >> >> E-mail: cornelius.h...@gmail.com


> >> >>http://c9s.blogspot.com/
>
> >> --
> >> cheers,
> >> freehaha.
>
> > --
> > Best Regards.
>
> > Cornelius ( Yo-An Lin )

> > E-mail: cornelius.h...@gmail.com

OOO

לא נקראה,
18 בדצמ׳ 2009, 3:31:3818.12.2009
עד vim-t...@googlegroups.com
我還要像
autocmd FileType javascript setl omnifunc=javascriptcomplete#CompleteJS
這樣去設定 omnifunc 耶
不設的話都會說找不到 omnifunc
不知道是什麼問題

2009/12/17 freehaha <free...@gmail.com>



--
OOO

c9s

לא נקראה,
18 בדצמ׳ 2009, 21:44:5718.12.2009
עד Vim-Taiwan

有其他的地方有設定到 omnifunc 嗎?
如果沒有的話,我記得是比較早的版本需要另外自己設定 ? 或是你在 compile vim 的時候需要加上一個 --enable-
features=huge

javascriptcomplete 這個是在 $vimruntime 的 autoload 裡頭。

我現在的版本 是不用另外設定了。

VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Nov 27 2009 22:58:57)
MacOS X (unix) version
Included patches: 1-264
Compiled by c...@Cornelius.local
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset
+cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info
+comments
+cryptv -cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path
+float +folding -footer +fork() -gettext -hangul_input +iconv
+insert_expand
+jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds
+localmap
+menu +mksession +modify_fname +mouse -mouseshape +mouse_dec -
mouse_gpm
-mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm
+multi_byte
+multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra -perl
+postscript
+printer +profile -python +quickfix +reltime +rightleft -ruby
+scrollbind
+signs +smartindent -sniff +statusline -sun_workshop +syntax
+tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse
+textobjects +title
-toolbar +user_commands +vertsplit +virtualedit +visual +visualextra
+viminfo
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -
xim -xsmp


On Dec 18, 4:31 pm, OOO <oth...@gmail.com> wrote:
> 我還要像
> autocmd FileType javascript setl omnifunc=javascriptcomplete#CompleteJS
> 這樣去設定 omnifunc 耶
> 不設的話都會說找不到 omnifunc
> 不知道是什麼問題
>

> 2009/12/17 freehaha <freeh...@gmail.com>


>
>
>
>
>
> > 感謝!
> > 原來是 g:acp_completeOption 這個選項,
> > 我設成這樣就可以了:
> > let g:acp_completeOption = '.,w,b,u,t,i,k'
>
> > acp  還真不錯用 :p
>

> > 2009/12/17 Cornelius <cornelius.h...@gmail.com>:


> > > 你可以參考 ~/.vim/plugin/acp.vim 以及 ~/.vim/autoload/acp.vim
> > > 裡頭有 configuration
> > > 在你的 ~/.vimrc 加上
> > > let g:{ option name } = { value }
> > > 即可。
> > > 或是參考 :help autocomplpop
> > > :-)
>

> > > 2009/12/17 freehaha <freeh...@gmail.com>


>
> > >> autocomplpop 我用了一下感覺還不錯,可是他的auto completefunc 要怎麼設定阿?
> > >> 本來我用的應該是c omni 按 <C-n> 或 <C-p> 會去找header 裏的keyword 來complete。
> > >> 可是acp 好像把這個behavior 改掉了.. 有人知道acp 裡面怎麼改嗎?
>

> > >> 2009/12/15 Kent Chen <chenk...@gmail.com>:
> > >> > 這個好呀!  textmate都沒這麼貼心的吧...XD
>
> > >> > 2009/12/15 Cornelius <cornelius.h...@gmail.com>
>

> > >> >> 可參見 autocomplpop 的 help 文件,將
> > >> >>   fun! GetSnipsInCurrentScope()
> > >> >>     let snips = {}
> > >> >>     for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
> > >> >>       call extend(snips, get(s:snippets, scope, {}), 'keep')
> > >> >>       call extend(snips, get(s:multi_snips, scope, {}), 'keep')
> > >> >>     endfor
> > >> >>     return snips
> > >> >>   endf
> > >> >> 放入 plugin/snipMate.vim 內。
> > >> >> 然後設定 g:acp_behaviorSnipmateLength 為 1
> > >> >> 那麼開頭大寫的字母便會自動 trigger snipmate 的 completion。
>
> > >> >> --
> > >> >> Best Regards.
>
> > >> >> Cornelius ( Yo-An Lin )

> > >> >> E-mail: cornelius.h...@gmail.com


> > >> >>http://c9s.blogspot.com/
>
> > >> --
> > >> cheers,
> > >> freehaha.
>
> > > --
> > > Best Regards.
>
> > > Cornelius ( Yo-An Lin )

> > > E-mail: cornelius.h...@gmail.com

OOO

לא נקראה,
25 בדצמ׳ 2009, 9:06:0225.12.2009
עד vim-taiwan
剛剛弄了一陣子
確定是 vim 7.2 和 7.1 的差
我的 ubuntu 之前卡在 7.1
今天手動編譯 7.2 後就可以不用設定了

2009/12/19 c9s <corneli...@gmail.com>



--
OOO
השב לכולם
השב למחבר
העבר לנמענים
0 הודעות חדשות