From 5f67b259c6e5bb083dcc67a5bc615dd70578d157 Mon Sep 17 00:00:00 2001 From: SALVIJER Date: Wed, 20 Aug 2025 10:20:04 +0200 Subject: [PATCH] debug bufferline due to update --- lua/config/bufferline.lua | 5 +- lua/config/lsp/ansible.lua | 11 +++-- lua/config/lsp/nix.lua | 95 ++++++++++++++++++-------------------- 3 files changed, 56 insertions(+), 55 deletions(-) diff --git a/lua/config/bufferline.lua b/lua/config/bufferline.lua index 248f612..43fd175 100644 --- a/lua/config/bufferline.lua +++ b/lua/config/bufferline.lua @@ -4,14 +4,14 @@ if not ok then return end ---- Plugin options local frappe = require("catppuccin.palettes").get_palette("frappe") + local opts = { options = { -- mode = "tabs", separator_style = "slant", }, - highlights = require("catppuccin.groups.integrations.bufferline").get({ + highlights = require("catppuccin.groups.integrations.bufferline").get_theme({ styles = { "italic", "bold" }, custom = { all = { @@ -222,7 +222,6 @@ local opts = { }), } ---- Load plugin bufferline.setup(opts) --- Override keymaps diff --git a/lua/config/lsp/ansible.lua b/lua/config/lsp/ansible.lua index 2145224..b3b0c78 100644 --- a/lua/config/lsp/ansible.lua +++ b/lua/config/lsp/ansible.lua @@ -20,16 +20,20 @@ lspconfig.ansiblels.setup({ }) mason_tool_installer.setup({ - ensure_installed = { "ansible-lint" }, + ensure_installed = { + "ansible-lint", + "prettier", + }, }) conform.setup({ formatters_by_ft = { - yaml = { "ansible-lint" }, + yaml = { "prettier" }, + yml = { "prettier" }, }, format_on_save = { async = false, - timeout_ms = 500, + timeout_ms = 2000, lsp_format = "fallback", }, }) @@ -43,6 +47,7 @@ vim.keymap.set({ "n", "v" }, "lf", function() end, { desc = "Format" }) lint.linters_by_ft = { + yaml = { "ansible-lint" }, yml = { "ansible-lint" }, } diff --git a/lua/config/lsp/nix.lua b/lua/config/lsp/nix.lua index 48a38b6..7621348 100644 --- a/lua/config/lsp/nix.lua +++ b/lua/config/lsp/nix.lua @@ -1,59 +1,56 @@ local ok, lspconfig, conform, lint = pcall(function() - return - require("lspconfig"), - require("conform"), - require("lint") + return require("lspconfig"), require("conform"), require("lint") end) if not ok then - return + return end lspconfig.nixd.setup({ - -- capabilities = cmp_nvim_lsp.default_capabilities() - capabilities = require("config/lsp/lsp-capabilities"), - on_attach = require("config/lsp/lsp-attach"), - settings = { - nixd = { - nixpkgs = { - expr = "import { }", - }, - -- formatting = { - -- command = { "nixfmt" }, - -- }, - }, - }, + -- capabilities = cmp_nvim_lsp.default_capabilities() + capabilities = require("config/lsp/lsp-capabilities"), + on_attach = require("config/lsp/lsp-attach"), + settings = { + nixd = { + nixpkgs = { + expr = "import { }", + }, + formatting = { + command = { "nixfmt" }, + }, + }, + }, }) --- conform.setup({ --- formatters_by_ft = { --- nix = { "nixfmt" }, --- }, --- format_on_save = { --- async = false, --- timeout_ms = 500, --- lsp_format = "fallback", --- }, --- }) --- --- vim.keymap.set({ "n", "v" }, "lf", function() --- conform.format({ --- async = false, --- timeout_ms = 500, --- lsp_format = "fallback", --- }) --- end, { desc = "Format" }) +conform.setup({ + formatters_by_ft = { + nix = { "nixfmt" }, + }, + format_on_save = { + async = false, + timeout_ms = 500, + lsp_format = "fallback", + }, +}) --- lint.linters_by_ft = { --- lua = { "luacheck" }, --- } --- --- vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { --- callback = function() --- lint.try_lint() --- end, --- }) --- --- vim.keymap.set("n", "ll", function() --- lint.try_lint() --- end, { desc = "Lint" }) +vim.keymap.set({ "n", "v" }, "lf", function() + conform.format({ + async = false, + timeout_ms = 500, + lsp_format = "fallback", + }) +end, { desc = "Format" }) + +lint.linters_by_ft = { + lua = { "luacheck" }, +} + +vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { + callback = function() + lint.try_lint() + end, +}) + +vim.keymap.set("n", "ll", function() + lint.try_lint() +end, { desc = "Lint" })