Fix lua vim awareness, enable prettier, fix gitsigns

- Make lua aware of vim runtime
- enable prettier for json, html, css, yaml, markdown
- gitsigns was not enabled
This commit is contained in:
Fabian Schmidt
2023-03-03 11:42:28 +01:00
parent a4e6919899
commit cc9fc11a62
4 changed files with 35 additions and 53 deletions

View File

@@ -38,11 +38,21 @@ return {
lspconfig.lua_ls.setup {
capabilities = capabilities,
root_dir = lspconfig.util.root_pattern('.git'),
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { 'vim' }
}
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
}
},
on_attach = lsp_attach
@@ -190,6 +200,17 @@ return {
'windwp/nvim-autopairs',
config = true
},
{
'jose-elias-alvarez/null-ls.nvim',
config = function()
local null_ls = require('null-ls')
local sources = {
null_ls.builtins.formatting.prettierd.with({
filetypes = { "html", "json", "yaml", "markdown" },
-- extra_filetypes = { "toml" }, -- find out how to install plugins / wait for mason to support them
}),
}
null_ls.setup({ sources = sources })
end
}
}
-- -- Linting & formtatting
-- 'jose-elias-alvarez/null-ls.nvim';