From d15be92b25666d5f13dbdcea65c0cfc515e70fbb Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Fri, 9 Apr 2021 18:30:52 +0200 Subject: [PATCH] Neovim config --- .config/nvim/init.vim | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .config/nvim/init.vim diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..3f52948 --- /dev/null +++ b/.config/nvim/init.vim @@ -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 :bd +" Map Ctrl+N for NerdTree +map :NERDTreeToggle +inoremap pumvisible() ? "\" : "\" + +" 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 +