include i3 and nvim configuration in the central repository, rather than keep them in their seperate respective ones.
This commit is contained in:
38
.config/nvim/lua/plugin/conform.lua
Normal file
38
.config/nvim/lua/plugin/conform.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
---@module 'lazy'
|
||||
---@type LazySpec
|
||||
return { {
|
||||
'stevearc/conform.nvim', -- allows you to format a buffer
|
||||
event = { 'BufWritePre' },
|
||||
cmd = { 'ConformInfo' },
|
||||
keys = {
|
||||
{
|
||||
'<leader>f',
|
||||
function()
|
||||
require('conform').format { async = true, lsp_format = 'fallback' } -- execute the formatter
|
||||
-- vim.cmd [[keepjumps keeppatterns %s/\s\+$//e]] -- removes trailing whitespace
|
||||
end,
|
||||
mode = 'n',
|
||||
desc = '[f]ormat buffer',
|
||||
},
|
||||
},
|
||||
---@type conform.setupOpts
|
||||
opts = {
|
||||
notify_on_error = true,
|
||||
formatters_by_ft = {
|
||||
c = { 'clang-format' },
|
||||
h = { 'clang-format' },
|
||||
cpp = { 'clang-format' },
|
||||
hpp = { 'clang-format' },
|
||||
glsl = { 'clang-format', lsp_format = "first" },
|
||||
typescript = { 'clang-format', lsp_format = "first" },
|
||||
css = { 'clang-format' },
|
||||
rust = { 'rustfmt' },
|
||||
sh = { 'shfmt' },
|
||||
python = { 'isort' },
|
||||
-- json = { 'jq' },
|
||||
-- yaml = { 'yq' },
|
||||
toml = { 'yq' },
|
||||
xml = { 'yq' },
|
||||
},
|
||||
}
|
||||
} }
|
||||
Reference in New Issue
Block a user