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';

View File

@@ -8,45 +8,7 @@ return {
'nvim-tree/nvim-tree.lua',
config = function()
require('nvim-tree').setup {
disable_netrw = true,
hijack_netrw = true,
open_on_setup = false,
ignore_ft_on_setup = {},
open_on_tab = false,
hijack_cursor = false,
update_cwd = true,
hijack_directories = {
enable = true,
auto_open = true,
},
diagnostics = {
enable = false,
icons = {
hint = "",
info = "",
warning = "",
error = "",
}
},
update_focused_file = {
enable = false,
update_cwd = false,
ignore_list = {}
},
system_open = {
cmd = nil,
args = {}
},
filters = {
dotfiles = false,
custom = {}
},
git = {
enable = true,
ignore = true,
timeout = 500,
},
view = {
view = {
width = 30,
hide_root_folder = false,
side = 'left',
@@ -55,11 +17,6 @@ return {
list = {}
}
},
actions = {
open_file = {
resize_window = false
}
}
}
end,
dependencies = { 'nvim-tree/nvim-web-devicons' }

View File

@@ -42,7 +42,10 @@ return {
}
end
},
{ 'lewis6991/gitsigns.nvim' },
{
'lewis6991/gitsigns.nvim',
config = true
},
{
'glepnir/dashboard-nvim',
event = 'VimEnter',