move old nvim config
This commit is contained in:
parent
c9ae53e233
commit
e7740e9989
27 changed files with 492 additions and 704 deletions
43
config/nvim/lua/plugins/guard.lua
Normal file
43
config/nvim/lua/plugins/guard.lua
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
return {
|
||||
'nvimdev/guard.nvim',
|
||||
-- TODO: use main repo when #76 merged
|
||||
dependencies = {
|
||||
{ dir = '~/dev/guard-collection', 'barrettruth/guard-collection' },
|
||||
},
|
||||
init = function()
|
||||
vim.g.guard_config = {
|
||||
fmt_on_save = false,
|
||||
save_on_fmt = true,
|
||||
lsp_as_default_formatter = true,
|
||||
}
|
||||
end,
|
||||
config = function()
|
||||
local ft = require('guard.filetype')
|
||||
|
||||
ft('python'):fmt({
|
||||
cmd = 'isort',
|
||||
args = { '--profile', 'black', '-' },
|
||||
stdin = true,
|
||||
}):append('black'):lint('mypy')
|
||||
|
||||
ft('lua'):fmt('stylua'):lint('selene')
|
||||
|
||||
ft('javascript,javascriptreact,typescript,typescriptreact'):fmt('prettierd'):lint('eslint_d')
|
||||
ft('css,graphql,html,json,jsonc,mdx,yaml'):fmt('prettierd')
|
||||
|
||||
ft('sh,bash,zsh'):fmt({
|
||||
cmd = 'shfmt',
|
||||
args = { '-i', '2' },
|
||||
stdin = true,
|
||||
})
|
||||
ft('zsh'):lint('zsh')
|
||||
|
||||
ft('proto'):fmt('buf'):lint('buf')
|
||||
ft('dockerfile'):lint('hadolint')
|
||||
ft('tex'):fmt('latexindent')
|
||||
ft('cmake'):fmt('cmake-format')
|
||||
ft('make'):lint('checkmake')
|
||||
ft('cpp'):lint('cpplint')
|
||||
ft('markdown'):fmt('cbfmt'):append('prettierd')
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue