Compare commits
2 Commits
13a7e3860d
...
925010f10d
Author | SHA1 | Date |
---|---|---|
iGor milhit | 925010f10d | |
iGor milhit | 0112dfe601 |
64
README.md
64
README.md
|
@ -4,89 +4,60 @@ 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][1].
|
||||
|
||||
I'm using the [nord color scheme][5].
|
||||
see the [documentation][7].
|
||||
|
||||
## To do
|
||||
|
||||
- [x] Document how to use `pyenv` to provide a python engine.
|
||||
- [ ] Identify the python package dependencies.
|
||||
- `jedi`.
|
||||
- `jedi-language-server`.
|
||||
- `flake8`.
|
||||
- `neovim`.
|
||||
- `pycodestyle`.
|
||||
- `pyflakes`.
|
||||
- `pynvim`.
|
||||
- [x] Identify the python package dependencies.
|
||||
|
||||
## Requirements
|
||||
|
||||
1. `neovim`
|
||||
1. `git`
|
||||
1. A python virtualenv with python dependencies installed. (see [pyenv
|
||||
section][10]).
|
||||
1. `nodejs`, `yarn`
|
||||
1. [vim-plug][1]
|
||||
1. [ripgrep][2]
|
||||
1. [The Silver Searcher (`ag`)][3]
|
||||
1. `grammalecte`, the python standalone program.
|
||||
1. All or any of these python linters: `pep8`, `flake8`, `pycodestyle`,
|
||||
`pyflakes`.
|
||||
1. `scss_lint` (ruby), for SCSS lint.
|
||||
1. A [font patched for nerds][8].
|
||||
|
||||
## Installation
|
||||
|
||||
1. Clone the repository.
|
||||
1. Create a symlink.
|
||||
1. Check [the requirements][4].
|
||||
- [Install `vim-plug`][7].
|
||||
1. Check [the requirements][4]. ⬆
|
||||
1. Clone the repository \
|
||||
`git clone <URL>`
|
||||
1. Create a symlink: \
|
||||
`ln /path/neovim/init.vim /home/user/.config/nvim/init.vim`.
|
||||
1. [Install `vim-plug`][7].
|
||||
1. Start `neovim`.
|
||||
1. Install the plugins (`:PlugInstall`).
|
||||
|
||||
``` bash
|
||||
git clone <URL>
|
||||
ln -s neovim .config/neovim
|
||||
nvim
|
||||
:PlugInstall
|
||||
```
|
||||
## Create a virtualenv with pyenv
|
||||
|
||||
## 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>
|
||||
|
||||
## Provide an virtual environment for python engine
|
||||
|
||||
Benefit: having a separate virtual environment for your editor than the one
|
||||
your working into.
|
||||
Benefit: having a separate virtual environment for the python engine 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
|
||||
pyenv install <python version>
|
||||
```
|
||||
|
||||
Create and name the virtual environment for neovim:
|
||||
|
||||
```bash
|
||||
pyenv virtualenv 3.9.9 neovim
|
||||
pyenv virtualenv <python version> neovim
|
||||
```
|
||||
|
||||
Activate the virtual environment and fetch the python path:
|
||||
|
||||
```bash
|
||||
pyenv activate neovim
|
||||
pyenv which python #Note the provided path
|
||||
pyenv which python # Note the provided path
|
||||
```
|
||||
|
||||
Add the following line to your `init.vim`:
|
||||
|
@ -98,7 +69,7 @@ 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 …
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
To deactivate the virtual environment:
|
||||
|
@ -115,3 +86,4 @@ pyenv deactivate
|
|||
[7]: https://github.com/junegunn/vim-plug#installation
|
||||
[8]: https://www.github.com/ryanoasis/nerd-fonts
|
||||
[9]: https://github.com/pyenv/pyenv-installer
|
||||
[10]: #create-a-virtualenv-with-pyenv
|
||||
|
|
21
init.vim
21
init.vim
|
@ -27,7 +27,6 @@ Plug 'tpope/vim-fugitive' " Gi
|
|||
Plug 'Xuyuanp/nerdtree-git-plugin' " To see new or modified files in the nerdtree window
|
||||
Plug 'https://github.com/editorconfig/editorconfig-vim' " Support of '.editorconfig' files
|
||||
Plug 'shmargum/vim-sass-colors' " Highlight sass/scss/less/css colors and color variables
|
||||
Plug 'vim-syntastic/syntastic' " Syntax checking (linting)
|
||||
" Auto completion
|
||||
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||
Plug 'pappasam/coc-jedi', { 'do': 'yarn install --frozen-lockfile && yarn build' } "Python, using jedi
|
||||
|
@ -118,6 +117,8 @@ au FileType json set shiftwidth=2
|
|||
autocmd FileType html set tabstop=2
|
||||
autocmd FileType html set softtabstop=2
|
||||
autocmd FileType html set shiftwidth=2
|
||||
au FileType xml setlocal foldmethod=indent
|
||||
autocmd FileType xml set foldlevel=2
|
||||
|
||||
" XML
|
||||
let g:xml_syntax_folding=3
|
||||
|
@ -154,24 +155,6 @@ nnoremap <C-h> :call pandoc#formatting#UseHardWraps()
|
|||
nnoremap <C-t> :call pandoc#formatting#ToggleAutoformat()
|
||||
let g:mkdp_filetypes = ['markdown', 'pandoc', 'pandoc.markdown']
|
||||
|
||||
" #########################################
|
||||
" #########################################
|
||||
" Linters (syntastic configuration)
|
||||
"
|
||||
" SCSS linter
|
||||
let g:syntastic_scss_checkers = ['scss_lint']
|
||||
|
||||
" Python linters. I define this list mainly to avoid pylint which I can't
|
||||
" manage to use correctly and is required on my main OS.
|
||||
let g:syntastic_python_checkers=['flake8', 'pep8', 'pycodestyle', 'pyflakes']
|
||||
|
||||
" Copy pasting of the basic configuration recommended by syntastic
|
||||
" https://github.com/vim-syntastic/syntastic#settings
|
||||
" but without the statusline settings to improve comptability with airline.
|
||||
let g:syntastic_always_populate_loc_list = 1
|
||||
let g:syntastic_auto_loc_list = 1
|
||||
let g:syntastic_check_on_open = 1
|
||||
|
||||
" #########################################
|
||||
" #########################################
|
||||
" autocompletion, mainly coc configuration
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
certifi
|
||||
charset-normalizer
|
||||
docstring-to-markdown
|
||||
flake8
|
||||
greenlet
|
||||
idna
|
||||
jedi
|
||||
jedi-language-server
|
||||
mccabe
|
||||
msgpack
|
||||
neovim
|
||||
parso
|
||||
pycodestyle
|
||||
pydantic
|
||||
pyflakes
|
||||
pygls
|
||||
pygrammalecte
|
||||
pynvim
|
||||
requests
|
||||
typeguard
|
||||
typing_extensions
|
||||
urllib3
|
Loading…
Reference in New Issue