From 1f2dad0be57a20bca63b251d0b22c57839a6f794 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Thu, 8 Jan 2026 17:25:42 +0100 Subject: Neovim: Benutze conform.nvim als Standard-Formater --- nvim/lua/plugins/format.lua | 20 ++++++++++++++++++++ nvim/lua/plugins/lsp.lua | 16 ++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 nvim/lua/plugins/format.lua (limited to 'nvim/lua/plugins') diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua new file mode 100644 index 0000000..bdfaf03 --- /dev/null +++ b/nvim/lua/plugins/format.lua @@ -0,0 +1,20 @@ +return { + "stevearc/conform.nvim", + event = { "BufReadPre", "BufNewFile" }, + opts = { + formatters_by_ft = { + sh = { "shfmt" }, -- brew install + bash = { "shfmt" }, + python = { "ruff_format", "black" }, -- brew install ruff + lua = { "stylua" }, -- brew install stylua + typescript = { "prettierd", "prettier" }, + javascript = { "prettierd", "prettier" }, + json = { "jq" }, -- brew install jq + -- cpp = { "clang_format" }, + }, + }, + + config = function(_, opts) + require("conform").setup(opts) + end, +} diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 4c549a7..30e3924 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -20,6 +20,22 @@ return { }, } + vim.lsp.config.bashls = { + settings = { + bashIde = { + shellcheck = { + enable = true, + severity = { + error = "error", + warning = "warning", + info = "info", + }, + }, + globPattern = "**/*.sh", + }, + }, + } + vim.lsp.enable({ "bashls", -- npm install -g bash-language-server "clangd", -- pkg install llvm -- cgit v1.3