Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YouCompleteMe support similar as SuperTab support #86

Open
niva-xx-zz opened this issue Apr 18, 2018 · 2 comments
Open

Add YouCompleteMe support similar as SuperTab support #86

niva-xx-zz opened this issue Apr 18, 2018 · 2 comments

Comments

@niva-xx-zz
Copy link

Hi,

Using YouCompleteMe, it could be fine to keep trig of Xptemplate in order :

  1. to add for, each etc.. full template patterns in code from Xptemplate facility
  2. to complete efficiently for example c/c++/c# object's member from YouCompleteMe facility.

Thank you
NiVa

@drmingdrmer
Copy link
Owner

There is a setting let g:xptemplate_minimal_prefix = 'full' that tells xptemplate expand only when full trigger pattern matched: f<tab> does not trigger for, only for<tab> expands to a for loop snippet.

And with another setting let g:xptemplate_fallback = '<C-n>' you could define what to do when no trigger pattern matches.
With this <C-n> xptemplate starts a word completion. Like this:
image

Changing <C-n> to the YouCompleteMe trigger key to get what you want.

@niva-xx-zz
Copy link
Author

niva-xx-zz commented Apr 18, 2018

Thank you so much.
After a try, for always expanded by YouCompleteMe. No template written by Xptemplate.

`
" Xpt Template
let g:xptemplate_key = '<Tab>'
let g:xptemplate_key_pum_only = '<S-Tab>'
let g:xptemplate_goback = '<C-g>'
let g:xptemplate_to_right = '<C-;>'
let g:xptemplate_vars = "author=your_name&email=[email protected]&..."

" Ycm hook
let g:xptemplate_minimal_prefix = 'full'
let g:xptemplate_fallback = '<C-n>'
" }}}
" YouCompleteMe {{{
" ycm-core/YouCompleteMe#1932

" trigger completion key
let g:ycm_key_invoke_completion = '<C-n>'
let g:ycm_key_list_select_completion = "<C-n>"

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants