From 8cbc6923a07dfda1e91c9c281931699b68b5b769 Mon Sep 17 00:00:00 2001 From: tiynger Date: Sat, 12 Oct 2019 23:22:38 +0200 Subject: [PATCH] adding java completion --- .config/nvim/init.vim | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index d9a8e00..ea607c0 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -1,5 +1,3 @@ -let mapleader ="," - if ! filereadable(expand('~/.config/nvim/autoload/plug.vim')) echo "Downloading junegunn/vim-plug to manage plugins..." silent !mkdir -p ~/.config/nvim/autoload/ @@ -32,7 +30,33 @@ set clipboard=unnamedplus " Plugin section call plug#begin('~/.config/nvim/plugged') Plug 'donRaphaco/neotex', { 'for': 'tex'} +Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +Plug 'lervag/vimtex', {'for': 'tex'} +"Plug 'artur-shaik/vim-javacomplete2' call plug#end() +" neotex let g:neotex_enabled = 2 let g:neotex_pdflatex_alternative = 'xelatex' + +" deoplete +let g:deoplete#enable_at_startup = 1 +let g:deoplete#enable_smart_case = 1 +let g:deoplete#sources = {} +let g:deoplete#sources.java = ['jc', 'javacomplete2', 'file', 'buffer'] +call deoplete#custom#var('omni', 'input_patterns', { + \ 'tex': g:vimtex#re#deoplete + \}) + +"tab as remapping for deoplete +inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ deoplete#mappings#manual_complete() +function! s:check_back_space() abort "" {{{ + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~ '\s' +endfunction "" }}} + +" javacomplete2 +"autocmd FileType java setlocal omnifunc=vim-javacomplete2#Complete