Add snippets support

This commit is contained in:
Julian Ospald 2018-06-16 00:47:36 +02:00
parent 282cea9bab
commit a356fa835c
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
2 changed files with 27 additions and 2 deletions

View File

@ -73,9 +73,9 @@ nnoremap <silent> <F8> :call LanguageClient#textDocument_rename()<CR>
" deoplete
call deoplete#custom#option('sources',{
\ '_': ['buffer'],
\ 'haskell': ['ultisnips', 'buffer', 'file', 'LanguageClient']
\ 'haskell': ['neosnippet', 'buffer', 'file', 'LanguageClient']
\ })
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
" inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
call deoplete#enable()

25
vimrc
View File

@ -71,6 +71,10 @@ else
Plug 'roxma/vim-hug-neovim-rpc'
endif
" snippets
Plug 'Shougo/neosnippet.vim'
Plug 'honza/vim-snippets'
" LSP
" setting this per-language breaks "let g:LanguageClient_autoStart = 1",
Plug 'autozimu/LanguageClient-neovim', {
@ -170,6 +174,27 @@ endif
set hidden
" neosnippet
" Plugin key-mappings.
" Note: It must be "imap" and "smap". It uses <Plug> mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
" SuperTab like snippets behavior.
" Note: It must be "imap" and "smap". It uses <Plug> mappings.
imap <expr><tab> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "\<c-n>" : "\<tab>"
smap <expr><tab> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<tab>"
" For conceal markers.
if has('conceal')
set conceallevel=2 concealcursor=niv
endif
" Enable snipMate compatibility feature.
let g:neosnippet#enable_snipmate_compatibility = 1
let g:neosnippet#disable_runtime_snippets = 1
" LSP
let g:LanguageClient_autoStart = 0