this hurts

This commit is contained in:
Sakooooo 2023-08-23 16:58:07 +00:00
parent 05b0210dae
commit e2c332c3ae
Signed by: sako
GPG key ID: FE52FD65B76E4751
2 changed files with 78 additions and 74 deletions

View file

@ -1,8 +1,8 @@
-- Utilities for creating configurations -- Utilities for creating configurations
local util = require "formatter.util" local util = require("formatter.util")
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands -- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
require("formatter").setup { require("formatter").setup({
-- Enable or disable logging -- Enable or disable logging
logging = true, logging = true,
log_level = vim.log.levels.WARN, log_level = vim.log.levels.WARN,
@ -21,7 +21,7 @@ require("formatter").setup {
}, },
stdin = true, stdin = true,
} }
end end,
}, },
nix = { nix = {
require("formatter.filetypes.nix").alejandra, require("formatter.filetypes.nix").alejandra,
@ -30,13 +30,18 @@ require("formatter").setup {
exe = "alejandra", exe = "alejandra",
stdin = true, stdin = true,
args = { args = {
"--quiet" "--quiet",
}, },
} }
end end,
}, },
["*"] = { ["*"] = {
require("formatter.filetypes.any").remove_trailing_whitespace require("formatter.filetypes.any").remove_trailing_whitespace,
} },
} },
} })
vim.api.nvim_command("augroup FormatAutogroup")
vim.api.nvim_command("autocmd!")
vim.api.nvim_command("autocmd BufWritePost * FormatWrite")
vim.api.nvim_command("augroup END")

View file

@ -19,12 +19,11 @@ end
local capabilities = require("cmp_nvim_lsp").default_capabilities() local capabilities = require("cmp_nvim_lsp").default_capabilities()
-- funny lsp config stuff -- funny lsp config stuff
require('lspconfig').nil_ls.setup({ require("lspconfig").nil_ls.setup({
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities, capabilities = capabilities,
}) })
require("lspconfig").lua_ls.setup({ require("lspconfig").lua_ls.setup({
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities, capabilities = capabilities,
@ -74,6 +73,6 @@ require("lspconfig").cssls.setup({
capabilities = capabilities, capabilities = capabilities,
}) })
require('lspconfig')['hls'].setup { require("lspconfig")["hls"].setup({
filetypes = { 'haskell', 'lhaskell', 'cabal' }, filetypes = { "haskell", "lhaskell", "cabal" },
} })