diff --git a/config/nvim/lua/nifoc/config/diagnostic.lua b/config/nvim/lua/nifoc/config/diagnostic.lua index 4a51105..f0357a3 100644 --- a/config/nvim/lua/nifoc/config/diagnostic.lua +++ b/config/nvim/lua/nifoc/config/diagnostic.lua @@ -1,7 +1,7 @@ vim.diagnostic.config({ underline = true, virtual_text = { - source = 'if_many', + source = false, }, signs = false, update_in_insert = false, diff --git a/config/nvim/lua/nifoc/config/null_ls.lua b/config/nvim/lua/nifoc/config/null_ls.lua index 0b93c8a..898180f 100644 --- a/config/nvim/lua/nifoc/config/null_ls.lua +++ b/config/nvim/lua/nifoc/config/null_ls.lua @@ -9,7 +9,6 @@ null_ls.setup({ builtins.formatting.fish_indent, builtins.formatting.shfmt.with({extra_args = { '-i', '2' }}), - builtins.diagnostics.ansiblelint, builtins.diagnostics.credo, builtins.diagnostics.hadolint, builtins.diagnostics.shellcheck.with({extra_args = { '-f', 'gcc', '-x' }}), diff --git a/config/nvim/lua/nifoc/utils/diagnostic.lua b/config/nvim/lua/nifoc/utils/diagnostic.lua index 178b8e0..aa552c4 100644 --- a/config/nvim/lua/nifoc/utils/diagnostic.lua +++ b/config/nvim/lua/nifoc/utils/diagnostic.lua @@ -3,7 +3,9 @@ local M = {} local keymap = require('nifoc.keymap') function M.maybe_enable_lsp(client, bufnr) - if vim.b.nifoc_lsp_enabled == nil then + local nifoc_lsp_enabled = vim.api.nvim_buf_get_var(bufnr, 'nifoc_lsp_enabled') + + if nifoc_lsp_enabled == nil then vim.api.nvim_buf_set_var(bufnr, 'nifoc_lsp_enabled', 1) keymap.lsp_attach(client, bufnr) @@ -11,7 +13,9 @@ function M.maybe_enable_lsp(client, bufnr) end function M.maybe_enable_fixer(client, bufnr) - if client.resolved_capabilities.document_formatting and vim.b.nifoc_fixer_enabled == nil then + local nifoc_fixer_enabled = vim.api.nvim_buf_get_var(bufnr, 'nifoc_fixer_enabled') + + if client.resolved_capabilities.document_formatting and nifoc_fixer_enabled == nil then vim.api.nvim_buf_set_var(bufnr, 'nifoc_fixer_enabled', 1) vim.cmd [[ diff --git a/flake.lock b/flake.lock index 155514c..c14edb7 100644 --- a/flake.lock +++ b/flake.lock @@ -61,11 +61,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1639886342, - "narHash": "sha256-OkI09enAc4ID1zrxLkHR5b+WgUL2r2C9BIG4+gwVDFU=", + "lastModified": 1639947653, + "narHash": "sha256-odG+fhjB0OavINI9ELUPhBHUmKQ+lqlSkcmHdgFbhTY=", "owner": "neovim", "repo": "neovim", - "rev": "abdf3a8128b78fb98ee944bc5d3086c680d779ed", + "rev": "67bb01ae27db3cbba9e2e908c4e6612040f650aa", "type": "github" }, "original": { @@ -84,11 +84,11 @@ ] }, "locked": { - "lastModified": 1639901638, - "narHash": "sha256-ZMP2xjjo3tHlWfgCd3Odn6qKNpNbvbawjcVpww54A1U=", + "lastModified": 1639988082, + "narHash": "sha256-9YPZgGP/C9AKLxSYmw9R8tn64bZ0WM2OYIui+2PLwPw=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "8f7a0bbc9080f55c000344658a071994aa9c6b4b", + "rev": "116189ff27ac056faa8ec3f7ecc6dc3f6f565b67", "type": "github" }, "original": { @@ -119,11 +119,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1639925673, - "narHash": "sha256-hR/d0JcT11z6Bi69ipowMtvRye7OymVfDw1/wwVBWnc=", + "lastModified": 1639955162, + "narHash": "sha256-bRhzK0h4n1YirCsJz7pkpXXy2+ruth/bUh7PwRrRnW4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c62eb9c6aea5ae8210dd86ff24fa6b51f8872db7", + "rev": "2beba9a23a8381eb95187f46b10c3677d8f63ca1", "type": "github" }, "original": { diff --git a/programs/nvim/default.nix b/programs/nvim/default.nix index 7c00480..cf4b4a6 100644 --- a/programs/nvim/default.nix +++ b/programs/nvim/default.nix @@ -24,6 +24,7 @@ in # LSP nodePackages.bash-language-server nodePackages.dockerfile-language-server-nodejs + nodePackages.typescript-language-server nodePackages.vscode-langservers-extracted nodePackages.yaml-language-server rnix-lsp @@ -31,7 +32,6 @@ in taplo-lsp # LSP Tools - ansible-lint hadolint shellcheck shfmt diff --git a/programs/nvim/plugins.nix b/programs/nvim/plugins.nix index 47eb596..eca3be4 100644 --- a/programs/nvim/plugins.nix +++ b/programs/nvim/plugins.nix @@ -99,12 +99,12 @@ }; nvim-treesitter = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "nvim-treesitter"; - version = "1639864170"; + version = "1639992650"; src = pkgs.fetchFromGitHub { owner = "nvim-treesitter"; repo = "nvim-treesitter"; - rev = "e01c7ce9727b9d18b71b41cc792cb4719e469598"; - sha256 = "I9+GPTRkKaT8MN9Vqeif6SG3NqzUA7qvKxcYWVsSHKY="; + rev = "2752160771c679a7d92a4664de133d7750ab5448"; + sha256 = "LXxYT9QCkm0lKDyTPJwswZ5c0IpcIGMxhauVH/ESNiY="; fetchSubmodules = false; }; meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter"; @@ -196,12 +196,12 @@ }; nvim-lspconfig = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "nvim-lspconfig"; - version = "1639765938"; + version = "1639958794"; src = pkgs.fetchFromGitHub { owner = "neovim"; repo = "nvim-lspconfig"; - rev = "0f72e5468e510429d5f14b73c93fb528ead1fdaa"; - sha256 = "XUNahLXiDk8iJEUAyKj/Ru8N0NUIX+1xWY0obOFTT40="; + rev = "c018b1e92e66b3429a2f167d59211846774f1e3b"; + sha256 = "CRa1Z4LaDuvIwmwsKIypt6w+GZbFfi0JDEYQoHxl+Rc="; fetchSubmodules = false; }; meta.homepage = "https://github.com/neovim/nvim-lspconfig"; @@ -268,12 +268,12 @@ }; nvim-cmp = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "nvim-cmp"; - version = "1639842196"; + version = "1639979656"; src = pkgs.fetchFromGitHub { owner = "hrsh7th"; repo = "nvim-cmp"; - rev = "b11f8bbee3d7ba5190b043e23bd6f5b9cb82382c"; - sha256 = "xiC5cCUE18S5M2rxDXCTwLV5ZmCy6Z7lDzur53xVAQ0="; + rev = "9c07c2d1c5581b22f742b891cadd42a311c1cf96"; + sha256 = "iiAwGu9dJ249IOYKNJmwEofaicw8jDtcmTSKr4o4g8Y="; fetchSubmodules = false; }; meta.homepage = "https://github.com/hrsh7th/nvim-cmp"; @@ -340,24 +340,24 @@ }; cmp-path = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "cmp-path"; - version = "1639837442"; + version = "1639986819"; src = pkgs.fetchFromGitHub { owner = "hrsh7th"; repo = "cmp-path"; - rev = "e1a69161703171f5804d311005a73b742fbda123"; - sha256 = "wdARGRz1TU/Igb2J49lB2zp/+gFEnTQFipMZOM2A81o="; + rev = "81d88dfcafe26cc0cc856fc66f4677b20e6a9ffc"; + sha256 = "h7/0UNmYSsFIiU4eBMDOqujsuo61CPvC2nv1pfbnA7c="; fetchSubmodules = false; }; meta.homepage = "https://github.com/hrsh7th/cmp-path"; }; cmp-buffer = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "cmp-buffer"; - version = "1638920207"; + version = "1639956440"; src = pkgs.fetchFromGitHub { owner = "hrsh7th"; repo = "cmp-buffer"; - rev = "a0fe52489ff6e235d62407f8fa72aef80222040a"; - sha256 = "FYAb3Wv9wbaxvv7PXi4ko4mqmsRo2V7yM42Ci+3ST0w="; + rev = "e26cdfb26f645cd4c6330b541b7e74ff69daa483"; + sha256 = "YjO4zGm7TKZZv0mMsh9oM2wC+FKoq38bSmfZ3XqXWlc="; fetchSubmodules = false; }; meta.homepage = "https://github.com/hrsh7th/cmp-buffer"; @@ -412,36 +412,36 @@ }; nvim-ts-autotag = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "nvim-ts-autotag"; - version = "1633755976"; + version = "1639950366"; src = pkgs.fetchFromGitHub { owner = "windwp"; repo = "nvim-ts-autotag"; - rev = "80d427af7b898768c8d8538663d52dee133da86f"; - sha256 = "8SINCRoarkkQdrKzq4xujn197G4BRHQ7HYJQj929nME="; + rev = "0ceb4ef342bf1fdbb082ad4fa1fcfd0f864e1cba"; + sha256 = "5410HeSpgID+Nf/5Yowxgw9yUl9nkI+EM5sD+6yEci0="; fetchSubmodules = false; }; meta.homepage = "https://github.com/windwp/nvim-ts-autotag"; }; Comment-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "Comment.nvim"; - version = "1639729979"; + version = "1639986940"; src = pkgs.fetchFromGitHub { owner = "numToStr"; repo = "Comment.nvim"; - rev = "cedca3967c25c1755992044b8d0e7917fb98d2ff"; - sha256 = "0YOiRHgxcwXHLQxErx3g5O8hiBsXKmnfXBnl5M8eJ7g="; + rev = "b7e18f9477974044b8ba3de93b51cad804a37eed"; + sha256 = "7dfU1Ei1kMBHV2dp4URd+wNrf699CqFq5ZvLWT7mQjU="; fetchSubmodules = false; }; meta.homepage = "https://github.com/numToStr/Comment.nvim"; }; nvim-treesitter-textobjects = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "nvim-treesitter-textobjects"; - version = "1639943238"; + version = "1639954216"; src = pkgs.fetchFromGitHub { owner = "nvim-treesitter"; repo = "nvim-treesitter-textobjects"; - rev = "c4be3a42715dd44ea9465662ad7e3b010f6acf47"; - sha256 = "xz9H8vb4fHBmpeLeUqluP1jS0DnIIhaafIV+NLE1WWY="; + rev = "a9b7d9beeaae07e87aeb78765cfa53e1c5eae1f6"; + sha256 = "WSBs8Kj4LF89Fe/SMKtTeQD5jck4v6vck3Imx2xCF0c="; fetchSubmodules = false; }; meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects";