feat: convert to blink, major lsp changes, lualine

This commit is contained in:
Jason Miller 2025-06-12 12:27:51 +09:00
parent 82102e5e29
commit 51ab444c0d
44 changed files with 1387 additions and 700 deletions

View file

@ -12,28 +12,63 @@ return {
mode = '',
desc = '[Fo]rmat Buffer',
},
{
'<leader>tf',
function()
vim.g.format_on_save_enabled = not vim.g.format_on_save_enabled
vim.notify('Format on save: ' .. (vim.g.format_on_save_enabled and 'enabled' or 'disabled'))
end,
mode = '',
desc = '[F]ormat on save',
},
},
opts = {
notify_on_error = false,
format_on_save = function(bufnr)
local disable_filetypes = { c = true, cpp = true, sh = true }
return {
timeout_ms = 500,
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
}
if not vim.g.format_on_save_enabled then
return false
end
local disable_filetypes = { c = true, cpp = true, sh = true, nix = true, md = true }
if disable_filetypes[vim.bo[bufnr].filetype] then
return nil
else
return {
async = false,
timeout_ms = 3000,
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
}
end
end,
formatters_by_ft = {
c = { 'clangd-format', 'cpplint' },
cs = { 'ast-grep' }, -- c#
css = { 'prettier' },
cmake = { 'cmakelang' },
cpp = { 'clangd-format', 'cpplint' },
flow = { 'prettier' },
go = { 'ast-grep', 'golangci-lint' }, -- gofumpt requires go
html = { 'prettier' },
h = { 'clangd-format', 'cpplint' },
hpp = { 'clangd-format', 'cpplint' },
java = { 'ast-grep' },
javascript = { 'prettier' },
javascriptreact = { 'prettier' },
-- jinja = { 'djlint' },
json = { 'prettier' },
-- latex = { 'tex-fmt' },
lua = { 'stylua' },
python = {
'black',
'isort',
'ruff_format',
'pyright',
},
-- php = { 'php-cs-fixer' },
markdown = { 'prettier' },
md = { 'prettier' },
nix = { 'nixfmt' },
yaml = { 'yamlfmt' },
nix = { 'alejandra' },
python = { 'isort', 'ruff_format' },
-- r = { 'air' },
sh = { 'shfmt' },
-- tf = { 'terraform' },
typescript = { 'prettier' },
typescriptreact = { 'prettier' },
yaml = { 'prettier' },
},
},
},