call plug#begin(stdpath('data') . '/plugged') Plug 'altercation/vim-colors-solarized' Plug 'itchyny/lightline.vim' Plug 'tpope/vim-obsession' Plug 'dhruvasagar/vim-prosession' Plug 'airblade/vim-gitgutter' Plug 'tpope/vim-fugitive' Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' Plug 'christoomey/vim-tmux-navigator' Plug 'tpope/vim-dispatch' Plug 'RRethy/vim-illuminate' Plug 'tpope/vim-surround' Plug 'tpope/vim-commentary' Plug 'Lenovsky/nuake' Plug 'junegunn/vim-peekaboo' Plug 'cespare/vim-toml' Plug 'vimwiki/vimwiki' Plug 'neoclide/coc.nvim', {'branch': 'release'} " typescript syntax highlighting Plug 'HerringtonDarkholme/yats.vim' Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' } Plug 'folke/which-key.nvim' Plug 'wellle/targets.vim' Plug 'lukas-reineke/indent-blankline.nvim' call plug#end() " tabwidth set tabstop=4 set shiftwidth=4 " indent with spaces set expandtab " scroll offset set scrolloff=4 " don't warp lines set nowrap " split to right/below set splitright set splitbelow " presistent undo set undofile " solarized dark theme silent! colorscheme solarized set background=dark " line numbers set number " searching set ignorecase set smartcase " preview commands set inccommand=split " reload init.vim on save augroup InitVimReload autocmd! autocmd BufWritePost init.vim source $MYVIMRC augroup END " set cursorline in active window augroup CursorLine autocmd! autocmd VimEnter,WinEnter,BufWinEnter * setlocal cursorline autocmd WinLeave * setlocal nocursorline augroup END " terminal mode options augroup terminal_mode autocmd! autocmd TermOpen * setlocal nonumber autocmd TermOpen * startinsert augroup END " map esc to exit insert mode in terminal tnoremap (&filetype == "fzf") ? "" : "" " git-gutter highlight SignColumn ctermbg=0 " lightline config let g:lightline = { 'colorscheme': 'solarized' } " prosession let g:prosession_tmux_title = 1 let g:prosession_per_branch = 1 " fzf.vim nnoremap :GFiles nnoremap :Rg nnoremap :Rg \b\b " vim-illuminate highlight illuminatedWord ctermbg=23 augroup close_preview autocmd InsertLeave * silent! pclose! augroup end " autoread/checktime timer {{{ set autoread function! CheckTime(timer) checktime endfunction let timerChecktime = timer_start(4000, 'CheckTime', {'repeat': -1}) " }}} " nuake console nnoremap :Nuake inoremap :Nuake tnoremap :Nuake " vimwiki let g:vimwiki_list = [ \ {'name': 'personal', 'path': '~/vimwiki/personal'}, \ {'name': 'swp', 'path': '~/vimwiki/swp'} \ ] let g:vimwiki_table_mappings = 0 let g:vimwiki_global_ext = 0 " indent-blankline let g:indent_blankline_char = '┊' " coc set updatetime=300 highlight CocHintSign ctermfg=10 ctermbg=0 let g:coc_global_extensions = [ \ 'coc-clangd', \ 'coc-cmake', \ 'coc-eslint', \ 'coc-html', \ 'coc-json', \ 'coc-prettier', \ 'coc-python', \ 'coc-rust-analyzer', \ 'coc-sh', \ 'coc-toml', \ 'coc-tsserver', \ 'coc-vimlsp', \ 'coc-yaml', \ ] nnoremap K :call CocAction('doHover') nmap gd (coc-definition) nmap gr (coc-references) nmap ga (coc-codeaction) nmap rn (coc-rename) " use for trigger completion and navigate to the next complete item {{{ function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~ '\s' endfunction inoremap \ pumvisible() ? "\" : \ check_back_space() ? "\" : \ coc#refresh() inoremap \ pumvisible() ? "\" : \ check_back_space() ? "\" : \ coc#refresh() " }}} " select completion items with enter inoremap pumvisible() ? "\" : "\u\"