From charlesreid1

No edit summary
Line 33: Line 33:
To script the installation of Black and the setup of a vim plugin for Black,
To script the installation of Black and the setup of a vim plugin for Black,


==Side Note==
==Alternatives to Black==


If you aren't happy with Black and you want an alternative, you can use:
==Flake8==
[[Flake8]] is a set of Python formatting standards, or rules, that can be applied to Python code. Flake8 is different from Black in that it does not apply any fixes, it simply complains about things that don't follow the standard.
==Flags==
{{PythonFlag}}


[[Category:Vim]]
[[Category:Vim]]
[[Category:Python]]
[[Category:Python]]

Revision as of 16:48, 7 August 2019

Black is the uncompromising code formatter: https://black.readthedocs.io/en/stable/

Why Use Black

Lessons learned about gofmt. Also see blog posts at https://charlesreid1.github.io

Installation Instructions

To install black:

Make a vim plugin directory

mkdir -p ~/.vim/plugin

Now copy the black vim plugin into the plugin folder:

cd ~/.vim/plugin && wget https://github.com/psf/black/blob/master/plugin/black.vim

Next start vim up and let black go through the installation/setup process:

vim

Now you should be all set.

Scripting

To script the installation of Black and the setup of a vim plugin for Black,

Alternatives to Black

If you aren't happy with Black and you want an alternative, you can use:


Flake8

Flake8 is a set of Python formatting standards, or rules, that can be applied to Python code. Flake8 is different from Black in that it does not apply any fixes, it simply complains about things that don't follow the standard.

Flags