# HG changeset patch # User zegervdv # Date 1608539985 -3600 # Node ID aa0a095f875909457357efc29461950d23ab2016 # Parent 4daaf43a2b28cf8b5aaac71bd86d0e12dc1f5a5f Set up python formatting and linting through efm diff -r 4daaf43a2b28 -r aa0a095f8759 dot_config/nvim/config.lua --- a/dot_config/nvim/config.lua Thu Dec 17 17:51:54 2020 +0100 +++ b/dot_config/nvim/config.lua Mon Dec 21 09:39:45 2020 +0100 @@ -132,6 +132,24 @@ if (vim.fn.executable('efm-langserver') == 1) then lsp.efm.setup{ on_attach = on_attach; + init_options = {documentFormatting = true}; root_dir = lsputil.root_pattern('.git', '.hg'); + settings = { + rootMarkers = {".git/", ".hg/"}, + languages = { + python = { + { + formatCommand = "black -", + formatStdin = true + }, + { + lintCommand = "flake8 --stdin-display-name ${INPUT} -", + lintStdin = true, + lintIgnoreExitCode = true, + lintFormats = {"%f:%l:%c: %m"} + } + } + } + }; } end