home: vim: do not use 'ftplugin' for 'null-ls'
Unfortunately, this registers the sources many times... I fear that I will have to settle for a centralised configuration for LSP-related options.
This commit is contained in:
parent
fb49a1df14
commit
260f5cd66a
9 changed files with 96 additions and 162 deletions
|
|
@ -1,36 +0,0 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Set-up LSP, linters, formatters
|
||||
lua << EOF
|
||||
local null_ls = require("null-ls")
|
||||
local utils = require("ambroisie.utils")
|
||||
|
||||
null_ls.register({
|
||||
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"),
|
||||
})
|
||||
null_ls.builtins.formatting.black.with({
|
||||
extra_args = { "--fast" },
|
||||
-- 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"),
|
||||
}),
|
||||
})
|
||||
EOF
|
||||
|
||||
" 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<'
|
||||
Loading…
Add table
Add a link
Reference in a new issue