From 148d5378e4505d89a6f2065a3fe2128c3e039379 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Fri, 14 Aug 2020 14:42:00 +0200 Subject: [PATCH] vim: Add shortcut to disable black --- home/.config/nvim/ftplugin/python.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/home/.config/nvim/ftplugin/python.vim b/home/.config/nvim/ftplugin/python.vim index d8248a4..888c1b6 100644 --- a/home/.config/nvim/ftplugin/python.vim +++ b/home/.config/nvim/ftplugin/python.vim @@ -1 +1,3 @@ -autocmd BufWritePre execute ':silent Black' +let b:black_disable = 0 +autocmd BufWritePre if b:black_disable != 1 | execute 'silent Black' | endif +map b :let b:black_disable = (b:black_disable + 1) % 2