grantjenks / blue

The slightly less uncompromising Python code formatter.
https://blue.readthedocs.io/
Other
393 stars 21 forks source link

Vim Plugin for blue #98

Open igordertigor opened 1 year ago

igordertigor commented 1 year ago

I noticed that there doesn't seem to be a vim plugin for blue. I therefore cloned the plugin at psf/black and extended it to run either "black" or "blue". Would that be something that you would like to include in your repository (as black does) or maybe something you would like to reference from the documentation?

rotten commented 1 year ago

FWIW, I think that would be pretty cool to try. I use vim as my main daily code editor.

igordertigor commented 1 year ago

The code is here. I use it with

Plug 'igordertigor/bnb.vim'

Let me know if it's useful (ideally in the issues).

rotten commented 1 year ago

Thanks! I'll give it a try.

rotten commented 11 months ago

Huh. I was cleaning up old tabs and came across this. At the time, I added

Plug 'igordertigor/bnb.vim'

to the plugin section of my .vimrc

I also added

let g:bnb_fixer = "blue"

Then I opened vim and ran :PlugUpdate to pick up the plugin. I verified it was loaded in .vim/plugged.

... and that is as far as I got. I couldn't figure out what command would cause it to reformat my open python file. I meant to come back and ask, but got side tracked (squirrel!) and totally forgot.

What do I do next?

igordertigor commented 7 months ago

Hi @rotten , apologies for the late reply. The readme says it: "Instead of running Black, BlackUpgrade and BlackVersion, you would use Bnb, BnbUpgrade and BnbVersion.". So you would just type :Black in vim.

By the way, I'm actually not using the anymore since I moved to nvim with a lua config, where I can use null-ls for this.