Skip to content
This repository has been archived by the owner on Jul 27, 2018. It is now read-only.

user defined ultisnips won't show up #174

Open
casprwang opened this issue Jan 12, 2018 · 2 comments
Open

user defined ultisnips won't show up #174

casprwang opened this issue Jan 12, 2018 · 2 comments

Comments

@casprwang
Copy link

Hi, I've been fixing this problem for a long time but never worked, it's really wired, everything else worked fine except user-defined snippet. I defined a snippet but NCM doesn't pop out the option snippet hint(only shows "Tmux" hint), and can't be expanded.

Plug 'roxma/nvim-completion-manager', {'do': 'npm install'} 
Plug 'SirVer/ultisnips'


" ncm config
set shortmess+=c
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
let g:UltiSnipsExpandTrigger = "<Plug>(ultisnips_expand)"
" css
" the omnifunc pattern is PCRE
let g:cm_matcher = {'module': 'cm_matchers.fuzzy_matcher', 'case': 'smartcase'}

let g:cm_refresh_default_min_word_len=2
inoremap <silent> <c-o> <c-r>=cm#sources#ultisnips#trigger_or_popup("\<Plug>(ultisnips_expand)")<cr>
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" ncm end


" ultisnips config
function! g:UltiSnips_Complete()
  call UltiSnips#ExpandSnippet()
  if g:ulti_expand_res == 0
    if pumvisible()
      return "\<C-n>"
    else
      call UltiSnips#JumpForwards()
      if g:ulti_jump_forwards_res == 0
        return "\<TAB>"
      endif
    endif
  endif
  return ""
endfunction

au BufEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=g:UltiSnips_Complete()<cr>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
let g:UltiSnipsEditSplit = 'horizontal'
let g:UltiSnipsSnippetsDir="~/dotfiles/nvim/ultiSnips"
let g:UltiSnipsSnippetDirectories=["ultiSnips"]
" ultisnips end

2018-01-12 07 37 36

@viniarck
Copy link

@roxma I'm also facing the same issue as @wangsongiam, could you shed some light? Thanks!

@viniarck
Copy link

As a workaround though, if you have a "UltiSnips" folder under your runtime path nvim-completion-manager still finds the snippets. Nice!

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

No branches or pull requests

2 participants