Skip to content

Commit

Permalink
Try out conform.nvim instead of none-ls
Browse files Browse the repository at this point in the history
  • Loading branch information
notahat committed Jan 5, 2025
1 parent b981d6e commit 05b74e2
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require("config.options")
require("config.lazy")
require("config.key-mappings")
require("config.format-on-save")
-- require("config.format-on-save")
require("config.kitty-integration")
1 change: 1 addition & 0 deletions config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"blink.cmp": { "branch": "main", "commit": "51fb932f63af0d6722ad6e31c8e931a5a684bd25" },
"conform.nvim": { "branch": "master", "commit": "70019124aa4f2e6838be9fbd2007f6d13b27a96d" },
"dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
Expand Down
31 changes: 31 additions & 0 deletions config/nvim/lua/plugins/conform.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- Format files on save.
return {
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
opts = {
-- log_level = vim.log.levels.DEBUG,
formatters_by_ft = {
css = { "prettierd" },
html = { "prettierd" },
javascript = { "prettierd" },
javascriptreact = { "prettierd" },
json = { "prettierd" },
jsonc = { "prettierd" },
less = { "prettierd" },
lua = { "stylua" },
markdown = { "prettierd" },
["markdown.mdx"] = { "prettierd" },
ruby = { "syntax_tree" },
scss = { "prettierd" },
typescript = { "prettierd" },
typescriptreact = { "prettierd" },
},
default_format_opts = {
lsp_format = "fallback",
},
format_on_save = {
timeout_ms = 500,
},
},
}
2 changes: 1 addition & 1 deletion config/nvim/lua/plugins/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ return {

lspconfig.bashls.setup({ capabilities = capabilities })
lspconfig.eslint.setup({ capabilities = capabilities })
lspconfig.syntax_tree.setup({ capabilities = capabilities })
-- lspconfig.syntax_tree.setup({ capabilities = capabilities })
lspconfig.ts_ls.setup({ capabilities = capabilities })

if os.getenv("DOTFILES_ENV") == "work" then
Expand Down
1 change: 1 addition & 0 deletions config/nvim/lua/plugins/none-ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
-- It's a fork of null-ls, hence the requires for null-ls rather than none-ls.
return {
"nvimtools/none-ls.nvim",
enabled = false,
config = function()
local null_ls = require("null-ls")
null_ls.setup({
Expand Down

0 comments on commit 05b74e2

Please sign in to comment.