2017-07-13 10:06:09 +02:00
|
|
|
# My `neovim` setup
|
|
|
|
|
2021-02-17 09:09:54 +01:00
|
|
|
I'm trying to document my neovim setup. Mostly, I'm using neovim to edit
|
|
|
|
markdown, HTML, CSS/SCSS and python files.
|
2017-07-13 10:06:09 +02:00
|
|
|
|
2021-02-17 09:09:54 +01:00
|
|
|
I'm using `vim-plug` as a plugin manager. To install and activate `vim-plug`
|
|
|
|
see the [documentation][1].
|
2020-10-25 17:37:01 +01:00
|
|
|
|
|
|
|
I'm using the [nord color scheme][5].
|
2017-07-13 10:06:09 +02:00
|
|
|
|
2020-10-27 20:47:29 +01:00
|
|
|
## To do
|
|
|
|
|
2022-01-12 17:51:34 +01:00
|
|
|
- [x] Document how to use `pyenv` to provide a python engine.
|
2020-10-27 20:47:29 +01:00
|
|
|
- [ ] Identify the python package dependencies.
|
2021-02-17 09:09:54 +01:00
|
|
|
- `jedi`.
|
|
|
|
- `jedi-language-server`.
|
|
|
|
- `flake8`.
|
|
|
|
- `neovim`.
|
|
|
|
- `pycodestyle`.
|
|
|
|
- `pyflakes`.
|
|
|
|
- `pynvim`.
|
2020-10-27 20:47:29 +01:00
|
|
|
|
2017-08-16 12:10:24 +02:00
|
|
|
## Requirements
|
|
|
|
|
|
|
|
1. `neovim`
|
2020-10-25 17:37:01 +01:00
|
|
|
1. `git`
|
|
|
|
1. `nodejs`, `yarn`
|
2021-02-17 09:09:54 +01:00
|
|
|
1. [vim-plug][1]
|
2020-10-25 17:37:01 +01:00
|
|
|
1. [ripgrep][2]
|
|
|
|
1. [The Silver Searcher (`ag`)][3]
|
2020-10-27 20:22:42 +01:00
|
|
|
1. `grammalecte`, the python standalone program.
|
2020-10-27 20:47:29 +01:00
|
|
|
1. All or any of these python linters: `pep8`, `flake8`, `pycodestyle`,
|
|
|
|
`pyflakes`.
|
|
|
|
1. `scss_lint` (ruby), for SCSS lint.
|
2021-12-09 19:43:52 +01:00
|
|
|
1. A [font patched for nerds][8].
|
2017-08-16 12:10:24 +02:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2020-10-25 17:37:01 +01:00
|
|
|
1. Clone the repository.
|
|
|
|
1. Create a symlink.
|
|
|
|
1. Check [the requirements][4].
|
2021-02-17 09:09:54 +01:00
|
|
|
- [Install `vim-plug`][7].
|
2020-10-25 17:37:01 +01:00
|
|
|
1. Start `neovim`.
|
|
|
|
1. Install the plugins (`:PlugInstall`).
|
2017-08-16 12:10:24 +02:00
|
|
|
|
|
|
|
``` bash
|
|
|
|
git clone <URL>
|
|
|
|
ln -s neovim .config/neovim
|
|
|
|
nvim
|
|
|
|
:PlugInstall
|
|
|
|
```
|
|
|
|
|
2021-06-03 17:44:13 +02:00
|
|
|
## External configuration
|
|
|
|
|
|
|
|
In order to improve the `fzf` preview window display, it's possible to
|
|
|
|
configure it through the following `env` variable:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
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>
|
|
|
|
|
2022-01-12 17:51:34 +01:00
|
|
|
## 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`][9].
|
|
|
|
|
|
|
|
Install the python version you need with `pyenv`:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pyenv install 3.9.9
|
|
|
|
```
|
|
|
|
|
|
|
|
Create and name the virtual environment for neovim:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pyenv virtualenv 3.9.9 neovim
|
|
|
|
```
|
|
|
|
|
|
|
|
Activate the virtual environment and fetch the python path:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pyenv activate neovim
|
|
|
|
pyenv which python #Note the provided path
|
|
|
|
```
|
|
|
|
|
|
|
|
Add the following line to your `init.vim`:
|
|
|
|
|
|
|
|
```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:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pip install neovim pynvim …
|
|
|
|
```
|
|
|
|
|
|
|
|
To deactivate the virtual environment:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pyenv deactivate
|
|
|
|
```
|
|
|
|
|
2021-02-17 09:09:54 +01:00
|
|
|
[1]: https://github.com/junegunn/vim-plug
|
2020-10-25 17:37:01 +01:00
|
|
|
[2]: https://github.com/BurntSushi/ripgrep
|
|
|
|
[3]: https://github.com/ggreer/the_silver_searcher
|
|
|
|
[4]: /requirements
|
|
|
|
[5]: https://www.nordtheme.com/ports/vim
|
2021-02-17 09:09:54 +01:00
|
|
|
[7]: https://github.com/junegunn/vim-plug#installation
|
2021-12-09 19:43:52 +01:00
|
|
|
[8]: https://www.gitmemory.com/ryanoasis/nerd-fonts
|
2022-01-12 17:51:34 +01:00
|
|
|
[9]: https://github.com/pyenv/pyenv-installer
|