aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim
diff options
context:
space:
mode:
authorLuca Matei Pintilie <luca@lucamatei.com>2024-03-03 21:02:11 +0000
committerLuca Matei Pintilie <luca@lucamatei.com>2024-03-03 21:02:11 +0000
commit54e4e18a13375cbb69ec475aafab3946fbc7a613 (patch)
tree71a86112db5c20aafb419323b0c9ff83fbbd8894 /.config/nvim
parentc10fa602f7c30e03c0bacb9c5cf116d808e86f6d (diff)
downloaddotfiles-54e4e18a13375cbb69ec475aafab3946fbc7a613.tar
dotfiles-54e4e18a13375cbb69ec475aafab3946fbc7a613.tar.gz
dotfiles-54e4e18a13375cbb69ec475aafab3946fbc7a613.tar.bz2
dotfiles-54e4e18a13375cbb69ec475aafab3946fbc7a613.tar.lz
dotfiles-54e4e18a13375cbb69ec475aafab3946fbc7a613.tar.xz
dotfiles-54e4e18a13375cbb69ec475aafab3946fbc7a613.tar.zst
dotfiles-54e4e18a13375cbb69ec475aafab3946fbc7a613.zip
Enable null-ls prettier formatting and disable ufo.nvim
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/lua/lsp.lua56
-rw-r--r--.config/nvim/lua/plugins.lua11
2 files changed, 35 insertions, 32 deletions
diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua
index f5e7738..db6ead9 100644
--- a/.config/nvim/lua/lsp.lua
+++ b/.config/nvim/lua/lsp.lua
@@ -73,7 +73,7 @@ cmp.setup.cmdline(":", {
-- Setup lspconfig.
local capabilities = vim.lsp.protocol.make_client_capabilities()
-cmplsp.default_capabilities(vim.lsp.protocol.make_client_capabilities())
+cmplsp.default_capabilities(capabilities)
-- Enable (broadcasting) snippet capability for completion
capabilities.textDocument.completion.completionItem.snippetSupport = true
@@ -116,7 +116,10 @@ vim.api.nvim_create_autocmd("LspAttach", {
local lsputils = lspconfig.util
lspconfig.tsserver.setup({
- on_attach = on_attach;
+ on_attach = function(client, bufnr)
+ client.resolved_capabilities.document_formatting = false
+ on_attach(client, bufnr)
+ end;
root_dir = lsputils.root_pattern("package.json", "tsconfig.json");
single_file_mode = false;
settings = {
@@ -246,7 +249,7 @@ lspconfig.clangd.setup({ capabilities = capabilities; on_attach = on_attach })
-- lspconfig.dockerls.setup({ capabilities = capabilities; on_attach = on_attach })
-lspconfig.eslint.setup({ capabilities = capabilities; on_attach = on_attach })
+-- lspconfig.eslint.setup({ capabilities = capabilities; on_attach = on_attach })
lspconfig.lua_ls.setup({
capabilities = capabilities;
@@ -277,30 +280,29 @@ lspconfig.jedi_language_server.setup({})
lspconfig.gopls.setup({})
--- Deprecated
--- local null_ls = require("null-ls")
-
--- null_ls.setup({
--- sources = {
--- -- null_ls.builtins.diagnostics.eslint;
--- -- null_ls.builtins.formatting.eslint;
--- null_ls.builtins.formatting.lua_format;
--- -- null_ls.builtins.formatting.prettier;
--- null_ls.builtins.formatting.rustfmt;
--- -- null_ls.builtins.code_actions.shellcheck;
--- -- null_ls.builtins.completion.spell;
--- -- null_ls.builtins.diagnostics.tsc;
--- -- null_ls.builtins.formatting.deno_fmt;
--- -- null_ls.builtins.code_actions.gitsigns.with({
--- -- config = {
--- -- filter_actions = function(title)
--- -- -- filter out blame actions
--- -- return title:lower():match("blame") == nil
--- -- end;
--- -- };
--- -- });
--- };
--- })
+local null_ls = require("null-ls")
+
+null_ls.setup({
+ sources = {
+ -- null_ls.builtins.diagnostics.eslint;
+ -- null_ls.builtins.formatting.eslint;
+ -- null_ls.builtins.formatting.lua_format;
+ null_ls.builtins.formatting.prettier;
+ -- null_ls.builtins.formatting.rustfmt;
+ -- null_ls.builtins.code_actions.shellcheck;
+ -- null_ls.builtins.completion.spell;
+ -- null_ls.builtins.diagnostics.tsc;
+ -- null_ls.builtins.formatting.deno_fmt;
+ -- null_ls.builtins.code_actions.gitsigns.with({
+ -- config = {
+ -- filter_actions = function(title)
+ -- -- filter out blame actions
+ -- return title:lower():match("blame") == nil
+ -- end;
+ -- };
+ -- });
+ };
+})
vim.lsp.handlers["textDocument/hover"] =
vim.lsp.with(vim.lsp.handlers.hover,
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua
index 8506e15..4a66b42 100644
--- a/.config/nvim/lua/plugins.lua
+++ b/.config/nvim/lua/plugins.lua
@@ -72,6 +72,7 @@ local PKGS = {
{ url = "https://github.com/lewis6991/gitsigns.nvim.git" };
-- Deprecated
-- { url = "https://github.com/jose-elias-alvarez/null-ls.nvim.git" };
+ { url = "https://github.com/nvimtools/none-ls.nvim.git" };
{ url = "https://github.com/mfussenegger/nvim-dap.git" };
{ url = "https://github.com/rcarriga/nvim-dap-ui.git" };
{ url = "https://github.com/antoinemadec/FixCursorHold.nvim.git" };
@@ -165,11 +166,11 @@ local function init_plugins()
vim.g.minimap_highlight_range = 1
vim.g.minimap_highlight_search = 1
- ufo.setup({
- provider_selector = function(bufnr, filetype, buftype)
- return { "treesitter"; "indent" }
- end;
- });
+ -- ufo.setup({
+ -- provider_selector = function(bufnr, filetype, buftype)
+ -- return { "treesitter"; "indent" }
+ -- end;
+ -- });
catppuccin.setup({
transparent_background = true;