2018-09-19 14:52:29 +02:00
|
|
|
|
" Pas de compatibilité a VI !
|
|
|
|
|
set nocompatible
|
|
|
|
|
|
2018-09-19 15:28:52 +02:00
|
|
|
|
" If plug is not installed, install it
|
|
|
|
|
if empty(glob('~/.config/nvim/autoload/plug.vim'))
|
2018-09-24 17:11:26 +02:00
|
|
|
|
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
|
2018-09-19 15:28:52 +02:00
|
|
|
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
|
|
|
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
|
|
|
|
endif
|
|
|
|
|
|
2018-09-19 14:52:29 +02:00
|
|
|
|
" PLUGNIS ###########################################################{{{
|
|
|
|
|
call plug#begin()
|
|
|
|
|
if has('nvim')
|
|
|
|
|
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
|
|
|
|
else
|
|
|
|
|
Plug 'Shougo/deoplete.nvim'
|
|
|
|
|
Plug 'roxma/nvim-yarp'
|
|
|
|
|
Plug 'roxma/vim-hug-neovim-rpc'
|
|
|
|
|
endif
|
|
|
|
|
Plug 'sebastianmarkow/deoplete-rust'
|
|
|
|
|
Plug 'ElmCast/elm-vim'
|
|
|
|
|
Plug 'cespare/vim-toml'
|
|
|
|
|
Plug 'https://gitea.tforgione.fr/tforgione/peach.git'
|
|
|
|
|
Plug 'vim-airline/vim-airline'
|
|
|
|
|
Plug 'vim-airline/vim-airline-themes'
|
|
|
|
|
Plug 'scrooloose/nerdtree'
|
|
|
|
|
Plug 'w0rp/ale'
|
2018-11-19 09:50:10 +01:00
|
|
|
|
Plug 'digitaltoad/vim-pug'
|
2019-01-02 13:46:18 +01:00
|
|
|
|
Plug 'prabirshrestha/async.vim'
|
|
|
|
|
Plug 'prabirshrestha/vim-lsp'
|
|
|
|
|
Plug 'prabirshrestha/asyncomplete.vim'
|
|
|
|
|
Plug 'prabirshrestha/asyncomplete-lsp.vim'
|
|
|
|
|
|
|
|
|
|
|
2018-09-19 14:52:29 +02:00
|
|
|
|
call plug#end()
|
|
|
|
|
|
|
|
|
|
" Line numbers and syntaxic coloration
|
|
|
|
|
" set nu
|
|
|
|
|
" syntax on
|
|
|
|
|
|
|
|
|
|
" Highlight bad spaces (not working...)
|
|
|
|
|
" }}}
|
|
|
|
|
|
|
|
|
|
" INDENTATION #######################################################{{{
|
|
|
|
|
set expandtab
|
|
|
|
|
set tabstop=4
|
|
|
|
|
set shiftwidth=4
|
|
|
|
|
set autoindent
|
|
|
|
|
" }}}
|
|
|
|
|
|
|
|
|
|
" UI CONFIG #########################################################{{{
|
|
|
|
|
set number
|
|
|
|
|
set showcmd
|
|
|
|
|
set wildmenu
|
|
|
|
|
set lazyredraw
|
|
|
|
|
set encoding=utf8
|
|
|
|
|
set clipboard=unnamedplus
|
|
|
|
|
set updatecount=50
|
|
|
|
|
set mouse=a
|
|
|
|
|
" set ttymouse=sgr
|
|
|
|
|
" Espaces insécables grrrr
|
|
|
|
|
set list
|
|
|
|
|
set listchars=tab: ,trail:·,extends:>,precedes:<,nbsp:¬
|
|
|
|
|
" Remove trailing spaces
|
|
|
|
|
autocmd BufWritePre * :%s/\s\+$//e
|
2018-09-28 12:20:07 +02:00
|
|
|
|
|
2018-09-19 14:52:29 +02:00
|
|
|
|
" Compile on F12
|
2018-09-28 12:20:07 +02:00
|
|
|
|
if executable('mars')
|
|
|
|
|
nnoremap <silent><F12> :wa \| !mars<CR>
|
|
|
|
|
inoremap <silent><F12> <C-O>:wa \|!mars<CR>
|
|
|
|
|
vnoremap <silent><F12> :wa \|!mars<CR>
|
|
|
|
|
elseif executable('make')
|
|
|
|
|
nnoremap <silent><F12> :wa \| !make<CR>
|
|
|
|
|
inoremap <silent><F12> <C-O>:wa \|!make<CR>
|
|
|
|
|
vnoremap <silent><F12> :wa \|!make<CR>
|
|
|
|
|
endif
|
|
|
|
|
|
2018-09-19 14:52:29 +02:00
|
|
|
|
" Escape on F1
|
|
|
|
|
map <F1> <Esc>
|
|
|
|
|
imap <F1> <Esc>
|
|
|
|
|
" vim airline config
|
|
|
|
|
set laststatus=2
|
|
|
|
|
let g:airline_powerline_fonts = 1
|
|
|
|
|
let g:airline#extensions#branch#format = 1
|
|
|
|
|
let g:airline_theme='dark'
|
|
|
|
|
set t_Co=256
|
|
|
|
|
" Set textwidth for latex
|
|
|
|
|
" autocmd FileType tex set textwidth=79
|
|
|
|
|
" }}}
|
|
|
|
|
|
|
|
|
|
" COLOR #############################################################{{{
|
|
|
|
|
set background=dark
|
|
|
|
|
syntax enable
|
|
|
|
|
colorscheme peach
|
|
|
|
|
highlight BadWhitespace ctermbg=red guibg=red
|
|
|
|
|
match BadWhitespace / \| \+\t/
|
|
|
|
|
" }}}
|
|
|
|
|
|
|
|
|
|
" SEARCHING #########################################################{{{
|
|
|
|
|
set title
|
|
|
|
|
set showmatch
|
|
|
|
|
set hlsearch
|
|
|
|
|
set noincsearch
|
|
|
|
|
" }}}
|
|
|
|
|
|
|
|
|
|
" NERDTREE ##########################################################{{{
|
|
|
|
|
let NERDTreeIgnore = ['\.pyc$','__pycache__']
|
|
|
|
|
set shell=sh
|
|
|
|
|
let g:NERDTreeIndicatorMapCustom = {
|
|
|
|
|
\ "Modified" : "✹",
|
|
|
|
|
\ "Staged" : "✚",
|
|
|
|
|
\ "Untracked" : "✭",
|
|
|
|
|
\ "Renamed" : "➜",
|
|
|
|
|
\ "Unmerged" : "═",
|
|
|
|
|
\ "Deleted" : "✖",
|
|
|
|
|
\ "Dirty" : "✗",
|
|
|
|
|
\ "Clean" : "✔︎",
|
|
|
|
|
\ "Unknown" : "?"
|
|
|
|
|
\ }
|
|
|
|
|
let g:WebDevIconsNerdTreeGitPluginForceVAlign = 1
|
|
|
|
|
" }}}
|
|
|
|
|
|
|
|
|
|
" BACKUPS ###########################################################{{{
|
|
|
|
|
set dir=$HOME/.vim/swp//
|
|
|
|
|
autocmd BufWritePost * :silent execute ':w! ' ."$HOME/.vim/backups/" . substitute(escape(substitute(expand('%:p'), "/", "%", "g"), "%"), ' ', '\\ ', 'g')
|
|
|
|
|
|
|
|
|
|
if exists('+undofile')
|
|
|
|
|
set undofile
|
|
|
|
|
set undolevels=1000
|
|
|
|
|
set undoreload=10000
|
|
|
|
|
if exists('+undodir')
|
|
|
|
|
set undodir=$HOME/.vim/undo
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
" }}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" MARKDOWN PREVIEW ##################################################{{{
|
|
|
|
|
let g:markdown_composer_browser = 'firefox'
|
|
|
|
|
let g:instant_markdown_autostart = 0
|
|
|
|
|
" }}}
|
|
|
|
|
|
|
|
|
|
" CODE COMPLETION ###################################################{{{
|
|
|
|
|
" Use deoplete
|
|
|
|
|
let g:deoplete#enable_at_startup = 1
|
|
|
|
|
" Autoclose preview
|
|
|
|
|
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
|
|
|
|
|
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
|
|
|
|
|
" Complete on tab
|
|
|
|
|
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
|
2019-01-02 13:46:18 +01:00
|
|
|
|
|
|
|
|
|
if executable('rls')
|
|
|
|
|
au User lsp_setup call lsp#register_server({
|
|
|
|
|
\ 'name': 'rls',
|
|
|
|
|
\ 'cmd': {server_info->['rustup', 'run', 'stable', 'rls']},
|
|
|
|
|
\ 'whitelist': ['rust'],
|
|
|
|
|
\ })
|
|
|
|
|
endif
|
2018-09-19 14:52:29 +02:00
|
|
|
|
" }}}
|
|
|
|
|
|