diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-07-25 13:09:26 -0400 |
|---|---|---|
| committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-07-25 13:09:26 -0400 |
| commit | 1e50039433e9a99ae023b68f70f5d8de981c6140 (patch) | |
| tree | b4c674576874f9dd056d72b36405b89339ef2231 | |
| parent | 97b9b85e8d9744010ea775ef479a172c6719cb0d (diff) | |
| download | home-1e50039433e9a99ae023b68f70f5d8de981c6140.tar.gz | |
modules/neovim: use conform for formatting
| -rw-r--r-- | modules/neovim/default.nix | 2 | ||||
| -rw-r--r-- | modules/neovim/nvim/lua/config/lsp/conform.lua | 13 | ||||
| -rw-r--r-- | modules/neovim/nvim/lua/config/lsp/init.lua | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index ab8a6b3..d244c52 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -140,6 +140,8 @@ in } telescope-fzf-native-nvim + conform-nvim + # textobjects mini-ai { diff --git a/modules/neovim/nvim/lua/config/lsp/conform.lua b/modules/neovim/nvim/lua/config/lsp/conform.lua new file mode 100644 index 0000000..3727b8c --- /dev/null +++ b/modules/neovim/nvim/lua/config/lsp/conform.lua @@ -0,0 +1,13 @@ +-- unused for now +require("conform").setup({ + formatters_by_ft = { + lua = { "stylua" }, + python = { "black", "isort" }, + zig = { "zigfmt" }, + nix = { "nixfmt" }, + c = { "clang-formt" }, + cpp = { "clang-format" }, + }, +}) + +vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" diff --git a/modules/neovim/nvim/lua/config/lsp/init.lua b/modules/neovim/nvim/lua/config/lsp/init.lua index 7ba79de..fcfa4b7 100644 --- a/modules/neovim/nvim/lua/config/lsp/init.lua +++ b/modules/neovim/nvim/lua/config/lsp/init.lua @@ -9,6 +9,7 @@ vim.lsp.config = { ['zls'] = require("config.lsp.zls"), ['lua_ls'] = require("config.lsp.lua_ls"), } +require("config.lsp.conform") local servers = { clangd = {}, |