I was reading a blog post for Settings up a C# Development Environment with Vim on Debian and I got most of this going except I have an issue with the <C-x><C-o>
inoremap'ing. I am running both Vim 8.2 and NeoVim 0.4.3 on WSL on Windows 10. OmniSharp-Vim seems to have installed and started OmniSharp-roslyn as when I do ps aux
I see the /home/user01/.cache/omnisharp-vim/omnisharp-roslyn/bin/mono /home/user01/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/OmniSharp.exe
command running.
The original line is:
inoremap <expr> <Tab> pumvisible() ? '<C-n>' :
\ getline('.')[col('.')-2] =~# '[[:alnum:].-_#$]' ? '<C-x><C-o>' : '<Tab>'
and I thought to wrap it in an augroup
with an autocmd
so its not always running.
augroup phil_omnisharp_settings
autocmd FileType cs inoremap <expr> <Tab> pumvisible() ? '<C-n>' : \ getline('.')[col('.')-2] =~# '[[:alnum:].-_#$]' ? '<C-x><C-o>' : '<Tab>'
"autocmd FileType cs remap <C-o><C-u> :OmniSharpFindUsages<CR>
autocmd FileType cs nnoremap <C-o><C-d> :OmniSharpGotoDefinition<CR>
autocmd FileType cs nnoremap <C-o><C-d><C-p> :OmniSharpPreviewDefinition<CR>
autocmd FileType cs nnoremap <C-o><C-r> :!dotnet run
augroup END
This will start as expected, but when I get to a System.Console.<Tab>
I get the following error:
E15: Invalid expression: \ getline('.')[col('.')-2] =~# '[[:alnum:].-_#$]' ? '^X^O' : '^I'
or System.Console.<C-x><C-o>
sequence I get the following error:
-- Omni completion (^O^N^P) Pattern not found
I would just run Vim/NeoVim on Windows, but I ran into issues with neither having +python
or +python3
support enabled. Vim 8.2 had something called +python/dyn
enabled, which OmniSharp didn't seem to like either if I used the HTTP method, and the socket method didn't work either.
GitHub Gist: https://gist.github.com/predatorian3/01525f9d82b71972f16882de789e6569