chezmoi/dot_config/nvim/lua/plugins/null-ls.lua
kjuulh d80976a36b
Add .config/nvim/LICENSE
Add .config/nvim/README.md
Add .config/nvim/.gitignore
Add .config/nvim/.neoconf.json
Add .config/nvim/init.lua
Add .config/nvim/lazy-lock.json
Add .config/nvim/lua/config/autocmds.lua
Add .config/nvim/lua/config/keymaps.lua
Add .config/nvim/lua/config/lazy.lua
Add .config/nvim/lua/config/options.lua
Add .config/nvim/lua/plugins/catppuccin.lua
Add .config/nvim/lua/plugins/copilot-cmp.lua
Add .config/nvim/lua/plugins/copilot.lua
Add .config/nvim/lua/plugins/core.lua
Add .config/nvim/lua/plugins/crates.lua
Add .config/nvim/lua/plugins/example.lua
Add .config/nvim/lua/plugins/lspconfig.lua
Add .config/nvim/lua/plugins/neoconf.lua
Add .config/nvim/lua/plugins/neorg.lua
Add .config/nvim/lua/plugins/noice.lua
Add .config/nvim/lua/plugins/null-ls.lua
Add .config/nvim/lua/plugins/nvim-cmp.lua
Add .config/nvim/lua/plugins/nvim-dap.lua
Add .config/nvim/lua/plugins/ranger.lua
Add .config/nvim/lua/plugins/rust-tools.lua
Add .config/nvim/lua/plugins/tmux.lua
Add .config/nvim/lua/plugins/toggleterm.lua
Add .config/nvim/lua/plugins/treesitter.lua
Add .config/nvim/lua/plugins/vim-wordmotion.lua
Add .config/nvim/lua/plugins/zen-mode.lua
Add .config/nvim/neoconf.json
Add .config/nvim/queries/hurl/highlights.scm
Add .config/nvim/queries/hurl/injections.scm
Add .config/nvim/stylua.toml
Add .config/ranger/.keep
Add .config/toot/config.json
Add .config/zathura/.keep
Add .config/zellij/config.kdl
Update .zimrc
2023-07-24 12:41:02 +02:00

64 lines
1.8 KiB
Lua

local h = require("null-ls.helpers")
local methods = require("null-ls.methods")
local u = require("null-ls.utils")
local FORMATTING = methods.internal.FORMATTING
local leptosfmt = h.make_builtin({
name = "leptosfmt",
meta = {
url = "https://github.com/bram209/leptosfmt",
description = "A formatter for the leptos view! macro"
},
method = FORMATTING,
filetypes = { "rust" },
generator_opts = {
command = "leptosfmt",
args = { "--quiet", "--stdin" },
to_stdin = true,
},
factory = h.formatter_factory,
})
return {
"jose-elias-alvarez/null-ls.nvim",
event = "BufReadPre",
dependencies = { "mason.nvim" },
opts = function()
local nls = require("null-ls")
return {
sources = {
nls.builtins.formatting.terraform_fmt,
--nls.builtins.formatting.yamlfmt,
nls.builtins.formatting.deno_fmt.with({
filetypes = { "markdown" }
}),
nls.builtins.formatting.golines,
nls.builtins.formatting.goimports_reviser,
nls.builtins.formatting.goimports,
nls.builtins.formatting.gofumpt,
nls.builtins.formatting.taplo,
nls.builtins.formatting.prettierd.with({
filetypes = { "graphql" }
}),
nls.builtins.formatting.shfmt,
nls.builtins.code_actions.gitsigns,
nls.builtins.code_actions.refactoring,
nls.builtins.formatting.rustfmt.with({
extra_args = { "--edition=2021" },
filetypes = { "rust" }
}),
leptosfmt.with({
condition = function(utils)
return utils.root_has_file({ "leptosfmt.toml" })
end,
}),
nls.builtins.diagnostics.revive,
nls.builtins.code_actions.impl,
nls.builtins.code_actions.refactoring,
},
}
end,
}