Giter VIP home page Giter VIP logo

black-nvim's Introduction

black-nvim

A port of the official black plugin to Neovim's remote Python plugin interface.

Differences:

  • It runs asynchronously, so it won't block scrolling while formatting the buffer.
  • Checks if filetype is "python" before formatting.
  • More robust error handling and better error messages.
  • Missing some features (Upgrading the black package automatically, respecting pyproject.toml).
  • Don't have to clone the entire source repo just to get the plugin.
  • Zero lines of Vimscript.

Installation

The 'master' branch is stable. You can see what is coming up by looking at 'devel' but I wouldn't recommend using it.

Plugin manager How to install
minpac call minpac#add('averms/black-nvim')
dein.vim call dein#add('averms/black-nvim')
vim-plug Plug 'averms/black-nvim', {'do': ':UpdateRemotePlugins'}

If you don't already have a system for managing python environments on your computer I would recommend the following:

  • Make sure you have at least version 3.6.
  • Set up a virtual environment for use with neovim.
    mkdir -p ~/.local/venv && cd ~/.local/venv
    python3 -m venv nvim
    cd nvim
    . ./bin/activate
    pip install pynvim black
  • Tell neovim about that environment like so:
    let g:python3_host_prog = $HOME . '/.local/venv/nvim/bin/python'
    If you're using vim-plug, this line needs to be before your Plug statement.
  • Run :checkhealth. The python3 provider section should be not-red.

Documentation

See black.md or type :h black.txt.

License

black-nvim is distributed under the MIT/Expat license. See LICENSE file for details.

black-nvim's People

Contributors

averms avatar manuflya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.