iGor milhit
0645bda9f4
* Documents how to use `pyenv` to provide a virtual environment for the python engine. Co-Authored-by: iGor milhit <igor@milhit.ch> |
||
---|---|---|
.gitignore | ||
README.md | ||
init.vim | ||
minimal-init.vim |
README.md
My neovim
setup
I'm trying to document my neovim setup. Mostly, I'm using neovim to edit markdown, HTML, CSS/SCSS and python files.
I'm using vim-plug
as a plugin manager. To install and activate vim-plug
see the documentation.
I'm using the nord color scheme.
To do
- Document how to use
pyenv
to provide a python engine. - Identify the python package dependencies.
jedi
.jedi-language-server
.flake8
.neovim
.pycodestyle
.pyflakes
.pynvim
.
Requirements
neovim
git
nodejs
,yarn
- vim-plug
- ripgrep
- The Silver Searcher (
ag
) grammalecte
, the python standalone program.- All or any of these python linters:
pep8
,flake8
,pycodestyle
,pyflakes
. scss_lint
(ruby), for SCSS lint.- A font patched for nerds.
Installation
- Clone the repository.
- Create a symlink.
- Check the requirements.
- Start
neovim
. - Install the plugins (
:PlugInstall
).
git clone <URL>
ln -s neovim .config/neovim
nvim
:PlugInstall
External configuration
In order to improve the fzf
preview window display, it's possible to
configure it through the following env
variable:
export FZF_DEFAULT_OPTS="--preview='bat --style=numbers --color=always --line-range :500 {}' \
--border \
--color 'border:#4c566a,info:#4c566a,pointer:#88c0d0,prompt:#5e81ac,bg+:#3b4252,hl:#a3be8c'"
See the fzf
documentation: https://github.com/junegunn/fzf#preview-window
Provide an virtual environment for python engine
Benefit: having a separate virtual environment for your editor than the one your working into.
Install pyenv
with the pyenv-installer
.
Install the python version you need with pyenv
:
pyenv install 3.9.9
Create and name the virtual environment for neovim:
pyenv virtualenv 3.9.9 neovim
Activate the virtual environment and fetch the python path:
pyenv activate neovim
pyenv which python #Note the provided path
Add the following line to your init.vim
:
let g:python3_host_prog = '/full/path/to/neovim/bin/python
Install the python dependencies in the virtual environment as it is activated:
pip install neovim pynvim …
To deactivate the virtual environment:
pyenv deactivate