aboutsummaryrefslogtreecommitdiff
path: root/nvim/lua
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2026-03-25 07:12:09 +0100
committerThomas Schmucker <ts@its1.de>2026-03-25 07:12:09 +0100
commit37edf162b30d5fb7dc3b08c8a6361f54953a9d2d (patch)
treed9b369c5856515538c19ce6c454327ca1ec8ee0f /nvim/lua
parente99756d1d5acb6805003b403985ee0a2a253bf26 (diff)
parentf47268bdb61ea02f6dc1ece2c699473277107947 (diff)
downloaddotfiles-37edf162b30d5fb7dc3b08c8a6361f54953a9d2d.tar.gz
dotfiles-37edf162b30d5fb7dc3b08c8a6361f54953a9d2d.tar.bz2
dotfiles-37edf162b30d5fb7dc3b08c8a6361f54953a9d2d.zip
Merge branch 'master' into sonarqube
Diffstat (limited to 'nvim/lua')
-rw-r--r--nvim/lua/config/keymaps.lua6
-rw-r--r--nvim/lua/plugins/format.lua16
2 files changed, 14 insertions, 8 deletions
diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua
index b193d5c..29dee94 100644
--- a/nvim/lua/config/keymaps.lua
+++ b/nvim/lua/config/keymaps.lua
@@ -15,12 +15,6 @@ function M.lsp(buffer, client)
15 map("n", "K", vim.lsp.buf.hover, opts) 15 map("n", "K", vim.lsp.buf.hover, opts)
16 map("n", "<leader>rn", vim.lsp.buf.rename, opts) 16 map("n", "<leader>rn", vim.lsp.buf.rename, opts)
17 map("n", "<leader>ca", vim.lsp.buf.code_action, opts) 17 map("n", "<leader>ca", vim.lsp.buf.code_action, opts)
18 map("n", "<leader>cf", function()
19 require("conform").format({
20 async = true,
21 lsp_fallback = true,
22 })
23 end, opts)
24 18
25 local function set_c_bindings() 19 local function set_c_bindings()
26 if client and client.name == "clangd" then map("n", "<leader>hs", "<cmd>ClangdSwitchSourceHeader<cr>", opts) end 20 if client and client.name == "clangd" then map("n", "<leader>hs", "<cmd>ClangdSwitchSourceHeader<cr>", opts) end
diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua
index 2d6a55c..9010657 100644
--- a/nvim/lua/plugins/format.lua
+++ b/nvim/lua/plugins/format.lua
@@ -1,12 +1,24 @@
1return { 1return {
2 "stevearc/conform.nvim", 2 "stevearc/conform.nvim",
3 event = { "BufReadPre", "BufNewFile" }, 3 event = { "BufReadPre", "BufNewFile" },
4 keys = {
5 {
6 "<leader>cf",
7 function()
8 require("conform").format({
9 async = true,
10 lsp_fallback = true,
11 })
12 end,
13 desc = "Format file",
14 },
15 },
4 opts = { 16 opts = {
5 formatters_by_ft = { 17 formatters_by_ft = {
6 sh = { "shfmt" }, -- brew install, pkg install shfmt 18 sh = { "shfmt" }, -- brew install, pkg install shfmt
7 bash = { "shfmt" }, 19 bash = { "shfmt" },
8 python = { "ruff_format", "black" }, -- brew install ruff, pkg install ruff 20 python = { "ruff_format", "black" }, -- brew install ruff, pkg install ruff
9 lua = { "stylua" }, -- brew install stylua, pkg install stylua 21 lua = { "stylua" }, -- brew install stylua, pkg install stylua
10 typescript = { "prettierd", "prettier" }, 22 typescript = { "prettierd", "prettier" },
11 javascript = { "prettierd", "prettier" }, 23 javascript = { "prettierd", "prettier" },
12 json = { "jq" }, -- brew install jq, pkg install jq 24 json = { "jq" }, -- brew install jq, pkg install jq