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

@ -12,17 +12,18 @@
"fidget.nvim": { "branch": "main", "commit": "688b4fec4517650e29c3e63cfbb6e498b3112ba1" },
"gitsigns.nvim": { "branch": "main", "commit": "f388995990aba04cfdc7c3ab870c33e280601109" },
"kanagawa.nvim": { "branch": "master", "commit": "4c8d48726621a7f3998c7ed35b2c2535abc22def" },
"lazy.nvim": { "branch": "main", "commit": "8077428e63feb0f3bf795d53b23ba1695b28ab0e" },
"lazy.nvim": { "branch": "main", "commit": "8cbd95bd059f791e7e9c8cbbf03c368a8bcad9f0" },
"lspkind-nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" },
"lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "3f9c0ea157e88b08e2d11ec65002eeb6e421f0da" },
"mason.nvim": { "branch": "main", "commit": "63cff223169324a2e633954ac580c7c327182a97" },
"null-ls.nvim": { "branch": "main", "commit": "689cdd78f70af20a37b5309ebc287ac645ae4f76" },
"nvim-autopairs": { "branch": "master", "commit": "6a5faeabdbcc86cfbf1561ae430a451a72126e81" },
"nvim-cmp": { "branch": "main", "commit": "7a3b1e76f74934b12fda82158237c6ad8bfd3d40" },
"nvim-cmp": { "branch": "main", "commit": "01f697a68905f9dcae70960a9eb013695a17f9a2" },
"nvim-lspconfig": { "branch": "master", "commit": "62856b20751b748841b0f3ec5a10b1e2f6a6dbc9" },
"nvim-tree.lua": { "branch": "master", "commit": "9c97e6449b0b0269bd44e1fd4857184dfa57bb4c" },
"nvim-treesitter": { "branch": "master", "commit": "b4d8b7e5a374b800838a13aa6829ac4d542c6f1c" },
"nvim-web-devicons": { "branch": "master", "commit": "4709a504d2cd2680fb511675e64ef2790d491d36" },
"nvim-tree.lua": { "branch": "master", "commit": "74959750f7823d6e069d3948a645f3c7a4c00638" },
"nvim-treesitter": { "branch": "master", "commit": "a9f0b1c2ba1d70de9189e1ade0e65346ad08849b" },
"nvim-web-devicons": { "branch": "master", "commit": "0f23feca2bd08549b779c838b6b1308d1e76df03" },
"playground": { "branch": "master", "commit": "4044b53c4d4fcd7a78eae20b8627f78ce7dc6f56" },
"plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
"rust-tools.nvim": { "branch": "master", "commit": "71d2cf67b5ed120a0e31b2c8adb210dd2834242f" },

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,44 +8,6 @@ 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 = {
width = 30,
hide_root_folder = false,
@ -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',