Fix Conform and rust-analyzer
This commit is contained in:
parent
245105e8f3
commit
46794db36c
31
init.lua
31
init.lua
|
@ -536,8 +536,10 @@ require('lazy').setup {
|
|||
-- pyright = {},
|
||||
rust_analyzer = {
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
check = {
|
||||
command = "clippy",
|
||||
command = 'clippy',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -611,8 +613,6 @@ require('lazy').setup {
|
|||
|
||||
{ -- Autoformat
|
||||
'stevearc/conform.nvim',
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
opts = {
|
||||
notify_on_error = false,
|
||||
format_on_save = {
|
||||
|
@ -620,12 +620,25 @@ require('lazy').setup {
|
|||
lsp_fallback = true,
|
||||
},
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
python = { "isort", "black" },
|
||||
javascript = { { "prettierd", "prettier" } },
|
||||
typescript = { { "prettierd", "prettier" } },
|
||||
rust = { "rustfmt" },
|
||||
cpp = { "clang-format" },
|
||||
lua = { 'stylua' },
|
||||
python = { 'isort', 'black' },
|
||||
javascript = { { 'prettierd', 'prettier' } },
|
||||
typescript = { { 'prettierd', 'prettier' } },
|
||||
rust = { 'rustfmt' },
|
||||
cpp = { 'clang-format' },
|
||||
},
|
||||
},
|
||||
event = { 'BufWritePre' },
|
||||
cmd = { 'ConformInfo' },
|
||||
keys = {
|
||||
{
|
||||
-- Customize or remove this keymap to your liking
|
||||
'<leader>f',
|
||||
function()
|
||||
require('conform').format { async = true, lsp_fallback = true }
|
||||
end,
|
||||
mode = '',
|
||||
desc = 'Format buffer',
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
|
|
Loading…
Reference in New Issue