【问题标题】:How to configure vim/nvim on ubuntu 18.04 for c# .net-core development with autocompletion如何在 ubuntu 18.04 上为 c# .net-core 开发配置自动完成功能的 vim/nvim
【发布时间】:2018-05-18 01:20:23
【问题描述】:

我安装了 .net-core 2.0.0 的 ubuntu 18.04 机器。 我还安装了 (neovim)nvim v0.2.2。

我能够在我的 ubuntu 机器上构建和运行 .net-core 项目。 我的问题是如何将 vim/nvim 与 c# 自动完成一起用于我的 .net-core 项目。 我已经为我的 nvim 安装了 Omnisharp-vim 插件,但它不工作。 我尝试配置omnisharp-roslyn,但没有运气。我在 Omnisharp github 页面上读到,我需要安装 Omnisharp-roslyn 服务器才能使 Omnisharp-vim 工作。不幸的是没有运气。 我在 youtube 上看到有人在 vim 中使用自动补全功能编写 c#。

知道如何设置吗?因为我很想在我的 ubuntu 机器上拥有这个功能。

谢谢

【问题讨论】:

    标签: c# vim .net-core neovim ubuntu-18.04


    【解决方案1】:

    您可以毫无问题地使用。查看我的 C# 配置:

    " C#
    Plug 'https://github.com/adelarsq/vim-csharp', {'for':['cs','csx','cshtml.html','csproj','solution']}
    Plug 'https://github.com/OmniSharp/omnisharp-vim', {'for':['cs','csx','cshtml.html','csproj','solution'], 'on': ['OmniSharpInstall']}
    
    let g:OmniSharp_server_stdio = 1
    let g:OmniSharp_selector_ui = ''       " Use vim - command line, quickfix etc.
    let g:OmniSharp_highlight_types = 2
    
    augroup my_omnisharp
        autocmd!
        au FileType cs nmap <buffer> <silent> ga :OmniSharpGetCodeActions<CR>
        au FileType cs nmap <buffer> <silent> gd :OmniSharpGotoDefinition<CR>
        au FileType cs nmap <buffer> <silent> gq :OmniSharpCodeFormat<CR>
        au FileType cs nmap <buffer> <silent> gu :OmniSharpFixUsings<CR>
        au FileType cs nmap <buffer> <silent> gr :OmniSharpFindUsages<CR>
        au FileType cs nmap <buffer> <silent> gK :OmniSharpDocumentation<CR>
        au FileType cs nmap <buffer> <silent> <F2> :OmniSharpRename<CR>
    augroup END
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-15
      • 2022-06-16
      • 1970-01-01
      • 2011-10-31
      • 1970-01-01
      • 2021-04-14
      相关资源
      最近更新 更多