Neovim config

This commit is contained in:
Lorenzo Tucci 2021-04-09 18:30:52 +02:00
parent 87cb99d612
commit d15be92b25

62
.config/nvim/init.vim Normal file
View file

@ -0,0 +1,62 @@
" Python settings
let g:python3_host_prog = '/usr/bin/python3.9'
let g:loaded_python_provider = 0
" Vim-airline settings
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='term'
let g:airline#extensions#whitespace#enabled = 0
" Go settings
let g:deoplete#sources#go#gocode_binary = '~/.local/share/go/bin/gocode' " Path for gocode binary, check your $GOPATH folder
let g:deoplete#sources#go#sort_class = ['package', 'func', 'type', 'var', 'const'] " Completion order list
" Rust settings
let g:deoplete#sources#rust#racer_binary = '~/.cargo/bin/racer' " Path for racer binary
let g:deoplete#sources#rust#rust_source_path='~./local/share/rustsrc' " Path for rust source
set nocompatible " Required to read a vim (not vi) config correctly
set completeopt=preview " Completation mode: preview
let g:deoplete#enable_at_startup = 1 " Enable deoplete
" Default 4 tab spaces
set tabstop=4
set shiftwidth=4
set expandtab
" change it based on filetype
autocmd Filetype ruby setlocal ts=2 sw=2
autocmd Filetype slim setlocal ts=2 sw=2
"set cindent
set encoding=utf-8
set nu
set hidden
set noshowmode
" Use Ctrl+Q to close buffer
noremap <C-q> :bd<CR>
" Map Ctrl+N for NerdTree
map <C-n> :NERDTreeToggle<CR>
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
" Using Plug for plugins
call plug#begin('~/.vim/plugged')
Plug 'preservim/nerdtree' " NerdTree for browsing directories
Plug 'Shougo/deoplete.nvim' " Deoplete for auto completation
Plug 'ctrlpvim/ctrlp.vim' " File finder
Plug 'vim-airline/vim-airline-themes' " Status/tabline for vim
Plug 'vim-airline/vim-airline'
Plug 'deoplete-plugins/deoplete-jedi' " Deoplete Python completion
" Deoplete Go completion
" gocode is needed: go get -u github.com/stamblerre/gocode
Plug 'deoplete-plugins/deoplete-go', { 'do': 'make'}
" Deoplete Rust completion
" racer is needed: cargo install racer (you might need nightly rust)
Plug 'sebastianmarkow/deoplete-rust'
call plug#end()
filetype plugin indent on
syntax enable