🔧 Replaced neoformat with conform
This commit is contained in:
parent
3a26aa2223
commit
9a24426c01
5 changed files with 25 additions and 13 deletions
17
.config/nvim/after/plugin/conform.lua
Normal file
17
.config/nvim/after/plugin/conform.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
require("conform").setup({
|
||||||
|
formatters_by_ft = {
|
||||||
|
python = { "isort" },
|
||||||
|
lua = { "stylua" },
|
||||||
|
css = { "stylelint" },
|
||||||
|
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
typescript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
html = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
sql = { "sql_formatter" },
|
||||||
|
sh = { "shfmt" },
|
||||||
|
},
|
||||||
|
format_on_save = {
|
||||||
|
-- These options will be passed to conform.format()
|
||||||
|
timeout_ms = 500,
|
||||||
|
lsp_format = "fallback",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
vim.cmd([[let g:shfmt_opt="-ci"]])
|
|
||||||
|
|
@ -29,7 +29,8 @@ return require("packer").startup(function(use)
|
||||||
-- use({ "norcalli/nvim-colorizer.lua" })
|
-- use({ "norcalli/nvim-colorizer.lua" })
|
||||||
use({ "windwp/nvim-autopairs" })
|
use({ "windwp/nvim-autopairs" })
|
||||||
use({ "simeji/winresizer" })
|
use({ "simeji/winresizer" })
|
||||||
use({ "sbdchd/neoformat" })
|
-- use({ "sbdchd/neoformat" })
|
||||||
|
use({ "stevearc/conform.nvim" })
|
||||||
use({ "rhysd/vim-clang-format" })
|
use({ "rhysd/vim-clang-format" })
|
||||||
use({ "sangdol/mintabline.vim" })
|
use({ "sangdol/mintabline.vim" })
|
||||||
use({ "ThePrimeagen/harpoon" })
|
use({ "ThePrimeagen/harpoon" })
|
||||||
|
|
|
||||||
|
|
@ -46,17 +46,6 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||||
command = [[%s/\s\+$//e]],
|
command = [[%s/\s\+$//e]],
|
||||||
})
|
})
|
||||||
|
|
||||||
-- formats on save
|
|
||||||
-- vim.cmd([[autocmd BufWritePre * silent! :Neoformat]])
|
|
||||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
|
||||||
pattern = { "*", "silent!" },
|
|
||||||
command = ":Neoformat",
|
|
||||||
})
|
|
||||||
-- disable poor neoformatting for .sql files
|
|
||||||
vim.cmd([[let g:neoformat_enabled_sql = [] ]])
|
|
||||||
|
|
||||||
--Saves vim session on save
|
|
||||||
|
|
||||||
-- Marks end of line, space, and trailing space characters
|
-- Marks end of line, space, and trailing space characters
|
||||||
vim.opt.listchars:append({ eol = "↵", trail = "·", space = "·" })
|
vim.opt.listchars:append({ eol = "↵", trail = "·", space = "·" })
|
||||||
vim.opt.list = true
|
vim.opt.list = true
|
||||||
|
|
|
||||||
|
|
@ -558,3 +558,9 @@ doas pacman -S lftp
|
||||||
08/11/2024
|
08/11/2024
|
||||||
Install cargo-leptos:
|
Install cargo-leptos:
|
||||||
cargo install cargo-leptos
|
cargo install cargo-leptos
|
||||||
|
|
||||||
|
08/12/2024
|
||||||
|
Install isort and stylelint
|
||||||
|
doas pacman -S python-isort stylelint
|
||||||
|
Install sql-formatter
|
||||||
|
paru sql-formatter
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue