neoformat
neoformat copied to clipboard
Adding formatter to existing filetype without forking neoformat
from readme:
Create a file in autoload/neoformat/formatters/{{ filetype }}.vim if it does not already exist for your filetype.
Okay. But what if it does exist? If I edit that file then I am effectively forking neoformat and would need to deal with my own patches when updating it.
What I'm really looking to do is to tell black (python) about my textwidth, which isn't something I can hard-code as configuration since it isn't known at that time, it is only known what the current textwidth is when I run the formatter.
@namedots Line length for Black is configurable in a pyproject.toml
file as documented here.
@alias-dev that doesn't help me make use of variables in vim however. with a formatter being an extension of my editor, it should be paying attention to my editor settings.
As a workaround I've switched some languages to mhartington/formatter.nvim which does allow defining a function in vimrc to be evaluated each time the formatter is invoked