[profiles/desktop] modify neovim config
This commit is contained in:
@@ -4,6 +4,26 @@ return {
|
||||
config = function()
|
||||
local conform = require('conform')
|
||||
|
||||
local formatters = {
|
||||
stylua = {},
|
||||
clang_format = {},
|
||||
prettier = {},
|
||||
autopep8 = {},
|
||||
isort = {},
|
||||
shfmt = {},
|
||||
}
|
||||
|
||||
local util = require('conform.util')
|
||||
for _, formatter in pairs(formatters) do
|
||||
formatter.cwd = util.root_file({
|
||||
'.git',
|
||||
'pyproject.toml',
|
||||
'package.json',
|
||||
'Makefile',
|
||||
'.editorconfig',
|
||||
})
|
||||
end
|
||||
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
lua = { 'stylua' },
|
||||
@@ -13,12 +33,11 @@ return {
|
||||
css = { 'prettier' },
|
||||
javascript = { 'prettier' },
|
||||
python = { 'autopep8', 'isort' },
|
||||
bash = { 'beautysh' },
|
||||
csh = { 'beautysh' },
|
||||
ksh = { 'beautysh' },
|
||||
sh = { 'beautysh' },
|
||||
zsh = { 'beautysh' },
|
||||
bash = { 'shfmt' },
|
||||
ksh = { 'shfmt' },
|
||||
sh = { 'shfmt' },
|
||||
},
|
||||
formatters = formatters,
|
||||
-- format_on_save = {
|
||||
-- lsp_fallback = true,
|
||||
-- async = false,
|
||||
|
||||
@@ -11,7 +11,7 @@ return {
|
||||
require('mason-lspconfig').setup({
|
||||
automatic_enable = true,
|
||||
})
|
||||
|
||||
|
||||
vim.lsp.config('*', {
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
|
||||
Reference in New Issue
Block a user