www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Tab completion using neovim

reply Alain De Vos <devosalain ymail.com> writes:
Let's say i write
"write" press tab in neovim i want it to guess "writeln".
How to configure neovim for this.
[ Note "ncm2" lets my neovim crash. But maybe there are 
alternatives ]

[ vscode is not an option as compiling electron takes ages]
Jan 21 2023
parent reply Sergey <kornburn yandex.ru> writes:
On Saturday, 21 January 2023 at 13:17:44 UTC, Alain De Vos wrote:
 Let's say i write
 "write" press tab in neovim i want it to guess "writeln".
 How to configure neovim for this.
 [ Note "ncm2" lets my neovim crash. But maybe there are 
 alternatives ]

 [ vscode is not an option as compiling electron takes ages]
Is Ctrl+Space doing suggestion? It could also be “writefln”.. so it should make several suggestions.
Jan 21 2023
parent reply Alain De Vos <devosalain ymail.com> writes:
I managed after some tuning.
cat coc-settings.json
```
{
		"languageserver": {
		"d": {
			"command": "/usr/home/x/serve-d/serve-d",
			"filetypes": ["d"],
			"trace.server": "on",
			"rootPatterns": ["dub.json", "dub.sdl"],
			"initializationOptions": {
			},
			"settings": {
			}
		}
	},
	"suggest.autoTrigger": "none",
	"suggest.noselect": false
}
```



cat init.vim
```
call plug#begin()
"--------------------------------------------------------------------
Plug 'neovim/nvim-lspconfig'
Plug 'idanarye/vim-dutyl'
Plug 'landaire/deoplete-d'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
call plug#end()
let g:ycm_language_server = [
             \ {
             \     'name': 'd',
             \     'cmdline': ['/usr/home/x/serve-d/serve-d'],
             \     'filetypes': ['d'],
             \ }]
let g:deoplete#sources#d#dcd_client_binary = 'dcd-client'
let g:deoplete#sources#d#dcd_server_binary = 'dcd-server'
let g:deoplete#sources#d#dcd_server_autostart = 1
```
Jan 21 2023
parent Alain De Vos <devosalain ymail.com> writes:
```
call dutyl#register#tool('dcd-client','dcd-client')
call dutyl#register#tool('dcd-server','dcd-server')
call deoplete#custom#option('auto_complete_delay',200)
```
Jan 21 2023