GithubHelp home page GithubHelp logo

prabirshrestha / asyncomplete-ultisnips.vim Goto Github PK

View Code? Open in Web Editor NEW
33.0 33.0 1.0 6 KB

provides ultisnips autocomplete for asyncomplete.vim

License: MIT License

Vim Script 100.00%
asyncomplete code-completion neovim ultisnips vim

asyncomplete-ultisnips.vim's People

Contributors

prabirshrestha avatar rliang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

akemrir

asyncomplete-ultisnips.vim's Issues

Ultisnips expanding

hi, I have problem with expanding snippets inline.

    object.inj

I have snippet called inj.
That's possible to exapnd it?

Incompatibility with `honza/vim-snippets`

Based on your minimal.vimrc:

" install: curl https://raw.githubusercontent.com/prabirshrestha/vim-lsp/master/minimal.vimrc -o /tmp/minimal.vimrc
" uninstall: rm /tmp/plug.vim && rm -rf /tmp/plugged
" run vim/neovim with minimal.vimrc
" vim -u minimal.vimrc
" :PlugInstall

set nocompatible hidden laststatus=2

if !filereadable('/tmp/plug.vim')
  silent !curl --insecure -fLo /tmp/plug.vim
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif

source /tmp/plug.vim

call plug#begin('/tmp/plugged')
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'prabirshrestha/asyncomplete-ultisnips.vim'
call plug#end()

imap <c-space> <Plug>(asyncomplete_force_refresh)
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>\<cr>" : "\<cr>"
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif

if executable('pyls')
    " pip install python-language-server
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pyls',
        \ 'cmd': {server_info->['pyls']},
        \ 'whitelist': ['python'],
        \ })
endif

let g:UltiSnipsExpandTrigger="<c-e>"
call asyncomplete#register_source(asyncomplete#sources#ultisnips#get_source_options({
    \ 'name': 'ultisnips',
    \ 'whitelist': ['*'],
    \ 'completor': function('asyncomplete#sources#ultisnips#completor'),
    \ }))

Without honza/vim-snippets, completing after the period .:

l = [1, 2, 3]
l.

triggers the opening of the completion window.

With honza/vim-snippets, it does not open the completion window, instead, I get Pattern not found in my (custom) status:

screenshot_2018-02-14_18-58-23

or just no completion using the minimal.vimrc. Note that this screenshot is Rust code (using vim-lsp, asyncomplete-lsp, and Rusts rls), so it's not only on Python.

Starting to type right after the . or :: starts completing again.

Unknown function: asyncomplete#sources#ultisnips#get_source_options

I've recently (last few days) started seeing the following on startup:

Error detected while processing /usr/.../dotfiles/vim/startup/plugins.vim:
line   84:
E117: Unknown function: asyncomplete#sources#ultisnips#get_source_options
E116: Invalid arguments for function asyncomplete#register_source
Press ENTER or type command to continue

I've already updated my config to support this commit. Is there something I'm missing from my config?

Completion/Snippet expansion does not happen when you hit <TAB>

When i register this as a completion source and try to select a snippet and hit <enter>, nothing happens.

image

my .vimrc contains


let g:asyncomplete_auto_popup = 1
let g:asyncomplete_remove_duplicates = 1
let g:lsp_async_completion = 1

"  Enable disagnostics
let g:lsp_signs_enabled = 1
let g:lsp_diagnostics_echo_cursor = 1

" [...] other language servers

if has('python3')
    let g:UltiSnipsExpandTrigger="<c-l>"
    "let g:UltiSnipsExpandTrigger="<c-y>"
    call asyncomplete#register_source(asyncomplete#sources#ultisnips#get_source_options({
        \ 'name': 'ultisnips',
        \ 'whitelist': ['*'],
        \ 'completor': function('asyncomplete#sources#ultisnips#completor'),
        \ }))
endif

inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>"

nnoremap <buffer> ,n :LspNextError<CR>
nnoremap <buffer> ,p :LspPreviousError<CR>imap <m-r> <Plug>(asyncomplete_force_refresh)

set completeopt=menu,menuone,preview,noinsert

Is this plug-in deprecated?

The documentation for asyc.vim says to use this repository for snippets, and the documentation for vim-lsp.vim says to use thomasfaingnaert/vim-lsp-ultisnips.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.