black icon indicating copy to clipboard operation
black copied to clipboard

Not an editor command Black

Open boscotsang opened this issue 5 years ago • 6 comments

Howdy! Sorry you're having trouble. To expedite your experience, provide some basics for me:

Operating system: Ubuntu 16.4 Python version: python 3.6 Black version: Use vim-plug install

I can use black in shell command. However when I type :Black in vim, I have encountered "Not an editor command Black". I have used PlugInstall to install and installation was sucessful.

boscotsang avatar Apr 24 '19 07:04 boscotsang

some problem on macos 10.14.5, python3.7 and vim installed with homebrew.

scontini76 avatar May 27 '19 11:05 scontini76

I have this same issue and have not been able to debug it

OS: macOS 10.14.3 Python Version: 3.7 Vim Version: 8.1 Installed using Pathogen

MaxwellGBrown avatar Jun 20 '19 18:06 MaxwellGBrown

Likewise, I've got:

  • vim version 8.0 (vim-nox, built with Python 3 support: +python3/dyn)
  • Python version 3.7
  • Black version version 19.3b0
  • OS: Linux Ubuntu
  • Installed using Pathogen (I have vim-go installed in the ~/.vim/bundle/ directory working fine, so must be a Black incompatibility)

I can run black from the command line fine, but the vim command gives error:

E492: Not an editor command: Black

Leaving another comment here as in the README it says:

"Let me know if this requires any changes to work with Vim 8's builtin packadd, or Pathogen, and so on."

I would be happy to help solve this bug, but I don't know what exactly to investigate. Since I'm not sure how long it'll take to get Pathogen support, I've just successfully installed via vim-plug as suggested.

lmmx avatar Jul 07 '19 16:07 lmmx

I was running into the same issue described above. Black worked fine from the command line, but did not work in neovim.

  • Python version 3.6.7
  • Black version version 19.3b0
  • OS: OSX 10.15.2
  • Installed using Pathogen

running pip install neovim fixed the issue for me. I realize this will likely not address many of the issues people are running into, if they are not using neovim, but hopefully it can help someone

johnchase avatar Jan 16 '20 22:01 johnchase

Fixed it for pathogen by putting the .vim file here:~/.vim/bundle/black/plugin/black.vim.

simlmx avatar Oct 09 '20 16:10 simlmx

Pathogen is not detecting the plugin for me neither, had to use the pack method.

Ubuntu 20.04.2 LTS
VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 15 2020 06:40:31)
Included patches: 1-2269

h3 avatar Jun 25 '21 17:06 h3