neoformat icon indicating copy to clipboard operation
neoformat copied to clipboard

Adding formatter to existing filetype without forking neoformat

Open namedots opened this issue 3 years ago • 2 comments

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 avatar Oct 15 '21 17:10 namedots

@namedots Line length for Black is configurable in a pyproject.toml file as documented here.

alias-dev avatar Nov 02 '21 12:11 alias-dev

@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

namedots avatar Nov 02 '21 13:11 namedots