@@ -277,8 +277,9 @@ require('lazy').setup({
277277 -- after the plugin has been loaded:
278278 -- config = function() ... end
279279
280-
280+ {
281281
282+ },
282283{
283284 -- Useful plugin to show you pending keybinds.
284285 ' folke/which-key.nvim' ,
@@ -464,6 +465,22 @@ require('lazy').setup({
464465 ' hrsh7th/nvim-cmp' ,
465466 },
466467 config = function ()
468+ local cmp = require ' cmp'
469+ cmp .setup ({
470+ mapping = cmp .mapping .preset .insert ({
471+ [" <C-Space>" ] = cmp .mapping .complete (),
472+ [" <CR>" ] = cmp .mapping .confirm ({ select = true }),
473+ [" <C-j>" ] = cmp .mapping .select_next_item (),
474+ [" <C-k>" ] = cmp .mapping .select_prev_item (),
475+ }),
476+ sources = cmp .config .sources ({
477+ { name = " nvim_lsp" },
478+ { name = " luasnip" },
479+ }, {
480+ { name = " buffer" },
481+ }),
482+ })
483+
467484 -- Brief aside: **What is LSP?**
468485 --
469486 -- LSP is an initialism you've probably heard, but might not understand what it is.
@@ -650,17 +667,13 @@ require('lazy').setup({
650667 },
651668 },
652669 },
653-
654- -- currently using csharp-language-server from mason
655-
656- -- omnisharp = {
657- -- cmd = { 'omnisharp', '--languageserver' },
658- -- filetypes = { 'cs', 'vb', 'cshtml', 'razor', 'html' },
659- -- root_dir = function(fname)
660- -- return require('lspconfig').util.root_pattern('*.sln', '*.csproj', '*.fsproj', '*.vbproj', '*.vcxproj')(fname) or vim.fn.getcwd()
661- -- end,
662- -- },
663- --
670+ omnisharp = {
671+ cmd = { ' omnisharp' , ' --languageserver' },
672+ filetypes = { ' cs' , ' vb' , ' cshtml' , ' razor' , ' html' },
673+ root_dir = function (fname )
674+ return require (' lspconfig' ).util .root_pattern (' *.sln' , ' *.csproj' , ' *.fsproj' , ' *.vbproj' , ' *.vcxproj' )(fname ) or vim .fn .getcwd ()
675+ end ,
676+ },
664677 }
665678
666679 -- Ensure the servers and tools above are installed
0 commit comments