2021-02-23 16:08:46 +01:00
|
|
|
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
|
|
|
call ftplugined#check_undo_ft()
|
|
|
|
|
2022-02-25 11:49:57 +01:00
|
|
|
" Set-up LSP, linters, formatters
|
|
|
|
lua << EOF
|
|
|
|
local null_ls = require("null-ls")
|
2022-02-28 11:31:26 +01:00
|
|
|
local utils = require("ambroisie.utils")
|
|
|
|
|
2022-02-25 11:49:57 +01:00
|
|
|
null_ls.register({
|
2022-02-28 11:31:26 +01:00
|
|
|
null_ls.builtins.diagnostics.flake8.with({
|
|
|
|
-- Only used if available
|
|
|
|
condition = utils.is_executable_condition("flake8"),
|
|
|
|
}),
|
|
|
|
null_ls.builtins.diagnostics.mypy.with({
|
|
|
|
-- Only used if available
|
|
|
|
condition = utils.is_executable_condition("mypy"),
|
|
|
|
}),
|
|
|
|
null_ls.builtins.diagnostics.pylint.with({
|
|
|
|
-- Only used if available
|
|
|
|
condition = utils.is_executable_condition("pylint"),
|
|
|
|
})
|
2022-02-25 19:14:18 +01:00
|
|
|
null_ls.builtins.formatting.black.with({
|
|
|
|
extra_args = { "--fast" },
|
2022-02-28 11:31:26 +01:00
|
|
|
-- Only used if available
|
|
|
|
condition = utils.is_executable_condition("black"),
|
|
|
|
}),
|
|
|
|
null_ls.builtins.formatting.isort.with({
|
|
|
|
-- Only used if available
|
|
|
|
condition = utils.is_executable_condition("isort"),
|
2022-02-25 19:14:18 +01:00
|
|
|
}),
|
2022-02-25 11:49:57 +01:00
|
|
|
})
|
|
|
|
EOF
|
|
|
|
|
2021-02-23 16:08:46 +01:00
|
|
|
" Change max length of a line to 88 for this buffer to match black's settings
|
|
|
|
setlocal colorcolumn=88
|
|
|
|
let b:undo_ftplugin.='|setlocal colorcolumn<'
|