aboutsummaryrefslogtreecommitdiff
path: root/nvim/lua/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'nvim/lua/plugins')
-rw-r--r--nvim/lua/plugins/format.lua5
-rw-r--r--nvim/lua/plugins/git.lua2
-rw-r--r--nvim/lua/plugins/lint.lua31
-rw-r--r--nvim/lua/plugins/lsp.lua8
-rw-r--r--nvim/lua/plugins/ui.lua30
5 files changed, 51 insertions, 25 deletions
diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua
index 476e513..a8d63b8 100644
--- a/nvim/lua/plugins/format.lua
+++ b/nvim/lua/plugins/format.lua
@@ -1,6 +1,6 @@
1-- Verfügbare Formater: https://github.com/stevearc/conform.nvim/tree/master/lua/conform/formatters 1-- Verfügbare Formater: https://github.com/stevearc/conform.nvim/tree/master/lua/conform/formatters
2 2
3local clang = {} 3local clang = {} -- absichtlich leer: c und cpp formatiert clangd, siehe default_format_opts.lsp_format
4local djlint = { "djlint" } -- pipx install djlint (macOS & FreeBSD); unter Windows kein winget-Paket, siehe neovim-windows-setup.md 4local djlint = { "djlint" } -- pipx install djlint (macOS & FreeBSD); unter Windows kein winget-Paket, siehe neovim-windows-setup.md
5local gawk = { "gawk" } -- brew install gawk, pkg install gawk 5local gawk = { "gawk" } -- brew install gawk, pkg install gawk
6local jq = { "jq" } -- brew install jq, pkg install jq 6local jq = { "jq" } -- brew install jq, pkg install jq
@@ -27,7 +27,6 @@ return {
27 opts = { 27 opts = {
28 formatters_by_ft = { 28 formatters_by_ft = {
29 awk = gawk, 29 awk = gawk,
30 bash = shfmt,
31 c = clang, 30 c = clang,
32 cpp = clang, 31 cpp = clang,
33 html = prettier, 32 html = prettier,
@@ -46,7 +45,7 @@ return {
46 formatters = { 45 formatters = {
47 prettier_jsonc = { 46 prettier_jsonc = {
48 inherit = "prettier", 47 inherit = "prettier",
49 prepend_args = { "--parser", "jsonc" }, 48 prepend_args = { "--parser", "jsonc", "--trailing-comma", "none" },
50 }, 49 },
51 }, 50 },
52 default_format_opts = { 51 default_format_opts = {
diff --git a/nvim/lua/plugins/git.lua b/nvim/lua/plugins/git.lua
index ed7bafe..b865864 100644
--- a/nvim/lua/plugins/git.lua
+++ b/nvim/lua/plugins/git.lua
@@ -10,7 +10,7 @@ return {
10 }, 10 },
11 config = function(_, opts) 11 config = function(_, opts)
12 require("gitsigns").setup(opts) 12 require("gitsigns").setup(opts)
13 require("config.keymaps").gitsigns() 13 require("config.keymaps").set_gitsigns()
14 end, 14 end,
15 }, 15 },
16} 16}
diff --git a/nvim/lua/plugins/lint.lua b/nvim/lua/plugins/lint.lua
new file mode 100644
index 0000000..2bfcfc7
--- /dev/null
+++ b/nvim/lua/plugins/lint.lua
@@ -0,0 +1,31 @@
1-- Verfügbare Linter: https://github.com/mfussenegger/nvim-lint/tree/master/lua/lint/linters
2--
3-- Hier gehören nur Linter hinein, die kein Sprachserver ohnehin schon meldet:
4-- shellcheck läuft in bashls, clang-tidy in clangd, ansible-lint in ansiblels.
5
6local ruff = { "ruff" } -- bereits als Formatter installiert, siehe plugins/format.lua
7local yamllint = { "yamllint" } -- brew install yamllint, pkg install devel/py-yamllint
8local zsh = { "zsh" } -- kein zusätzliches Werkzeug: ruft `zsh --no-exec` auf
9
10return {
11 "mfussenegger/nvim-lint",
12 event = { "BufReadPre", "BufNewFile" },
13 config = function()
14 local lint = require("lint")
15
16 lint.linters_by_ft = {
17 -- ergänzt die Typprüfung von basedpyright um die Lint-Regeln (F, E, UP, B ...)
18 python = ruff,
19 -- kein Sprachserver für YAML im Einsatz; Regeln kommen aus .yamllint des Projekts
20 yaml = yamllint,
21 -- Syntaxprüfung ohne Ausführung; bashls deckt nur sh und bash ab
22 zsh = zsh,
23 }
24
25 vim.api.nvim_create_autocmd({ "BufReadPost", "BufWritePost", "InsertLeave" }, {
26 callback = function()
27 lint.try_lint()
28 end,
29 })
30 end,
31}
diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua
index a2b37d5..e0ad450 100644
--- a/nvim/lua/plugins/lsp.lua
+++ b/nvim/lua/plugins/lsp.lua
@@ -34,10 +34,6 @@ return {
34 }, 34 },
35 } 35 }
36 36
37 vim.lsp.config.bashls = {
38 filetypes = { "sh", "bash" },
39 }
40
41 vim.lsp.config.clangd = { 37 vim.lsp.config.clangd = {
42 cmd = { 38 cmd = {
43 "clangd", 39 "clangd",
@@ -98,7 +94,7 @@ return {
98 } 94 }
99 95
100 vim.lsp.config.ansiblels = { 96 vim.lsp.config.ansiblels = {
101 filetypes = { require("config.filetypes").ANSIBLE_YAML }, 97 filetypes = { "yaml.ansible" }, -- Erkennung: siehe config.filetypes
102 settings = { 98 settings = {
103 ansible = { 99 ansible = {
104 validation = { 100 validation = {
@@ -112,7 +108,7 @@ return {
112 } 108 }
113 109
114 vim.lsp.enable({ 110 vim.lsp.enable({
115 "ansiblels", -- npm install -g @ansible/ansible-language-server & (brew install ansible-lint, pkg install py-ansible-lint) 111 "ansiblels", -- npm install -g @ansible/ansible-language-server & (brew install ansible-lint, pkg install sysutils/py-ansible-lint)
116 "basedpyright", -- npm install -g basedpyright, brew install basedpyright 112 "basedpyright", -- npm install -g basedpyright, brew install basedpyright
117 "bashls", -- npm install -g bash-language-server, pkg install hs-ShellCheck 113 "bashls", -- npm install -g bash-language-server, pkg install hs-ShellCheck
118 "clangd", -- pkg install llvm 114 "clangd", -- pkg install llvm
diff --git a/nvim/lua/plugins/ui.lua b/nvim/lua/plugins/ui.lua
index 39a8e28..a308fc8 100644
--- a/nvim/lua/plugins/ui.lua
+++ b/nvim/lua/plugins/ui.lua
@@ -17,27 +17,27 @@ return {
17 17
18 vscode.load() 18 vscode.load()
19 19
20 -- eigene Anpassungen an der vscode-Palette; muessen nach vscode.load() 20 -- eigene Anpassungen an der vscode-Palette
21 -- gesetzt werden, weil :colorscheme alle Highlight-Gruppen zuruecksetzt 21 local set_hl = vim.api.nvim_set_hl
22 22
23 -- Fix: Farbschema für Rechtschreibfehler 23 -- Fix: Farbschema für Rechtschreibfehler
24 vim.api.nvim_set_hl(0, "SpellBad", { fg = "#ffffff", bg = "#5f0000" }) 24 set_hl(0, "SpellBad", { fg = "#ffffff", bg = "#5f0000" })
25 vim.api.nvim_set_hl(0, "SpellCap", { fg = "#000000", bg = "#ffaf00" }) 25 set_hl(0, "SpellCap", { fg = "#000000", bg = "#ffaf00" })
26 vim.api.nvim_set_hl(0, "SpellRare", { fg = "#000000", bg = "#5fd7ff" }) 26 set_hl(0, "SpellRare", { fg = "#000000", bg = "#5fd7ff" })
27 vim.api.nvim_set_hl(0, "SpellLocal", { fg = "#000000", bg = "#5fff87" }) 27 set_hl(0, "SpellLocal", { fg = "#000000", bg = "#5fff87" })
28 vim.api.nvim_set_hl(0, "CursorLine", { bg = "#252526" }) 28 set_hl(0, "CursorLine", { bg = "#252526" })
29 vim.api.nvim_set_hl(0, "CursorColumn", { bg = "#252526" }) 29 set_hl(0, "CursorColumn", { bg = "#252526" })
30 30
31 -- Statusline Farben 31 -- Statusline Farben
32 vim.api.nvim_set_hl(0, "StatuslineModeNormal", { fg = "#1e222a", bg = "#61afef", bold = true }) 32 set_hl(0, "StatuslineModeNormal", { fg = "#1e222a", bg = "#61afef", bold = true })
33 vim.api.nvim_set_hl(0, "StatuslineModeInsert", { fg = "#1e222a", bg = "#98c379", bold = true }) 33 set_hl(0, "StatuslineModeInsert", { fg = "#1e222a", bg = "#98c379", bold = true })
34 vim.api.nvim_set_hl(0, "StatuslineModeVisual", { fg = "#1e222a", bg = "#c678dd", bold = true }) 34 set_hl(0, "StatuslineModeVisual", { fg = "#1e222a", bg = "#c678dd", bold = true })
35 vim.api.nvim_set_hl(0, "StatuslineModeReplace", { fg = "#1e222a", bg = "#e86671", bold = true }) 35 set_hl(0, "StatuslineModeReplace", { fg = "#1e222a", bg = "#e86671", bold = true })
36 vim.api.nvim_set_hl(0, "StatuslineModeCommand", { fg = "#1e222a", bg = "#e5c07b", bold = true }) 36 set_hl(0, "StatuslineModeCommand", { fg = "#1e222a", bg = "#e5c07b", bold = true })
37 37
38 -- NVim-Tree 38 -- NVim-Tree
39 vim.api.nvim_set_hl(0, "NvimTreeOpenedFile", { bold = true }) 39 set_hl(0, "NvimTreeOpenedFile", { bold = true })
40 vim.api.nvim_set_hl(0, "NvimTreeCursorLine", { bg = "#2A2D2E" }) 40 set_hl(0, "NvimTreeCursorLine", { bg = "#2A2D2E" })
41 end, 41 end,
42 }, 42 },
43 43