From 24f4cbc1ddc4c540b6d69c1cd9d66d60b06ccec1 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 10 Oct 2024 10:09:57 +0200 Subject: tex: use tex-fmt with efm doesn't use the buffer but the file on disk currently, fix later --- .config/efm-langserver/config.yaml | 4 ++++ .config/nvim/lua/plugins/lsp.lua | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.config/efm-langserver/config.yaml b/.config/efm-langserver/config.yaml index 40031b0..baffb69 100644 --- a/.config/efm-langserver/config.yaml +++ b/.config/efm-langserver/config.yaml @@ -13,7 +13,11 @@ tools: sh-shfmt: &sh-shfmt format-command: 'shfmt -ci -s -bn -i 4 -sr' format-stdin: true + tex-fmt-formatter: &tex-fmt-formatter + format-command: 'tex-fmt --keep --tab 4 --print' languages: sh: - <<: *sh-shellcheck - <<: *sh-shfmt + tex: + - <<: *tex-fmt-formatter diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index c10eefc..41616de 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -128,8 +128,18 @@ return { -- efm require("lspconfig")["efm"].setup({ on_attach = on_attach, + settings = { + initializationOptions = { + documentFormatting = true, + documentRangeFormatting = true, + hover = true, + documentSymbol = true, + codeAction = true, + completion = true + } + }, capabilities = capabilities, - filetypes = { 'sh' }, + filetypes = { 'sh', 'tex' }, }) vim.g.rustaceanvim = { -- cgit v1.2.3-70-g09d2