After some further debugging, I did the following extra steps:

  * patched nimlsp to work on Windows (sent as a PR 
[nimlsp#25](https://github.com/PMunch/nimlsp/pull/25))
  * built nimlsp with Nim 0.20.0 (to avoid 
[nim#11801](https://github.com/nim-lang/Nim/issues/11801))



With the following additions in my .vimrc, it seems to more or less work 
(though the service seems to hang or crash not so rarely):
    
    
    " (...)
    Plugin 'prabirshrestha/async.vim'
    Plugin 'prabirshrestha/vim-lsp'
    " (...)
    
    " Nim language support via Language Server Protocol:
    " prabirshrestha/vim-lsp + nimlsp
    let g:lsp_log_verbose = 1
    let g:lsp_log_file = expand('$TEMP/vim-lsp.log')
    " let g:lsp_log_file = expand('~/vim-lsp.log')
    " Closes the preview window on the second call to preview (e.g. (lsp-hover))
    let g:lsp_preview_doubletap = [function('lsp#ui#vim#output#closepreview')]
    let g:lsp_async_completion = 1
    if executable('nimlsp')
            augroup akavelnimlsp
                    au!
                    " nimble install nimlsp
                    au User lsp_setup call lsp#register_server({
                            \ 'name': 'nimlsp',
                            \ 'cmd': {server_info->[&shell, &shellcmdflag, 
'nimlsp c:\\dnload\\nim-etc\\nim']},
                            \ 'whitelist': ['nim'],
                            \ })
                    
                    " See: :help vim-lsp-mappings
                    au FileType nim nmap gd <plug>(lsp-definition)
                    au FileType nim nmap K <plug>(lsp-hover)
                    
                    " See: vim-lsp-omnifunc
                    au FileType nim setlocal omnifunc=lsp#complete
            augroup END
    endif
    
    
    Run

where C:dnloadnim-etcnim is the path to where I have Nim downloaded.

Reply via email to