|
|
|
@ -1,25 +1,57 @@ |
|
|
|
|
call plug#begin('~/.local/share/nvim/plugged') |
|
|
|
|
|
|
|
|
|
" general dev tools |
|
|
|
|
Plug 'w0rp/ale' |
|
|
|
|
|
|
|
|
|
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } |
|
|
|
|
Plug 'junegunn/fzf.vim' |
|
|
|
|
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } |
|
|
|
|
Plug 'LnL7/vim-nix' |
|
|
|
|
|
|
|
|
|
Plug 'morhetz/gruvbox' |
|
|
|
|
|
|
|
|
|
" go tools |
|
|
|
|
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } |
|
|
|
|
|
|
|
|
|
Plug 'hdima/python-syntax' |
|
|
|
|
|
|
|
|
|
" rust tools |
|
|
|
|
Plug 'rust-lang/rust.vim' |
|
|
|
|
" Plug 'racer-rust/vim-racer' |
|
|
|
|
|
|
|
|
|
" reason/bucklescript |
|
|
|
|
Plug 'reasonml-editor/vim-reason-plus' |
|
|
|
|
|
|
|
|
|
" git |
|
|
|
|
Plug 'mhinz/vim-signify' |
|
|
|
|
Plug 'tpope/vim-fugitive' |
|
|
|
|
|
|
|
|
|
" beautify |
|
|
|
|
Plug 'morhetz/gruvbox' |
|
|
|
|
Plug 'vim-airline/vim-airline' |
|
|
|
|
Plug 'liuchengxu/space-vim-theme' |
|
|
|
|
|
|
|
|
|
call plug#end() |
|
|
|
|
" python tools |
|
|
|
|
" Plug 'deoplete-plugins/deoplete-jedi' |
|
|
|
|
" Plug 'davidhalter/jedi-vim' |
|
|
|
|
" Plug 'hdima/python-syntax' |
|
|
|
|
Plug 'vim-python/python-syntax' |
|
|
|
|
|
|
|
|
|
" elm tools |
|
|
|
|
Plug 'andys8/vim-elm-syntax' |
|
|
|
|
|
|
|
|
|
" Javascript |
|
|
|
|
Plug 'yuezk/vim-js' |
|
|
|
|
Plug 'maxmellon/vim-jsx-pretty' |
|
|
|
|
|
|
|
|
|
" lisps |
|
|
|
|
Plug 'wlangstroth/vim-racket' |
|
|
|
|
Plug 'junegunn/rainbow_parentheses.vim' |
|
|
|
|
|
|
|
|
|
" notes and organization |
|
|
|
|
Plug 'vimwiki/vimwiki' |
|
|
|
|
|
|
|
|
|
Plug 'autozimu/LanguageClient-neovim', { |
|
|
|
|
\ 'branch': 'next', |
|
|
|
|
\ 'do': 'bash install.sh', |
|
|
|
|
\ } |
|
|
|
|
|
|
|
|
|
call plug#end() |
|
|
|
|
|
|
|
|
|
set nocompatible |
|
|
|
|
set encoding=utf-8 |
|
|
|
@ -36,10 +68,8 @@ if has("termguicolors") |
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
set background=dark |
|
|
|
|
"colorscheme molokai "gruvbox zenburn |
|
|
|
|
" colorscheme material-monokai |
|
|
|
|
"let g:molokai_original = 1 |
|
|
|
|
colorscheme gruvbox |
|
|
|
|
" colorscheme gruvbox |
|
|
|
|
colorscheme space_vim_theme |
|
|
|
|
|
|
|
|
|
"always show status bar |
|
|
|
|
set laststatus=2 |
|
|
|
@ -52,8 +82,9 @@ filetype plugin indent on |
|
|
|
|
"indent and tab |
|
|
|
|
set nowrap |
|
|
|
|
set expandtab |
|
|
|
|
set tabstop=4 shiftwidth=4 softtabstop=4 |
|
|
|
|
set backspace=indent,eol,start |
|
|
|
|
set tabstop=4 shiftwidth=4 softtabstop=4 |
|
|
|
|
autocmd FileType javascript setlocal shiftwidth=2 softtabstop=2 |
|
|
|
|
|
|
|
|
|
"turn paste mode on and off with F3 |
|
|
|
|
set pastetoggle=<F3> |
|
|
|
@ -68,10 +99,6 @@ set smartcase |
|
|
|
|
set wildmenu |
|
|
|
|
set wildmode=longest:full,full |
|
|
|
|
|
|
|
|
|
"configure code folding bindings |
|
|
|
|
nnoremap <space> za |
|
|
|
|
vnoremap <space> zf |
|
|
|
|
|
|
|
|
|
"Better split navigation |
|
|
|
|
nnoremap <C-J> <C-W><C-J> |
|
|
|
|
nnoremap <C-K> <C-W><C-K> |
|
|
|
@ -85,56 +112,58 @@ set splitright |
|
|
|
|
if executable('rg') |
|
|
|
|
let g:ctrlp_user_command = 'rg --files %s' |
|
|
|
|
set grepprg=rg\ --no-heading\ --vimgrep\ --smart-case |
|
|
|
|
elseif executable('ag') |
|
|
|
|
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' |
|
|
|
|
set grepprg=ag\ --nogroup\ --nocolor |
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
" vim-signify |
|
|
|
|
let g:signify_vcs_list = [ 'git', 'hg' ] |
|
|
|
|
let g:signify_sign_change = "~" |
|
|
|
|
|
|
|
|
|
" clojureee |
|
|
|
|
au FileType clojure RainbowParentheses |
|
|
|
|
|
|
|
|
|
"Go specific settings |
|
|
|
|
set rtp+=$GOROOT/misc/vim |
|
|
|
|
au BufRead,BufNewFile *.go set list noexpandtab syntax=go listchars=tab:\|\ ,trail:- |
|
|
|
|
autocmd FileType go map <buffer> <c-d> :GoDoc<CR> |
|
|
|
|
|
|
|
|
|
" FZF |
|
|
|
|
set rtp+=$HOME/.fzf |
|
|
|
|
command! -bang -nargs=* RgFzf |
|
|
|
|
\ call fzf#run(fzf#wrap('rgfzf', {'source': "rg --files"}, <bang>0)) |
|
|
|
|
" nmap <c-p> :Files<CR> |
|
|
|
|
nmap <c-p> :RgFzf<CR> |
|
|
|
|
nnoremap <C-g>b :Buffers<CR> |
|
|
|
|
nnoremap <C-g>g :Rg<CR> |
|
|
|
|
nnoremap <C-g>l :BLines<CR> |
|
|
|
|
nnoremap <C-g>c :Commands<CR> |
|
|
|
|
|
|
|
|
|
" use ripgrep instead of ag/grep |
|
|
|
|
command! -bang -nargs=* Rg |
|
|
|
|
\ call fzf#vim#grep( |
|
|
|
|
\ 'rg --column --line-number --no-heading --color=always '.shellescape(<q-args>), 1, |
|
|
|
|
\ <bang>0 ? fzf#vim#with_preview('up:60%') |
|
|
|
|
\ : fzf#vim#with_preview('right:50%:hidden', '?'), |
|
|
|
|
\ <bang>0) |
|
|
|
|
|
|
|
|
|
function! InsertTabWrapper() |
|
|
|
|
|
|
|
|
|
" YAML |
|
|
|
|
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab |
|
|
|
|
|
|
|
|
|
function! CleverTab() |
|
|
|
|
if pumvisible() |
|
|
|
|
return "\<c-n>" |
|
|
|
|
return "\<C-N>" |
|
|
|
|
endif |
|
|
|
|
let col = col('.') - 1 |
|
|
|
|
if !col || getline('.')[col - 1] !~ '\k' |
|
|
|
|
return "\<tab>" |
|
|
|
|
if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$' |
|
|
|
|
return "\<Tab>" |
|
|
|
|
elseif exists('&omnifunc') && &omnifunc != '' |
|
|
|
|
return "\<C-X>\<C-O>" |
|
|
|
|
else |
|
|
|
|
return "\<c-x>\<c-o>" |
|
|
|
|
return "\<C-N>" |
|
|
|
|
endif |
|
|
|
|
endfunction |
|
|
|
|
inoremap <expr><tab> InsertTabWrapper() |
|
|
|
|
inoremap <expr><s-tab> pumvisible()?"\<c-p>":"\<c-d>" |
|
|
|
|
|
|
|
|
|
inoremap <Tab> <C-R>=CleverTab()<CR> |
|
|
|
|
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" |
|
|
|
|
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>" |
|
|
|
|
|
|
|
|
|
" inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" |
|
|
|
|
" inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" |
|
|
|
|
" inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>" |
|
|
|
|
|
|
|
|
|
let g:ale_fixers = { |
|
|
|
|
\ 'javascript': ['prettier', 'eslint'], |
|
|
|
|
\ 'python': ['black'], |
|
|
|
|
\ } |
|
|
|
|
|
|
|
|
|
let g:LanguageClient_serverCommands = { |
|
|
|
|
\ 'rust': ['rust-analyzer'], |
|
|
|
|
\ 'python': ['/usr/local/bin/pyls'], |
|
|
|
|
\ 'reason': ['/home/mike/bin/reason-language-server'], |
|
|
|
|
\ 'javascript': ['/usr/bin/javascript-typescript-stdio'], |
|
|
|
|
\ } |
|
|
|
|
|
|
|
|
|
let g:python_highlight_all = 1 |
|
|
|
|
|
|
|
|
|
let g:go_fmt_command = "goimports" |
|
|
|
|
let g:syntastic_go_checkers = ['go', 'goimports', 'govet', 'golint'] |
|
|
|
|
let g:go_doc_popup_window = 1 |
|
|
|
|
|
|
|
|
|
let g:go_highlight_functions = 1 |
|
|
|
|
let g:go_highlight_function_calls = 1 |
|
|
|
@ -150,26 +179,11 @@ let g:go_highlight_build_constraints = 1 |
|
|
|
|
" disable vim-jedi autocomplete as we get it with deoplete-jedi |
|
|
|
|
" but we want all the other functionality |
|
|
|
|
let g:jedi#completions_enabled = 0 |
|
|
|
|
let g:jedi#use_splits_not_buffers = 'winwidth' |
|
|
|
|
" let g:jedi#use_splits_not_buffers = 'winwidth' |
|
|
|
|
|
|
|
|
|
" deoplete configuration |
|
|
|
|
let g:deoplete#enable_at_startup = 1 |
|
|
|
|
|
|
|
|
|
" deoplete Go |
|
|
|
|
let g:deoplete#sources#go#sort_class = ['package', 'func', 'type', 'var', 'const'] |
|
|
|
|
let g:deoplete#sources#go#gocode_binary = '/home/cugini/go/bin/gocode' |
|
|
|
|
let g:deoplete#sources#go#use_cache = 1 |
|
|
|
|
let g:deoplete#sources#go#json_directory = '~/.cache/deoplete/go/$GOOS_$GOARCH' |
|
|
|
|
|
|
|
|
|
" deoplete Rust |
|
|
|
|
let g:deoplete#sources#rust#racer_binary = '/home/cugini/.cargo/bin/racer' |
|
|
|
|
let g:deoplete#sources#rust#rust_source_path = '/home/cugini/Projects/rust/src' |
|
|
|
|
|
|
|
|
|
"configure tagbar |
|
|
|
|
nmap <F8> :TagbarToggle<CR> |
|
|
|
|
let g:tagbar_width = 60 |
|
|
|
|
let g:tagbar_sort = 0 |
|
|
|
|
|
|
|
|
|
if filereadable(expand("~/.vim/local.vim")) |
|
|
|
|
source ~/.vim/local.vim |
|
|
|
|
endif |
|
|
|
|