diff --git a/Makefile b/Makefile
index 4aba75d21e54b4857c8cd0227693e2b7d8f33044..fc3a512c0e0e6ea851d9e46d3254dc02342056fc 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ FENNEL?=fennel
SOURCES := $(shell find . -name '*.lua')
install:
- rm $(PREFIX)/lua/gabrielgio/*
+ -rm $(PREFIX)/lua/gabrielgio/*
mkdir -p $(PREFIX)/lua/gabrielgio/
for name in $(SOURCES); do\
install -m644 $${name} $(PREFIX)/$${name}; \
diff --git a/init.lua b/init.lua
index 24f40621a298ed9c6157833c6a23cc27c546c4f5..524e0064ce60da7e4506d27268b7680d6aec730a 100644
--- a/init.lua
+++ b/init.lua
@@ -25,7 +25,8 @@ "nvim-telescope/telescope.nvim", -- telescope
"nvim-telescope/telescope-file-browser.nvim", -- telescope file browser
"TimUntersberger/neogit", -- magit
"echasnovski/mini.nvim", -- provides many things
- "jose-elias-alvarez/null-ls.nvim", -- enriches lsp
+ "mhartington/formatter.nvim", -- provider formatter
+ "mfussenegger/nvim-lint", -- general linter
"nvim-treesitter/nvim-treesitter-context", -- show context of where it is at the code
"mbbill/undotree", -- keep track of undos
"simrat39/symbols-outline.nvim", -- symbols tree (lsp aware)
@@ -34,6 +35,7 @@ "RRethy/vim-illuminate", -- hightlight use of the same word (lsp aware)
"sainnhe/edge", -- light theme
"ellisonleao/gruvbox.nvim", -- light theme
"williamboman/mason.nvim", -- manages many things
+ "williamboman/mason-lspconfig.nvim", -- glue mason and lspconfig
"neovim/nvim-lspconfig", -- lsp support
}
diff --git a/lua/gabrielgio/init.lua b/lua/gabrielgio/init.lua
index 00a5ba3658acc49aa0f9a47fe66af4c6b05de6ca..1cd849a61e54e44f34bb38d298b1d1fe67b835aa 100644
--- a/lua/gabrielgio/init.lua
+++ b/lua/gabrielgio/init.lua
@@ -3,9 +3,9 @@ local now, later = mini_deps.now, mini_deps.later
now(function() require("gabrielgio.settable") end)
now(function() require("gabrielgio.treesitter") end)
+now(function() require("gabrielgio.lazy") end)
+now(function() require("gabrielgio.lsp") end)
-later(function() require("gabrielgio.lazy") end)
-later(function() require("gabrielgio.lsp") end)
later(function() require("gabrielgio.mini") end)
later(function() require("gabrielgio.go") end)
later(function() require("gabrielgio.telescope") end)
diff --git a/lua/gabrielgio/lazy.lua b/lua/gabrielgio/lazy.lua
index f5d07f712a3720cb7d57059b2018ae9f6c0712db..50fd3a5ebadf09537b93080ee3e1ff462d9b2a42 100644
--- a/lua/gabrielgio/lazy.lua
+++ b/lua/gabrielgio/lazy.lua
@@ -1,9 +1,34 @@
-- this file is an amalgamation of configurations that don't have its own
-- config file and will be lazily loaded
-local neogit = require("neogit")
-local null_ls = require("null-ls")
-local mason = require("mason")
+require('formatter').setup()
+require("mason").setup()
+require("mason-lspconfig").setup {
+ ensure_installed = {
+ "gopls",
+ "zls",
+ "lua_ls",
+ "rust_analyzer",
+-- "clangd", not working on alpine
+ "cssls",
+ "html",
+ "emmet_ls",
+ "pylsp",
+ "zls",
+ "tsserver"
+ },
+}
+
+local lint = require('lint')
-null_ls.setup({sources = {null_ls.builtins.diagnostics.golangci_lint}})
-neogit.setup()
-mason.setup()
+lint.linters_by_ft = {
+ markdown = {'vale'},
+ go = {"golangcilint"},
+ lua = {"luacheck"},
+}
+
+vim.api.nvim_create_autocmd({ "BufWritePost" }, {
+ callback = function()
+ lint.try_lint()
+ end,
+})
+