Compare commits

...

2 Commits

2 changed files with 57 additions and 43 deletions

View File

@@ -1,6 +1,6 @@
[user] [user]
name = Your Name name = Edwin van den Houdt
email = you@example.com email = eho@respellion.nl
[core] [core]
editor = nvim editor = nvim

View File

@@ -148,10 +148,10 @@ require('lazy').setup({
-- -------------------------------------------------------- -- --------------------------------------------------------
{ {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
tag = 'v0.9.3',
build = ':TSUpdate', build = ':TSUpdate',
config = function() config = function()
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
-- Install these parsers automatically
ensure_installed = { ensure_installed = {
'bash', 'lua', 'markdown', 'markdown_inline', 'bash', 'lua', 'markdown', 'markdown_inline',
'typescript', 'javascript', 'c_sharp', 'typescript', 'javascript', 'c_sharp',
@@ -166,19 +166,22 @@ require('lazy').setup({
-- -------------------------------------------------------- -- --------------------------------------------------------
-- LSP: language server protocol -- LSP: language server protocol
-- -------------------------------------------------------- -- --------------------------------------------------------
-- mason installs language servers for you. -- mason installs language servers.
-- mason-lspconfig bridges mason and nvim-lspconfig. -- mason-lspconfig makes mason-installed servers available to Neovim.
-- Neovim 0.11+ has a native vim.lsp.config API — no need to call
-- lspconfig.server.setup {} anymore.
{ {
'neovim/nvim-lspconfig',
dependencies = {
'williamboman/mason.nvim', 'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
},
config = function() config = function()
-- mason must be set up first
require('mason').setup() require('mason').setup()
end,
},
{
'williamboman/mason-lspconfig.nvim',
dependencies = { 'williamboman/mason.nvim' },
config = function()
require('mason-lspconfig').setup { require('mason-lspconfig').setup {
-- These servers are installed automatically -- These servers are installed automatically via mason
ensure_installed = { ensure_installed = {
'ts_ls', -- TypeScript / JavaScript 'ts_ls', -- TypeScript / JavaScript
'omnisharp', -- C# and F# 'omnisharp', -- C# and F#
@@ -186,8 +189,40 @@ require('lazy').setup({
'lua_ls', -- Lua (for editing this config) 'lua_ls', -- Lua (for editing this config)
}, },
} }
end,
},
{
-- nvim-lspconfig still provides default cmd/root detection per server.
-- We use it as a data source only — no setup() calls per server.
'neovim/nvim-lspconfig',
dependencies = { 'williamboman/mason-lspconfig.nvim' },
config = function()
-- Keymaps that only activate when an LSP attaches to a buffer -- Server-specific settings using the native 0.11 API.
-- vim.lsp.config(name, opts) sets config for a server.
-- vim.lsp.enable(name) starts it when the right filetype opens.
vim.lsp.config('ts_ls', {})
vim.lsp.config('omnisharp', {
-- Uncomment and point to your solution file if needed:
-- cmd = { 'omnisharp', '--solution-path', 'YourSolution.sln' },
})
vim.lsp.config('marksman', {})
vim.lsp.config('lua_ls', {
settings = {
Lua = {
-- Tell the Lua LSP about Neovim's vim global
diagnostics = { globals = { 'vim' } },
},
},
})
vim.lsp.enable({ 'ts_ls', 'omnisharp', 'marksman', 'lua_ls' })
-- Keymaps that activate only when an LSP attaches to a buffer
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd('LspAttach', {
callback = function(event) callback = function(event)
local map = function(keys, func, desc) local map = function(keys, func, desc)
@@ -201,27 +236,6 @@ require('lazy').setup({
map('<leader>ca', vim.lsp.buf.code_action, 'Code action') map('<leader>ca', vim.lsp.buf.code_action, 'Code action')
end, end,
}) })
-- Server-specific settings
local lspconfig = require 'lspconfig'
lspconfig.ts_ls.setup {}
lspconfig.omnisharp.setup {
-- Point to your solution file if needed
-- cmd = { 'omnisharp', '--solution-path', 'YourSolution.sln' },
}
lspconfig.marksman.setup {}
lspconfig.lua_ls.setup {
settings = {
Lua = {
-- Teach the Lua LSP about Neovim's globals
diagnostics = { globals = { 'vim' } },
},
},
}
end, end,
}, },