Compare commits

...

4 Commits

Author SHA1 Message Date
34c88f6fe6 debug bufferline and lsp 2025-10-20 03:05:59 +02:00
5f67b259c6 debug bufferline due to update 2025-08-20 10:20:04 +02:00
fbead62967 add nix lsp and formatter 2025-03-28 02:47:53 +01:00
Jérémie SALVI
3a6258ccf0 refactoring 2025-01-11 19:32:59 +01:00
8 changed files with 128 additions and 63 deletions

View File

@@ -4,16 +4,18 @@ 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({
styles = { "italic", "bold" },
custom = {
-- highlights = require("catppuccin.groups.integrations.bufferline").get({
-- }),
highlights = require("catppuccin.special.bufferline").get_theme {
styles = { "italic", "bold" },
custom = {
all = {
fill = { -- bg before buffer
fg = frappe.text,
@@ -219,10 +221,9 @@ local opts = {
},
},
},
}),
},
}
--- Load plugin
bufferline.setup(opts)
--- Override keymaps

View File

@@ -18,3 +18,4 @@ require("config/lsp/bash")
require("config/lsp/lua")
require("config/lsp/web")
require("config/lsp/php")
require("config/lsp/nix")

View File

@@ -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" }, "<leader>lf", function()
end, { desc = "Format" })
lint.linters_by_ft = {
yaml = { "ansible-lint" },
yml = { "ansible-lint" },
}

View File

@@ -7,18 +7,15 @@ local ok, mason_lspconfig, mason_tool_installer, lspconfig, conform, lint = pcal
end)
if not ok then
return
return
end
mason_lspconfig.setup({
ensure_installed = { "lua_ls" },
ensure_installed = { "lua_ls", },
})
mason_tool_installer.setup({
ensure_installed = { "stylua", "luacheck" },
})
lspconfig.lua_ls.setup({
vim.lsp.config("lua_ls", {
cmd = { "lua-language-server" },
-- capabilities = cmp_nvim_lsp.default_capabilities()
capabilities = require("config/lsp/lsp-capabilities"),
on_attach = require("config/lsp/lsp-attach"),
@@ -38,6 +35,11 @@ lspconfig.lua_ls.setup({
},
},
})
vim.lsp.enable('lua_ls')
mason_tool_installer.setup({
ensure_installed = { "stylua", "luacheck" },
})
conform.setup({
formatters_by_ft = {

56
lua/config/lsp/nix.lua Normal file
View File

@@ -0,0 +1,56 @@
local ok, lspconfig, conform, lint = pcall(function()
return require("lspconfig"), require("conform"), require("lint")
end)
if not ok then
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 <nixpkgs> { }",
},
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" }, "<leader>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", "<leader>ll", function()
lint.try_lint()
end, { desc = "Lint" })

View File

@@ -13,7 +13,7 @@ end
mason_lspconfig.setup({
ensure_installed = {
"intelephense",
"phpactor",
--- "phpactor",
},
})

View File

@@ -1,7 +1,7 @@
--- Ensure plugin is avaiable
local ok, nvimtree = pcall(require, "nvim-tree")
if not ok then
return
return
end
--- Unload netrw
@@ -10,32 +10,32 @@ vim.g.loaded_netrwPlugin = 1
--- Plugin options
local opts = {
sort = {
-- sorter = "case_sensitive",
},
view = {
width = 30,
},
renderer = {
group_empty = true,
indent_markers = {
enable = true,
},
icons = {
glyphs = {
folder = {
arrow_closed = "", -- arrow when folder is closed
arrow_open = "", -- arrow when folder is open
},
},
},
},
filters = {
dotfiles = false,
},
diagnostics = {
enable = true,
},
sort = {
-- sorter = "case_sensitive",
},
view = {
width = 30,
},
renderer = {
group_empty = true,
indent_markers = {
enable = true,
},
icons = {
glyphs = {
folder = {
arrow_closed = "", -- arrow when folder is closed
arrow_open = "", -- arrow when folder is open
},
},
},
},
filters = {
dotfiles = false,
},
diagnostics = {
enable = true,
},
}
--- Load plugin

View File

@@ -1,21 +1,21 @@
return {
"williamboman/mason.nvim",
dependencies = {
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
{
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
{
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
},
{
"mfussenegger/nvim-lint",
event = { "BufReadPre", "BufNewFile" },
},
},
},
},
"williamboman/mason.nvim",
dependencies = {
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
{
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
{
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
},
{
"mfussenegger/nvim-lint",
event = { "BufReadPre", "BufNewFile" },
},
},
},
},
}