aboutsummaryrefslogtreecommitdiffhomepage
path: root/.config/nvim/lua/vimrc
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-15 22:48:17 +0900
committernsfisis <nsfisis@gmail.com>2024-07-15 22:48:17 +0900
commit624f6053b18c00cf0b2aa6f5dda87827c2a1df62 (patch)
tree806574d559e8943b6388b2a1e8ddba930c17d7e0 /.config/nvim/lua/vimrc
parent2b0cd7292145b231721f76f395cc87b9209cc3c3 (diff)
downloaddotfiles-624f6053b18c00cf0b2aa6f5dda87827c2a1df62.tar.gz
dotfiles-624f6053b18c00cf0b2aa6f5dda87827c2a1df62.tar.zst
dotfiles-624f6053b18c00cf0b2aa6f5dda87827c2a1df62.zip
nvim/lsp: set up reparojson
Diffstat (limited to '.config/nvim/lua/vimrc')
-rw-r--r--.config/nvim/lua/vimrc/plugins.lua22
1 files changed, 21 insertions, 1 deletions
diff --git a/.config/nvim/lua/vimrc/plugins.lua b/.config/nvim/lua/vimrc/plugins.lua
index c85911c..ba5e94c 100644
--- a/.config/nvim/lua/vimrc/plugins.lua
+++ b/.config/nvim/lua/vimrc/plugins.lua
@@ -653,7 +653,20 @@ return {
lspconfig.phpactor.setup({})
end
if vim.fn.executable('efm-langserver') == 1 then
- lspconfig.efm.setup({})
+ lspconfig.efm.setup({
+ init_options = { documentFormatting = true },
+ settings = {
+ rootMarkers = {".git/"},
+ languages = {
+ json = {
+ {
+ formatCommand = "reparojson -q",
+ formatStdin = true,
+ },
+ },
+ },
+ }
+ })
end
vim.api.nvim_create_autocmd('LspAttach', {
@@ -665,6 +678,13 @@ return {
vim.keymap.set('n', '<space>f', function()
vim.lsp.buf.format({ async = true })
end, opts)
+
+ vim.api.nvim_create_autocmd('BufWritePre', {
+ buffer = e.buf,
+ callback = function()
+ vim.lsp.buf.format({ async = false })
+ end
+ })
end,
})
end,