dotfiles/vim/vimrc

121 lines
2.6 KiB
VimL

if filereadable("~/.vimrc.local")
source ~/.vimrc.local
endif
packadd! termdebug
" vim-plug installer
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" vim-plug plugins
call plug#begin('~/.vim/vim-plug')
" deoplete
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
" LanguageClient-neovim
Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh', }
Plug 'Shougo/vimproc.vim', {'do' : 'make'}
Plug 'rhysd/vim-clang-format'
Plug 'derekwyatt/vim-fswitch'
Plug 'itchyny/lightline.vim'
Plug 'ambv/black'
Plug 'altercation/vim-colors-solarized'
Plug 'craigemery/vim-autotag'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'linuor/ucmake.vim'
Plug 'skywind3000/asyncrun.vim'
Plug 'markonm/traces.vim'
Plug 'christoomey/vim-tmux-navigator'
call plug#end()
" tabwidth
set tabstop=4
set shiftwidth=4
" dark theme
set background=dark
" line numbers
set number
" always enable status line
set laststatus=2
" faster saving
set nofsync
" autoread/checktime timer
set autoread
function CheckTime(timer)
checktime
endfunction
let timerChecktime = timer_start(4000, 'CheckTime', {'repeat': -1})
" ctags config
set tags=./tags;
nnoremap <F2> <C-]>
" clang-format
let g:clang_format#auto_format = 1
let g:clang_format#enable_fallback_style = 0
" autotag
let g:autotagmaxTagsFileSize = 1024 * 1024 * 128
" deoplete
let g:deoplete#enable_at_startup = 1
autocmd CompleteDone * silent! pclose!
call deoplete#custom#source('_', 'matchers', ['matcher_full_fuzzy'])
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" LanguageClient-neovim
set hidden
nnoremap <F5> :call LanguageClient_contextMenu()<CR>
nnoremap <F12> :call LanguageClient#textDocument_definition()<CR>
let g:LanguageClient_serverCommands = {
\ 'python': ['pyls'],
\ 'cpp': ['clangd'],
\ }
" lightline config
let g:lightline = { 'colorscheme': 'solarized' }
" Black config
autocmd BufWritePre *.py execute ':Black'
" vim-fswitch
nmap <ESC>o :FSHere<CR>
" vim-colors-solarized
colorscheme solarized
" fzf.vim
nmap <C-P> :Files<CR>
nmap <C-F> :Rg<CR>
nmap <ESC><C-P> :Tags<CR>
" terminal colors
hi Terminal ctermfg=fg ctermbg=NONE guifg=fg guibg=NONE guisp=NONE cterm=NONE gui=NONE
" incremental searching
set incsearch
set hlsearch
" asynrun.vim
let g:asyncrun_open = 16