From: Asger Hautop Drewsen Date: Sun, 20 Oct 2019 14:43:02 +0000 (+0200) Subject: Use better default venv dir when using neovim (#937) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/4bcae4cf839aeba828bcdc4764369ae790f81d0d Use better default venv dir when using neovim (#937) --- diff --git a/README.md b/README.md index ddca8a4..3ef758f 100644 --- a/README.md +++ b/README.md @@ -725,7 +725,7 @@ Configuration: * `g:black_fast` (defaults to `0`) * `g:black_linelength` (defaults to `88`) * `g:black_skip_string_normalization` (defaults to `0`) -* `g:black_virtualenv` (defaults to `~/.vim/black`) +* `g:black_virtualenv` (defaults to `~/.vim/black` or `~/.local/share/nvim/black`) To install with [vim-plug](https://github.com/junegunn/vim-plug): diff --git a/plugin/black.vim b/plugin/black.vim index 030c18f..9def61a 100644 --- a/plugin/black.vim +++ b/plugin/black.vim @@ -24,7 +24,11 @@ endif let g:load_black = "py1.0" if !exists("g:black_virtualenv") - let g:black_virtualenv = "~/.vim/black" + if has("nvim") + let g:black_virtualenv = "~/.local/share/nvim/black" + else + let g:black_virtualenv = "~/.vim/black" + endif endif if !exists("g:black_fast") let g:black_fast = 0