Browse Source

new nvim config based on Plug, ale et jedi

master
Jonathan Tremesaygues 4 months ago
parent
commit
c3a3bc30af
1 changed files with 51 additions and 89 deletions
  1. +51
    -89
      dot_config/nvim/init.vim

+ 51
- 89
dot_config/nvim/init.vim View File

@ -3,52 +3,27 @@ if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=/home/killruana/.local/share/dein/repos/github.com/Shougo/dein.vim
" Required:
if dein#load_state('/home/killruana/.local/share/dein')
call dein#begin('/home/killruana/.local/share/dein')
" Let dein manage dein
" Required:
call dein#add('/home/killruana/.local/share/dein/repos/github.com/Shougo/dein.vim')
" Add or remove your plugins here like this:
"call dein#add('autozimu/LanguageClient-neovim', {
" \ 'rev': 'next',
" \ 'build': 'bash install.sh',
" \ })
call dein#add('chriskempson/base16-vim')
"call dein#add('deoplete-plugins/deoplete-jedi')
" call dein#add('majutsushi/tagbar')
call dein#add('preservim/nerdtree')
" call dein#add('Shougo/deol.nvim')
"call dein#add('Shougo/deoplete.nvim')
" call dein#add('Shougo/neoinclude.vim')
" call dein#add('Shougo/neosnippet.vim')
" call dein#add('Shougo/neosnippet-snippets')
"call dein#add('rust-lang/rust.vim')
" call dein#add('tbodt/deoplete-tabnine', { 'build': './install.sh' })
call dein#add('vim-airline/vim-airline')
call dein#add('vim-airline/vim-airline-themes')
call dein#add('vim-syntastic/syntastic')
" Required:
call dein#end()
call dein#save_state()
endif
" Required:
filetype plugin indent on
syntax enable
" If you want to install not installed plugins on startup.
if dein#check_install()
call dein#install()
endif
"End dein Scripts-------------------------
" Load the vim-plug package manager
" INstall with
" sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
call plug#begin(stdpath('data') . '/plugged')
Plug 'dense-analysis/ale'
Plug 'chriskempson/base16-vim'
Plug 'psf/black', { 'branch': 'stable' }
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'davidhalter/jedi-vim'
Plug 'preservim/nerdtree'
Plug 'python-rope/ropevim'
Plug 'preservim/tagbar'
Plug 'rust-lang/rust.vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'ludovicchabant/vim-gutentags'
" Initialize plugin system
call plug#end()
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Global settings
@ -57,39 +32,45 @@ endif
autocmd FileType make set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab
" For everything else, use a tab width of 4 space chars.
set tabstop=4 " The width of a TAB is set to 4.
" Still it is a \t. It is just that
" Vim will interpret it to be having
" a width of 4.
set shiftwidth=4 " Indents will have a width of 4.
set softtabstop=4 " Sets the number of columns for a TAB.
set expandtab " Expand TABs to spaces.
set tabstop=4 " The width of a TAB is set to 4.
" Still it is a \t. It is just that
" Vim will interpret it to be having
" a width of 4.
set shiftwidth=4 " Indents will have a width of 4.
set softtabstop=4 " Sets the number of columns for a TAB.
set expandtab " Expand TABs to spaces.
set mouse=a " Enable mouse stroll
set number " Enable line numbering
set colorcolumn=80 " Add a ruler
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Ale
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'python': ['black']
\}
let g:ale_linters = {'python': ['flake8']}
let g:ale_fix_on_save = 1
let g:ale_python_black_options = "-l79"
set mouse=a " Enable mouse stroll
set number " Enable line numbering
set colorcolumn=80 " Add a ruler
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Base 16
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set background = "dark"
colorscheme base16-monokai
let base16colorspace=256 " Access colors present in 256 colorspace
let base16colorspace = 256 " Access colors present in 256 colorspace
set termguicolors
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Deoplete
" Black
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"let g:deoplete#enable_at_startup = 1
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" LanguageClient
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set hidden " Required for operations modifying multiple buffers like rename.
let g:LanguageClient_serverCommands = {
\ 'rust': ['/usr/bin/rls'],
\ }
let g:black_linelength = 79
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" NERDtree
@ -97,38 +78,19 @@ let g:LanguageClient_serverCommands = {
"autocmd vimenter * NERDTree
map <C-n> :NERDTreeToggle<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Neosnippet
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:neosnippet#enable_complete_done = 1
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Rust.vim
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:rustfmt_autosave = 1
autocmd BufRead,BufNewFile Cargo.toml,Cargo.lock,*.rs compiler cargo
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Syntastic settings
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
"let g:syntastic_always_populate_loc_list = 1
"let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Tagbar settings
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" nmap <F8> :TagbarToggle<CR>
nmap <F8> :TagbarToggle<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim Airline
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:airline_theme='base16_monokai'
let g:airline#extensions#ale#enabled = 1

Loading…
Cancel
Save