Addition of autoformatting via LSP
This commit is contained in:
parent
421d6f964c
commit
f24eaebdf9
|
@ -0,0 +1,16 @@
|
||||||
|
require("lsp-format").setup {}
|
||||||
|
|
||||||
|
local on_attach = function(client)
|
||||||
|
require("lsp-format").on_attach(client)
|
||||||
|
|
||||||
|
-- ... custom code ...
|
||||||
|
end
|
||||||
|
|
||||||
|
require("lspconfig").bashls.setup { on_attach = on_attach }
|
||||||
|
require("lspconfig").clangd.setup { on_attach = on_attach }
|
||||||
|
require("lspconfig").julials.setup { on_attach = on_attach }
|
||||||
|
require("lspconfig").lua_ls.setup { on_attach = on_attach }
|
||||||
|
require("lspconfig").ltex.setup { on_attach = on_attach }
|
||||||
|
require("lspconfig").pylsp.setup { on_attach = on_attach }
|
||||||
|
require("lspconfig").texlab.setup { on_attach = on_attach }
|
||||||
|
require("lspconfig").zls.setup { on_attach = on_attach }
|
|
@ -1,7 +1,7 @@
|
||||||
local lsp = require('lsp-zero').preset({})
|
local lsp = require('lsp-zero').preset({})
|
||||||
|
|
||||||
lsp.on_attach(function(client, bufnr)
|
lsp.on_attach(function(client, bufnr)
|
||||||
lsp.default_keymaps({buffer = bufnr})
|
lsp.default_keymaps({ buffer = bufnr })
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Language servers
|
-- Language servers
|
||||||
|
@ -19,7 +19,8 @@ lsp.ensure_installed({
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
START LANGUAGE SERVERS CONFIG HERE!!!
|
START LANGUAGE SERVERS CONFIG HERE!!!
|
||||||
]]--
|
]]
|
||||||
|
--
|
||||||
|
|
||||||
-- (Optional) Configure lua language server for neovim
|
-- (Optional) Configure lua language server for neovim
|
||||||
|
|
||||||
|
@ -74,6 +75,7 @@ require('lspconfig').zls.setup({})
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
END LANGUAGE SERVERS CONFIG HERE!!!
|
END LANGUAGE SERVERS CONFIG HERE!!!
|
||||||
]]--
|
]]
|
||||||
|
--
|
||||||
|
|
||||||
lsp.setup()
|
lsp.setup()
|
||||||
|
|
|
@ -59,6 +59,9 @@ return require('packer').startup(function(use)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Code formatting
|
||||||
|
use "lukas-reineke/lsp-format.nvim"
|
||||||
|
|
||||||
-- Latex on NVIM
|
-- Latex on NVIM
|
||||||
use 'lervag/vimtex'
|
use 'lervag/vimtex'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue