update nvim conf, dir management
This commit is contained in:
parent
fa19322a73
commit
e1f0e1845f
2 changed files with 83 additions and 62 deletions
62
neovim.conf
62
neovim.conf
|
@ -1,62 +0,0 @@
|
||||||
" 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
|
|
||||||
|
|
83
neovim/nvim-conf.vim
Normal file
83
neovim/nvim-conf.vim
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
set nocompatible " Required to read a vim (not vi) config correctly
|
||||||
|
set completeopt=preview " Completation mode: preview
|
||||||
|
|
||||||
|
" 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
|
||||||
|
|
||||||
|
" Python settings
|
||||||
|
let g:python3_host_prog = '/usr/bin/python3.9'
|
||||||
|
let g:loaded_python_provider = 0
|
||||||
|
|
||||||
|
|
||||||
|
" 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
|
||||||
|
" Disabling backups and swap files (cause problem in servers, messy dirs etc.)
|
||||||
|
" You might want to comment this if you are on an unstable system
|
||||||
|
set nobackup
|
||||||
|
set nowritebackup
|
||||||
|
set noswapfile
|
||||||
|
|
||||||
|
" 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>"
|
||||||
|
" Map ; to search files (fd)
|
||||||
|
map ; :Files<CR>
|
||||||
|
" Map , to match in files (ripgrep)
|
||||||
|
map ' :Rg<CR>
|
||||||
|
" Map /ln to disable highlighting
|
||||||
|
nmap <leader>ln :noh<CR>
|
||||||
|
" Windows splitting and movement (move windows with hjkl keys)
|
||||||
|
function! WinMove(key)
|
||||||
|
let t:curwin = winnr()
|
||||||
|
exec "wincmd ".a:key
|
||||||
|
if (t:curwin == winnr())
|
||||||
|
if (match(a:key,'[jk]'))
|
||||||
|
wincmd v
|
||||||
|
else
|
||||||
|
wincmd s
|
||||||
|
endif
|
||||||
|
exec "wincmd ".a:key
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
nnoremap <silent> <C-h> :call WinMove('h')<CR>
|
||||||
|
nnoremap <silent> <C-j> :call WinMove('j')<CR>
|
||||||
|
nnoremap <silent> <C-k> :call WinMove('k')<CR>
|
||||||
|
nnoremap <silent> <C-l> :call WinMove('l')<CR>
|
||||||
|
|
||||||
|
|
||||||
|
" Using Plug for plugins
|
||||||
|
call plug#begin('~/.vim/plugged')
|
||||||
|
|
||||||
|
Plug 'preservim/nerdtree' " NerdTree for browsing directories
|
||||||
|
Plug 'neoclide/coc.nvim', { 'branch': 'release' } " CoC for completion, works similar to VSCode
|
||||||
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " Fuzzy finder
|
||||||
|
Plug 'junegunn/fzf.vim'
|
||||||
|
Plug 'vim-airline/vim-airline' " Status/tabline for vim
|
||||||
|
Plug 'vim-airline/vim-airline-themes'
|
||||||
|
Plug 'jiangmiao/auto-pairs' " Brackets management plugins
|
||||||
|
Plug 'machakann/vim-sandwich'
|
||||||
|
Plug 'airblade/vim-gitgutter' " Git plugin
|
||||||
|
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
|
||||||
|
filetype plugin indent on
|
||||||
|
syntax enable
|
||||||
|
|
Loading…
Reference in a new issue