Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smbl64/vim-black-macchiato
Vim plugin for black-macchiato integration
https://github.com/smbl64/vim-black-macchiato
black black-macchiato python vim
Last synced: 18 days ago
JSON representation
Vim plugin for black-macchiato integration
- Host: GitHub
- URL: https://github.com/smbl64/vim-black-macchiato
- Owner: smbl64
- License: mit
- Created: 2021-02-09T21:46:15.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-17T14:19:57.000Z (4 months ago)
- Last Synced: 2024-12-01T00:49:36.584Z (22 days ago)
- Topics: black, black-macchiato, python, vim
- Language: Vim Script
- Homepage:
- Size: 7.81 KB
- Stars: 15
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-black-macchiato
This plugin provides integration with [black-macchiato][bm-url] which is a partial code formatter for Python.
## Installation
**Vundle:**
```
Plugin 'smbl64/vim-black-macchiato'
```**vim-plug:**
```
Plug 'smbl64/vim-black-macchiato'
```## Features
You can use the `:BlackMacchiato` command in normal mode to run `black-macchiato` on the current line, or in visual mode to run it on the selected lines.
### Keybindings
By default no keyboard shortcut is provided. You can use `(BlackMacchiatoSelection)` and `(BlackMacchiatoCurrentLine)` to define custom keyboard shortcuts.
For example, put these in your `.vimrc` file:
```
autocmd FileType python xmap f (BlackMacchiatoSelection)
autocmd FileType python nmap f (BlackMacchiatoCurrentLine)
```## Settings
### The `g:black_macchiato_path` option
Set this to your `black-macchiato` installation path.
Default: `"black-macchiato"`
### The `g:black_macchiato_args` option
Set this to additional argumens you want to pass to `black-macchiato`. For
example you can set it to `"-S -l100"` to ask `black` to skip string
normalization and use a longer line length.Default: `""`
[bm-url]: https://github.com/wbolster/black-macchiato