formating
This commit is contained in:
parent
0eea4c8dab
commit
16e0df81f4
5 changed files with 23 additions and 13 deletions
|
|
@ -8,5 +8,5 @@ trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
[*.lua]
|
[*.lua]
|
||||||
max_line_length = 80
|
max_line_length = 120
|
||||||
align_array_table = false
|
align_array_table = false
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
"output-panel.nvim": { "branch": "main", "commit": "9979f9988acb35fd8e699d8b1fbc7aa17c9d8148" },
|
"output-panel.nvim": { "branch": "main", "commit": "9979f9988acb35fd8e699d8b1fbc7aa17c9d8148" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||||
"render-markdown.nvim": { "branch": "main", "commit": "c91fa46fc8d79f5577beac70a459f30ec17a60c2" },
|
"render-markdown.nvim": { "branch": "main", "commit": "c91fa46fc8d79f5577beac70a459f30ec17a60c2" },
|
||||||
|
"schemastore.nvim": { "branch": "main", "commit": "d307d291f38678d064cb987112926df6d9134de3" },
|
||||||
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
|
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" },
|
"telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" },
|
||||||
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
return {
|
return {
|
||||||
'saghen/blink.cmp',
|
'saghen/blink.cmp',
|
||||||
dependencies = 'rafamadriz/friendly-snippets',
|
dependencies = { 'rafamadriz/friendly-snippets' },
|
||||||
version = '*',
|
version = '*',
|
||||||
|
|
||||||
---@module 'blink.cmp'
|
---@module 'blink.cmp'
|
||||||
|
|
|
||||||
|
|
@ -30,14 +30,17 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||||
if not client then return end
|
if not client then return end
|
||||||
|
|
||||||
if vim.bo.filetype == "lua" or client.name == "jdtls" then
|
local LSP_CLIENT_NAMES_FORMAT_ON_SAVE = { "lua_ls", "jdtls" }
|
||||||
-- Format the current buffer on save
|
for _, client_name_autoformat in ipairs(LSP_CLIENT_NAMES_FORMAT_ON_SAVE) do
|
||||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
if client.name == client_name_autoformat then
|
||||||
buffer = args.buf,
|
-- Format the current buffer on save
|
||||||
callback = function()
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
vim.lsp.buf.format({ bufnr = args.buf, id = client.id })
|
buffer = args.buf,
|
||||||
end,
|
callback = function()
|
||||||
})
|
vim.lsp.buf.format({ bufnr = args.buf, id = client.id })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
@ -56,7 +59,8 @@ return {
|
||||||
tools_to_install = {
|
tools_to_install = {
|
||||||
"lua-language-server", "vtsls", "ruff", "mypy", "black",
|
"lua-language-server", "vtsls", "ruff", "mypy", "black",
|
||||||
"pyright", "tailwindcss-language-server",
|
"pyright", "tailwindcss-language-server",
|
||||||
"eslint-lsp", "lemminx", "gopls"
|
"eslint-lsp", "lemminx", "gopls", "prettierd", "dotenv-linter",
|
||||||
|
"editorconfig-checker", "proselint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
|
|
@ -82,7 +86,11 @@ return {
|
||||||
format_on_save(client, bufnr)
|
format_on_save(client, bufnr)
|
||||||
end,
|
end,
|
||||||
sources = {
|
sources = {
|
||||||
null_ls.builtins.formatting.prettier,
|
null_ls.builtins.formatting.prettierd,
|
||||||
|
|
||||||
|
null_ls.builtins.diagnostics.dotenv_linter,
|
||||||
|
null_ls.builtins.diagnostics.editorconfig_checker,
|
||||||
|
null_ls.builtins.diagnostics.proselint
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ return {
|
||||||
"html",
|
"html",
|
||||||
"jsdoc",
|
"jsdoc",
|
||||||
"hurl",
|
"hurl",
|
||||||
"typescript"
|
"typescript",
|
||||||
|
"json"
|
||||||
},
|
},
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue