Remove global tools and language servers
Re-add them as needed for each specific project using each project's flake.nix file.
This commit is contained in:
parent
e654473e97
commit
724753327c
5 changed files with 11 additions and 175 deletions
|
@ -52,6 +52,13 @@
|
|||
inherit (pkgs) mkShell;
|
||||
in
|
||||
{
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
lua54Packages.luacheck
|
||||
nixd
|
||||
];
|
||||
};
|
||||
|
||||
packages.${system} = {
|
||||
default = mkShell { buildInputs = with pkgs; [ just ]; };
|
||||
};
|
||||
|
|
|
@ -90,3 +90,5 @@ vim.keymap.set("n", "<leader>gx", function()
|
|||
local url = vim.fn.expand "<cfile>"
|
||||
vim.fn["netrw#BrowseX"](url, 0)
|
||||
end, { desc = "Open URL under cursor" })
|
||||
|
||||
set("n", "<leader>f", vim.lsp.buf.format);
|
||||
|
|
|
@ -1,112 +1,3 @@
|
|||
local cmp_nvim_lsp = require "cmp_nvim_lsp"
|
||||
local handlers = require "opdavies.lsp.handlers"
|
||||
local lspconfig = require "lspconfig"
|
||||
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
lspconfig.bashls.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
lspconfig.cssls.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = function(_, _)
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(handlers.on_publish_diagnostics, {})
|
||||
end,
|
||||
}
|
||||
|
||||
lspconfig.emmet_language_server.setup {
|
||||
capabilities = capabilities,
|
||||
filetypes = { "css", "html", "sass", "scss", "twig" },
|
||||
}
|
||||
|
||||
lspconfig.gopls.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
lspconfig.html.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
lspconfig.phpactor.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
lspconfig.lua_ls.setup {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
},
|
||||
telemetry = {
|
||||
enabled = false,
|
||||
},
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
lspconfig.marksman.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
lspconfig.nixd.setup {
|
||||
capabilities = capabilities,
|
||||
cmd = { "nixd" },
|
||||
settings = {
|
||||
nixd = {
|
||||
nixpkgs = {
|
||||
expr = "import <nixpkgs> { }",
|
||||
},
|
||||
formatting = {
|
||||
command = "nix fmt",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
lspconfig.tailwindcss.setup {
|
||||
capabilities = capabilities,
|
||||
filetypes = { "html", "javascript", "twig", "typescript", "vue" },
|
||||
settings = {
|
||||
init_options = {
|
||||
userLanguages = {
|
||||
["html.twig"] = "html",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
lspconfig.terraformls.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
lspconfig.ts_ls.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
lspconfig.vuels.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
lspconfig.yamlls.setup {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
yaml = {
|
||||
keyOrdering = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vim.diagnostic.config {
|
||||
float = { source = true },
|
||||
signs = true,
|
||||
|
@ -131,12 +22,3 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
|||
vim.keymap.set("n", "<leader>dl", vim.diagnostic.setqflist, { buffer = 0 })
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>dd", function()
|
||||
vim.diagnostic.enable(false)
|
||||
vim.diagnostic.reset()
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>de", function()
|
||||
vim.diagnostic.enable(true)
|
||||
end)
|
||||
|
|
|
@ -17,7 +17,6 @@ in
|
|||
programs.neovim =
|
||||
let
|
||||
php = pkgs.php82;
|
||||
phpPackages = pkgs.php82Packages;
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
|
@ -130,51 +129,6 @@ in
|
|||
# Themes
|
||||
catppuccin-nvim
|
||||
];
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
# Languages
|
||||
nodePackages.typescript
|
||||
nodejs-slim
|
||||
php
|
||||
|
||||
# Language servers
|
||||
bash-language-server
|
||||
dockerfile-language-server-nodejs
|
||||
emmet-language-server
|
||||
gopls
|
||||
lua-language-server
|
||||
lua54Packages.luacheck
|
||||
marksman
|
||||
nixd
|
||||
phpactor
|
||||
tailwindcss-language-server
|
||||
terraform-ls
|
||||
typescript-language-server
|
||||
vscode-langservers-extracted
|
||||
vue-language-server
|
||||
yaml-language-server
|
||||
|
||||
# Formatters
|
||||
black
|
||||
eslint_d
|
||||
nixfmt-rfc-style
|
||||
nodePackages.prettier
|
||||
stylua
|
||||
yamlfmt
|
||||
|
||||
# Tools
|
||||
hadolint
|
||||
html-tidy
|
||||
mariadb
|
||||
nodePackages.jsonlint
|
||||
nodePackages.markdownlint-cli
|
||||
phpPackages.php-codesniffer
|
||||
phpPackages.phpstan
|
||||
proselint
|
||||
ripgrep
|
||||
shellcheck
|
||||
yamllint
|
||||
];
|
||||
};
|
||||
|
||||
xdg.configFile.nvim = {
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
|
@ -11,13 +6,9 @@ let
|
|||
cfg = config.coding.phpactor;
|
||||
in
|
||||
{
|
||||
options.coding.phpactor.enable = lib.mkEnableOption "Enable phpactor";
|
||||
options.coding.phpactor.enable = mkEnableOption "Enable phpactor";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
phpactor
|
||||
];
|
||||
|
||||
xdg.configFile.phpactor = {
|
||||
source = ./config;
|
||||
recursive = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue