@@ -6,10 +6,9 @@ call plug#begin('~/.config/nvim/plugged')
66Plug ' lambdalisue/suda.vim'
77Plug ' junegunn/fzf' , { ' dir' : ' ~/.fzf' , ' do' : ' ./install --all' }
88Plug ' junegunn/fzf.vim'
9- Plug ' file:///home/hoang.nguyen.luat/.config/nvim/plugged/fzf-tags'
109Plug ' mileszs/ack.vim'
11- Plug ' neoclide/coc.nvim' , {' branch' : ' release' }
12- Plug ' dense-analysis/ale'
10+ " Plug 'neoclide/coc.nvim', {'branch': 'release'}
11+ " Plug 'dense-analysis/ale'
1312Plug ' Shougo/defx.nvim' , { ' do' : ' :UpdateRemotePlugins' }
1413Plug ' tpope/vim-fugitive'
1514Plug ' junegunn/gv.vim'
@@ -29,15 +28,21 @@ Plug 'ludovicchabant/vim-gutentags'
2928" For Rails
3029Plug ' vim-ruby/vim-ruby'
3130Plug ' tpope/vim-rails'
32- Plug ' neoclide/coc-solargraph' , {' do' : ' yarn install --frozen-lockfile' }
31+ " Plug 'neoclide/coc-solargraph', {'do': 'yarn install --frozen-lockfile'}
3332Plug ' nelstrom/vim-textobj-rubyblock'
3433Plug ' tpope/vim-endwise'
3534" For Python
36- Plug ' neoclide/coc-python' , {' do' : ' yarn install --frozen-lockfile' }
35+ " Plug 'neoclide/coc-python', {'do': 'yarn install --frozen-lockfile'}
3736" Frontend
3837Plug ' pangloss/vim-javascript'
3938" UI
4039Plug ' vim-airline/vim-airline'
40+
41+ " Test
42+ Plug ' neovim/nvim-lspconfig'
43+ " Plug 'nvim-lua/completion-nvim'
44+ " Plug 'steelsojka/completion-buffers'
45+ Plug ' Shougo/deoplete.nvim' , { ' do' : ' :UpdateRemotePlugins' }
4146call plug#end ()
4247
4348" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -96,7 +101,6 @@ au FocusGained,BufEnter * :checktime
96101if has (' nvim' )
97102 autocmd TermOpen * setlocal nonumber norelativenumber
98103end
99-
100104" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
101105" Mappings "
102106" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -163,15 +167,15 @@ map <leader>cd :cd %:p:h<cr>:pwd<cr>"
163167
164168" Coc.nvim
165169" nmap <silent> gd <Plug>(coc-definition)
166- nmap <silent> gd :call <SID> GoToDefinition()<CR>
167- nmap <silent> gr <Plug> (coc-references)
168- nmap <leader> rn <Plug> (coc-rename)
169- nnoremap <silent> K :call <SID> show_documentation()<CR>
170+ " nmap <silent> gd :call <SID>GoToDefinition()<CR>
171+ " nmap <silent> gr <Plug>(coc-references)
172+ " nmap <leader>rn <Plug>(coc-rename)
173+ " nnoremap <silent> K :call <SID>show_documentation()<CR>
170174
171175" ALE
172- map <leader> = :ALEFix<cr>
173- nmap <silent> [e <Plug> (ale_previous_wrap)
174- nmap <silent> ]e <Plug> (ale_next_wrap)
176+ " map <leader>= :ALEFix<cr>
177+ " nmap <silent> [e <Plug>(ale_previous_wrap)
178+ " nmap <silent> ]e <Plug>(ale_next_wrap)
175179
176180" Ack
177181nnoremap <leader> a :Ack!<Space>
@@ -359,26 +363,26 @@ nmap <leader>8 <Plug>AirlineSelectTab8
359363nmap <leader> 9 <Plug> AirlineSelectTab9
360364
361365" Coc.nvim setting
362- inoremap <silent> <expr> <Tab>
363- \ pumvisible() ? "\<C-n> " :
364- \ <SID> check_back_space() ? "\<Tab> " :
365- \ coc#refresh()
366- inoremap <expr> <S-Tab> pumvisible() ? "\<C-p> " : "\<S-Tab> "
367- inoremap <expr> <C-j> pumvisible() ? "\<C-n> " : "\<Tab> "
368- inoremap <expr> <C-k> pumvisible() ? "\<C-p> " : "\<S-Tab> "
366+ " inoremap <silent><expr> <Tab>
367+ " \ pumvisible() ? "\<C-n>" :
368+ " \ <SID>check_back_space() ? "\<Tab>" :
369+ " \ coc#refresh()
370+ " inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
371+ " inoremap <expr> <C-j> pumvisible() ? "\<C-n>" : "\<Tab>"
372+ " inoremap <expr> <C-k> pumvisible() ? "\<C-p>" : "\<S-Tab>"
369373
370374function ! s: check_back_space () abort
371375 let col = col (' .' ) - 1
372376 return ! col || getline (' .' )[col - 1 ] = ~ ' \s'
373377endfunction
374378
375- function ! s: show_documentation ()
376- if (index ([' vim' ,' help' ], &filetype ) >= 0 )
377- execute ' h ' .expand (' <cword>' )
378- else
379- call CocAction (' doHover' )
380- endif
381- endfunction
379+ " function! s:show_documentation()
380+ " if (index(['vim','help'], &filetype) >= 0)
381+ " execute 'h '.expand('<cword>')
382+ " else
383+ " call CocAction('doHover')
384+ " endif
385+ " endfunction
382386
383387" Fzf
384388" let g:fzf_layout = { 'down': '~30%' }
@@ -416,18 +420,18 @@ command! -bang -nargs=* Rg
416420let g: fzf_tags_prompt = " Gd "
417421
418422" Ale plugin
419- let g: ale_ruby_rubocop_executable = ' bundle'
423+ " let g:ale_ruby_rubocop_executable = 'bundle'
420424
421- let b: ale_linters = {
422- \ ' python' : [' pylint' ],
423- \ ' ruby' : [' rubocop' ],
424- \}
425+ " let b:ale_linters = {
426+ " \ 'python': ['pylint'],
427+ " \ 'ruby': ['rubocop'],
428+ " \}
425429
426- let g: ale_fixers = {
427- \ ' *' : [' remove_trailing_lines' , ' trim_whitespace' ],
428- \ ' python' : [' black' ],
429- \ ' ruby' : [' rubocop' ],
430- \}
430+ " let g:ale_fixers = {
431+ " \ '*': ['remove_trailing_lines', 'trim_whitespace'],
432+ " \ 'python': ['black'],
433+ " \ 'ruby': ['rubocop'],
434+ " \}
431435
432436" Indentline
433437let g: indentLine_char = ' │'
@@ -539,16 +543,16 @@ function! VisualSelection(direction, extra_filter) range
539543 let @" = l: saved_reg
540544endfunction
541545
542- function ! s: GoToDefinition ()
543- if CocAction (' jumpDefinition' )
544- return v: true
545- endif
546+ " function! s:GoToDefinition()
547+ " if CocAction('jumpDefinition')
548+ " return v:true
549+ " endif
546550
547- let ret = execute (" FZFTags" )
548- if ret !~ ' not found'
549- execute (" normal 0" )
550- endif
551- endfunction
551+ " let ret = execute("FZFTags")
552+ " if ret !~ 'not found'
553+ " execute("normal 0")
554+ " endif
555+ " endfunction
552556
553557function ! ToggleDefxWidth (winwidth )
554558 if a: winwidth == ' 30'
@@ -563,3 +567,33 @@ augroup RubySpecialKeywordCharacters
563567 autocmd Filetype ruby setlocal iskeyword += !
564568 autocmd Filetype ruby setlocal iskeyword += ?
565569augroup END
570+
571+ " autocmd BufEnter * lua require'completion'.on_attach()
572+ " " Use <Tab> and <S-Tab> to navigate through popup menu
573+ " inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
574+ " inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
575+
576+ " " Set completeopt to have a better completion experience
577+ " set completeopt=menuone,noinsert,noselect
578+
579+ " " Avoid showing message extra message when using completion
580+ " set shortmess+=c
581+
582+ " let g:completion_chain_complete_list = [
583+ " \{'complete_items': ['buffers']},
584+ " \{'mode': '<c-p>'},
585+ " \{'mode': '<c-n>'}
586+ " \]
587+ " " file, buffer, around, solargraph
588+ " let g:completion_matching_strategy_list = ['fuzzy', 'all']
589+ " let g:completion_timer_cycle = 1
590+
591+ let g: deoplete #enable_at_startup = 1
592+ inoremap <silent> <expr> <TAB>
593+ \ pumvisible() ? "\<C-n> " :
594+ \ <SID> check_back_space() ? "\<TAB> " :
595+ \ deoplete#manual_complete()
596+ inoremap <expr> <C-j> pumvisible() ? "\<C-n> " : "\<Tab> "
597+ inoremap <expr> <C-k> pumvisible() ? "\<C-p> " : "\<S-Tab> "
598+
599+ lua require (" lsp_config" )
0 commit comments