2020-05-20 07:28:20 +02:00
|
|
|
" plugins (vim-plug)
|
|
|
|
call plug#begin('~/.config/nvim/plugged')
|
2020-06-14 09:26:12 +02:00
|
|
|
Plug 'sheerun/vim-polyglot' " Many languages syntax support
|
|
|
|
" Should be on top to be overwritten by pandoc
|
2020-05-20 07:28:20 +02:00
|
|
|
Plug 'tpope/vim-sensible' " default settings
|
|
|
|
Plug 'vim-pandoc/vim-pandoc' " pandoc support
|
|
|
|
Plug 'vim-pandoc/vim-pandoc-syntax' " markdown syntax support
|
2020-06-10 08:41:46 +02:00
|
|
|
Plug 'arcticicestudio/nord-vim' " Nord color scheme
|
2020-10-27 20:22:42 +01:00
|
|
|
Plug 'dpelle/vim-Grammalecte' " French ortho/grammar spelling
|
2020-05-20 07:28:20 +02:00
|
|
|
Plug 'junegunn/goyo.vim', { 'on': 'Goyo' } " distraction free
|
|
|
|
Plug 'dhruvasagar/vim-table-mode', { 'on': 'TableModeEnable' }
|
|
|
|
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' }
|
2020-06-10 08:41:46 +02:00
|
|
|
Plug 'gu-fan/riv.vim', { 'for': 'rst' } " rst syntax support
|
2020-05-20 07:28:20 +02:00
|
|
|
Plug 'vim-airline/vim-airline'
|
|
|
|
Plug 'vim-airline/vim-airline-themes'
|
|
|
|
Plug 'jiangmiao/auto-pairs' " pairs autocomplete
|
|
|
|
Plug 'tpope/vim-surround' " to manipulate surroundings
|
|
|
|
Plug 'tpope/vim-unimpaired' " toggle shortcut
|
|
|
|
Plug 'tpope/vim-commentary' " easy commenting
|
2020-06-10 08:41:46 +02:00
|
|
|
Plug 'elzr/vim-json', { 'for': 'json' }
|
2020-05-20 07:28:20 +02:00
|
|
|
Plug 'osyo-manga/vim-over', { 'on': 'OverCommandLine' }
|
|
|
|
Plug 'kien/ctrlp.vim'
|
|
|
|
Plug 'scrooloose/nerdtree'
|
|
|
|
Plug 'tpope/vim-fugitive' " git
|
|
|
|
Plug 'Xuyuanp/nerdtree-git-plugin'
|
|
|
|
Plug 'https://github.com/editorconfig/editorconfig-vim'
|
|
|
|
" Auto completion
|
|
|
|
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
|
|
|
Plug 'zchee/deoplete-jedi' " source for python autocompletion
|
|
|
|
Plug 'Shougo/neco-syntax' " other sources for autocompletion
|
|
|
|
Plug 'davidhalter/jedi-vim' " Code jump
|
|
|
|
Plug 'neomake/neomake' " Python linting
|
|
|
|
" Imports sorting
|
|
|
|
Plug 'stsewd/isort.nvim', { 'do': ':UpdateRemotePlugins' }
|
2020-06-17 13:40:04 +02:00
|
|
|
Plug 'vitalk/vim-simple-todo'
|
2020-10-14 16:18:43 +02:00
|
|
|
" Search
|
|
|
|
Plug 'jremmen/vim-ripgrep' " Use ripgrep
|
2020-10-25 17:37:01 +01:00
|
|
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
|
|
|
Plug 'junegunn/fzf.vim'
|
2020-05-20 07:28:20 +02:00
|
|
|
call plug#end()
|
|
|
|
|
2017-07-13 10:06:09 +02:00
|
|
|
" Filetype detection
|
|
|
|
filetype plugin on
|
|
|
|
|
|
|
|
" Format indentation
|
|
|
|
if has("autocmd")
|
|
|
|
filetype plugin indent on
|
|
|
|
endif
|
|
|
|
|
2017-11-19 11:41:49 +01:00
|
|
|
" add some tags for html indentations
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:html_indent_inctags="html,body,head,tbody"
|
2017-07-13 10:44:10 +02:00
|
|
|
|
2017-12-10 10:48:12 +01:00
|
|
|
set smartindent
|
|
|
|
set tabstop=4
|
|
|
|
set expandtab
|
|
|
|
set softtabstop=4
|
|
|
|
set shiftwidth=4
|
2017-07-13 10:06:09 +02:00
|
|
|
set showcmd " Show (partial) command in status line.
|
2018-03-01 16:16:37 +01:00
|
|
|
set showmode " Show indication of having changed modes
|
2017-07-13 10:06:09 +02:00
|
|
|
set showmatch " Show matching brackets.
|
|
|
|
set ignorecase " Do case insensitive matching
|
|
|
|
set smartcase " Do smart case matching
|
2018-03-01 16:16:37 +01:00
|
|
|
set hlsearch " Highlight search
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:rg_highlight='true' " Activate ripgrep Highlighting
|
2019-08-22 07:37:46 +02:00
|
|
|
nnoremap <silent> <C-l> :nohlsearch<CR><C-l> " set C-l to :nohlsearch
|
2017-07-13 10:06:09 +02:00
|
|
|
set autowrite " Automatically save before commands like :next and :make
|
|
|
|
set hidden " Hide buffers when they are abandoned
|
|
|
|
set mouse=a " Enable mouse usage (all modes)
|
|
|
|
set linebreak " Line wrap
|
2017-12-10 10:48:12 +01:00
|
|
|
set tw=79 " Lines longer than 79 chars will be wrapped
|
2020-10-14 16:18:43 +02:00
|
|
|
autocmd FileType gitcommit set textwidth=72 " Wrap lines longer than 72 chars for git messages
|
2019-08-07 07:13:45 +02:00
|
|
|
set colorcolumn=+1 " Colors the tw+1 column
|
2020-10-14 16:18:43 +02:00
|
|
|
autocmd FileType gitcommit set colorcolumn+=51 " Add a colored column at 51 chars for git message titles
|
2017-11-19 11:41:49 +01:00
|
|
|
set number " Line numbering
|
2019-08-29 08:28:45 +02:00
|
|
|
au TermOpen * setlocal listchars= nonumber norelativenumber
|
2017-12-10 10:48:12 +01:00
|
|
|
set cursorline
|
2017-07-13 10:06:09 +02:00
|
|
|
set modeline
|
|
|
|
|
2020-10-27 20:22:42 +01:00
|
|
|
" Spelling activated, by default for French and English
|
2019-09-30 07:47:25 +02:00
|
|
|
set spell
|
2020-04-29 06:33:36 +02:00
|
|
|
set spelllang=fr,en
|
2020-10-27 20:22:42 +01:00
|
|
|
" Specific spelling configuration for git commit messages
|
2020-04-29 06:33:36 +02:00
|
|
|
autocmd FileType gitcommit setlocal spell
|
|
|
|
autocmd FileType gitcommit setlocal spelllang=en
|
2020-10-27 20:22:42 +01:00
|
|
|
" Path for grammalecte-cli to get grammar check in French
|
|
|
|
let g:grammalecte_cli_py='/usr/bin/grammalecte-cli'
|
2019-09-30 07:47:25 +02:00
|
|
|
|
2018-03-01 15:00:20 +01:00
|
|
|
" Consider `.jsonld` as JSON
|
2019-08-07 07:13:45 +02:00
|
|
|
autocmd BufNewFile,BufRead *.jsonld set filetype=json
|
2019-03-06 07:18:24 +01:00
|
|
|
" tabstop to 2 for JSON
|
|
|
|
au FileType json set tabstop=2
|
|
|
|
au FileType json set softtabstop=2
|
|
|
|
au FileType json set shiftwidth=2
|
2018-03-01 15:00:20 +01:00
|
|
|
|
2017-07-13 10:06:09 +02:00
|
|
|
" fold
|
2020-04-29 06:33:36 +02:00
|
|
|
set foldmethod=syntax
|
|
|
|
set foldlevel=1
|
2017-12-11 06:27:23 +01:00
|
|
|
" Type de fold si c'est du JSON
|
|
|
|
autocmd FileType json setlocal foldmethod=syntax
|
|
|
|
" Détermine le niveau de fold par défaut pour le JSON
|
|
|
|
autocmd FileType json set foldlevel=2
|
2018-10-19 09:08:27 +02:00
|
|
|
autocmd FileType json set tabstop=2
|
|
|
|
autocmd FileType json set softtabstop=2
|
|
|
|
" Détermine l'indentation par défaut pour le html
|
|
|
|
autocmd FileType html set tabstop=2
|
|
|
|
autocmd FileType html set softtabstop=2
|
|
|
|
autocmd FileType html set shiftwidth=2
|
2017-07-13 10:06:09 +02:00
|
|
|
|
2017-07-19 11:57:50 +02:00
|
|
|
let g:xml_syntax_folding=3
|
|
|
|
au FileType xml setlocal foldmethod=syntax
|
2017-07-20 11:39:04 +02:00
|
|
|
autocmd FileType xml set foldlevel=1
|
2017-07-19 11:57:50 +02:00
|
|
|
|
2017-07-13 10:44:10 +02:00
|
|
|
" copy to clipboard with `"+y`
|
2017-07-13 10:06:09 +02:00
|
|
|
set clipboard+=unnamedplus
|
|
|
|
|
|
|
|
" airline
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:airline_powerline_fonts=1
|
|
|
|
let g:airline#extensions#wordcount#filetypes='pandoc\|text\|' "Add support when pandoc is activated
|
2020-05-13 21:20:53 +02:00
|
|
|
let g:airline_theme='nord'
|
2017-07-13 10:06:09 +02:00
|
|
|
|
|
|
|
" vim-table-mode
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:table_mode_corner='|'
|
2017-07-13 10:44:10 +02:00
|
|
|
|
2019-08-08 07:22:53 +02:00
|
|
|
" NERDTree
|
|
|
|
autocmd StdinReadPre * let s:std_in=1
|
|
|
|
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
|
2019-08-22 07:37:46 +02:00
|
|
|
let g:NERDTreeWinSize=40
|
2019-08-08 07:22:53 +02:00
|
|
|
|
2017-07-20 11:39:04 +02:00
|
|
|
" vim-json, don't conceal
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:vim_json_syntax_conceal=0
|
2017-12-10 10:48:12 +01:00
|
|
|
|
2017-12-11 06:27:23 +01:00
|
|
|
" ctrlP
|
2019-04-15 06:53:23 +02:00
|
|
|
" match window position
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:ctrlp_match_window='top,order:ttb,min:1,max:10,results:10'
|
2019-04-15 06:53:23 +02:00
|
|
|
"set the working directory
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:ctrlp_working_path_mode='ra'
|
2017-12-11 06:27:23 +01:00
|
|
|
" enable caching
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:ctrlp_use_caching=1
|
|
|
|
let g:ctrlp_clear_cache_on_exit=0
|
2017-12-11 06:27:23 +01:00
|
|
|
|
2020-04-29 06:33:36 +02:00
|
|
|
" Pandoc
|
2020-10-14 16:18:43 +02:00
|
|
|
" Autoformatting with hardwrap
|
|
|
|
let g:pandoc#formatting#mode="hA"
|
|
|
|
" ctrl+s switch to softwrap
|
2020-04-29 06:33:36 +02:00
|
|
|
nnoremap <C-s> :call pandoc#formatting#UseSoftWraps()
|
2020-10-14 16:18:43 +02:00
|
|
|
" ctrl+h switch to hardwrap
|
2020-04-29 06:33:36 +02:00
|
|
|
nnoremap <C-h> :call pandoc#formatting#UseHardWraps()
|
2020-10-14 16:18:43 +02:00
|
|
|
" ctrl+t toggle autoformat (mainly to deactivate it when necessary)
|
2020-04-29 06:33:36 +02:00
|
|
|
nnoremap <C-t> :call pandoc#formatting#ToggleAutoformat()
|
2019-08-26 07:34:45 +02:00
|
|
|
|
2019-08-27 18:56:52 +02:00
|
|
|
" autocompletion
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:deoplete#enable_at_startup=1 " start deoplete at startup
|
2019-08-27 18:56:52 +02:00
|
|
|
" Close suggestion window at completion
|
|
|
|
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif
|
|
|
|
" Use tab to sensible items in the suggestion list
|
|
|
|
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
|
|
|
|
|
|
|
|
"Code jump
|
|
|
|
" disable autocompletion, cause we use deoplete for completion
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:jedi#completions_enabled=0
|
2019-08-27 18:56:52 +02:00
|
|
|
" open the go-to function in split, not another buffer
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:jedi#use_splits_not_buffers="right"
|
2019-08-27 18:56:52 +02:00
|
|
|
|
2020-05-20 20:45:57 +02:00
|
|
|
" Python provider in a pyenv
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:python3_host_prog='/home/igor/.pyenv/versions/neovim3/bin/python'
|
2020-05-20 20:45:57 +02:00
|
|
|
|
2019-08-27 18:56:52 +02:00
|
|
|
" Python linting
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:neomake_python_enabled_makers=['flake8']
|
2019-08-27 18:56:52 +02:00
|
|
|
|
2019-09-05 17:41:10 +02:00
|
|
|
" Imports sorting
|
2020-10-14 16:18:43 +02:00
|
|
|
let g:isort_command='isort'
|
2019-09-05 17:41:10 +02:00
|
|
|
|
2019-08-27 18:56:52 +02:00
|
|
|
call neomake#configure#automake('nrwi', 500) " autolint
|
2020-05-13 21:20:53 +02:00
|
|
|
|
2020-10-25 17:37:01 +01:00
|
|
|
" Should avoid deoplete to slow down the closing process
|
|
|
|
" au TermClose * call OnTermClose()
|
|
|
|
|
2020-05-13 21:20:53 +02:00
|
|
|
" Syntax coloration and color theme
|
|
|
|
syntax enable
|
|
|
|
set background=dark
|
|
|
|
colorscheme nord
|