feat: Add language servers

This commit is contained in:
punkfairie 2025-01-05 12:06:18 -08:00
parent 35f310e0a9
commit 6eb0d74ec0
Signed by: punkfairie
GPG key ID: A509E8F77FB9D696
10 changed files with 106 additions and 3 deletions

View file

@ -143,6 +143,10 @@ with final.pkgs.lib; let
emmet-language-server emmet-language-server
lua-language-server lua-language-server
nixd nixd
phpactor
stylelint-lsp
taplo
vscode-langservers-extracted # html, css, json, eslint
# Linters # Linters
biome biome
@ -157,7 +161,6 @@ with final.pkgs.lib; let
php84Packages.php-cs-fixer php84Packages.php-cs-fixer
nodePackages.prettier nodePackages.prettier
rustywind rustywind
taplo
shfmt shfmt
stylelint stylelint
stylua stylua

View file

@ -1,17 +1,20 @@
return { return {
cmd = { 'emmet-language-server', '--stdio' }, cmd = { 'emmet-language-server', '--stdio' },
filetypes = { filetypes = {
'blade',
'css', 'css',
'eruby', 'eruby',
'html', 'html',
'htmlangular',
'htmldjango', 'htmldjango',
'javascriptreact', 'javascriptreact',
'less', 'less',
'liquid',
'pug', 'pug',
'sass', 'sass',
'scss', 'scss',
'typescriptreact', 'typescriptreact',
'htmlangular', 'vue',
}, },
root_markers = { '.git' }, root_markers = { '.git' },
} }

View file

@ -1,6 +1,6 @@
return { return {
filetypes = { 'lua' },
cmd = { 'lua-language-server' }, cmd = { 'lua-language-server' },
filetypes = { 'lua' },
root_markers = { root_markers = {
'.luarc.json', '.luarc.json',
'.luarc.jsonc', '.luarc.jsonc',

24
nvim/lsp/nixd.lua Normal file
View file

@ -0,0 +1,24 @@
return {
cmd = { 'nixd' },
filetypes = { 'nix' },
root_markers = { 'flake.nix', '.git' },
settings = {
nixd = {
formatting = {
command = { 'alejandra' },
},
options = {
nixos = {
expr = '(builtins.getFlake "/home/marley/marleyos").nixosConfigurations.nyx.options',
},
['home-manager'] = {
expr = '(builtins.getFlake "/home/marley/marleyos").homeConfigurations."marley@nyx".options',
},
['nix-darwin'] = {
expr = '(builtins.getFlake "/home/marley/marleyos").darwinConfigurations.mairley.options',
},
},
},
},
}

10
nvim/lsp/phpactor.lua Normal file
View file

@ -0,0 +1,10 @@
return {
cmd = { 'phpactor', 'language-server' },
filetypes = { 'php', 'blade' },
root_markers = {
'composer.json',
'.git',
'.phpactor.json',
'.phpactor.yml',
},
}

View file

@ -0,0 +1,29 @@
return {
cmd = { 'stylelint-lsp', '--stdio' },
filetypes = {
'css',
'less',
'scss',
'sugarss',
'vue',
'wxss',
},
root_markers = {
'.stylelintrc',
'.stylelintrc.cjs',
'.stylelintrc.js',
'.stylelintrc.json',
'.stylelintrc.yaml',
'.stylelintrc.yml',
'stylelint.config.cjs',
'stylelint.config.js',
},
settings = {
stylelintplus = {
autoFixOnFormat = true,
validateOnSave = true,
validateOnType = false,
},
},
}

5
nvim/lsp/taplo.lua Normal file
View file

@ -0,0 +1,5 @@
return {
cmd = { 'taplo', 'lsp', 'stdio' },
filetypes = { 'toml' },
root_markers = { '.git' },
}

View file

@ -0,0 +1,12 @@
return {
cmd = { 'vscode-css-language-server', '--stdio' },
filetypes = { 'css', 'scss', 'less' },
root_markers = { 'package.json', '.git' },
init_options = { provideFormatter = true },
settings = {
css = { validate = true },
scss = { validate = true },
less = { validate = true },
},
}

View file

@ -0,0 +1,11 @@
return {
cmd = { 'vscode-html-language-server', '--stdio' },
filetypes = { 'html', 'templ', 'liquid' },
root_markers = { 'package.json', '.git' },
init_options = {
provideFormatter = true,
embeddedLanguages = { css = true, javascript = true },
configurationSection = { 'html', 'css', 'javascript' },
},
}

View file

@ -83,6 +83,12 @@ vim.lsp.enable({
'bash-language-server', 'bash-language-server',
'emmet-language-server', 'emmet-language-server',
'lua-language-server', 'lua-language-server',
'nixd',
'phpactor',
'stylelint-lsp',
'taplo',
'vscode-css-language-server',
'vscode-html-language-server',
}) })
-- Keymaps -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Keymaps -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --