mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 14:12:41 +00:00
feat: Adds nvim-lint configuration and swiftformat
This commit is contained in:
@@ -22,11 +22,34 @@ return {
|
||||
try_node_modules = true,
|
||||
}
|
||||
end,
|
||||
swift = function()
|
||||
return {
|
||||
exe = "swiftformat",
|
||||
}
|
||||
end,
|
||||
["*"] = {
|
||||
-- formatter for any / all file types.
|
||||
require("formatter.filetypes.any").remove_trailing_whitespace
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
-- Keymaps
|
||||
local wk = require('which-key')
|
||||
wk.add({
|
||||
{ "<space>f", ":Format", desc = "[F]ormat" },
|
||||
{ "<space>F", ":FormateWrite", desc = "[F]ormat write" }
|
||||
},
|
||||
{ mode = 'n', silent = true }
|
||||
)
|
||||
|
||||
local augroup = vim.api.nvim_create_augroup
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
augroup("__formatter__", { clear = true })
|
||||
autocmd("BufWritePost", {
|
||||
group = "__formatter__",
|
||||
command = ":FormatWrite"
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user