From ebc371d80f55876efd8011fc58553801fe702e8a Mon Sep 17 00:00:00 2001 From: Henrik Bakken Date: Wed, 11 Aug 2021 01:12:39 +0200 Subject: [PATCH] vim black --- nvim/init.lua | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index b974d6a..8202f1c 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -418,6 +418,10 @@ require("packer").startup {function(use) end } + use {"psf/black", + vim.api.nvim_command [[autocmd BufWritePre *.py execute ':Black']] + } + -- treesitter use {"nvim-treesitter/nvim-treesitter", run = ":TSUpdate", @@ -580,6 +584,9 @@ require("packer").startup {function(use) auto_preview = true, -- automatically preview the location of the diagnostic. to close preview and go back to last window auto_fold = false, -- automatically fold a file trouble list at creation } + local map = vim.api.nvim_set_keymap + local opts = { noremap = true } + map("n", "", ":Trouble", opts) end } @@ -712,21 +719,17 @@ require("packer").startup {function(use) rootMarkers = { ".git/" }, languages = { python = { - { - lintCommand = "flake8 --max-line-length 88 --format '%(path)s:%(row)d:%(col)d: %(code)s %(code)s %(text)s' --stdin-display-name ${INPUT} -", - lintStdin = true, - lintIgnoreExitCode = true, - lintFormats = {"%f:%l:%c: %t%n%n%n %m"}, - lintSource = "flake8" - }, + -- { + -- lintCommand = "flake8 --max-line-length 88 --format '%(path)s:%(row)d:%(col)d: %(code)s %(code)s %(text)s' --stdin-display-name ${INPUT} -", + -- lintStdin = true, + -- lintIgnoreExitCode = true, + -- lintFormats = {"%f:%l:%c: %t%n%n%n %m"}, + -- lintSource = "flake8" + -- }, { formatCommand = "isort --stdout --profile black --force-single-line-imports -", formatStdin = true }, - { - formatCommand = "black --fast -", - formatStdin = true - } }, javascript = {prettier, eslint}, yaml = {prettier},