aboutsummaryrefslogtreecommitdiff
path: root/Common/vimrc
diff options
context:
space:
mode:
Diffstat (limited to 'Common/vimrc')
-rw-r--r--Common/vimrc84
1 files changed, 81 insertions, 3 deletions
diff --git a/Common/vimrc b/Common/vimrc
index 4769511..ae90a0b 100644
--- a/Common/vimrc
+++ b/Common/vimrc
@@ -137,12 +137,12 @@ if $COLORTERM == 'gnome-terminal'
endif
try
- colorscheme evening
+ colorscheme ron
catch
endtry
-so ~/.vim/ThemerVim.vim
-set background=dark
+"so ~/.vim/ThemerVim.vim
+"set background=dark
" Set extra options when running in GUI mode
if has("gui_running")
@@ -407,6 +407,25 @@ Plug 'bling/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tpope/vim-fugitive'
Plug 'ARM9/arm-syntax-vim'
+Plug 'airblade/vim-gitgutter'
+Plug 'junegunn/fzf'
+Plug 'junegunn/fzf.vim'
+Plug 'terryma/vim-multiple-cursors'
+Plug 'preservim/nerdcommenter'
+Plug 'neoclide/coc.nvim', {'branch': 'release'}
+Plug 'dense-analysis/ale'
+
+Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'}
+Plug 'clangd/coc-clangd', {'do': 'yarn install --frozen-lockfile'}
+Plug 'voldikss/coc-cmake', {'do': 'yarn install --frozen-lockfile'}
+Plug 'neoclide/coc-css', {'do': 'yarn install --frozen-lockfile'}
+Plug 'neoclide/coc-eslint', {'do': 'yarn install --frozen-lockfile'}
+Plug 'neoclide/coc-highlight', {'do': 'yarn install --frozen-lockfile'}
+Plug 'neoclide/coc-html', {'do': 'yarn install --frozen-lockfile'}
+Plug 'neoclide/coc-java', {'do': 'yarn install --frozen-lockfile'}
+Plug 'fannheyward/coc-pyright', {'do': 'yarn install --frozen-lockfile'}
+Plug 'josa42/coc-sh', {'do': 'yarn install --frozen-lockfile'}
+Plug 'fannheyward/coc-texlab', {'do': 'yarn install --frozen-lockfile'}
call plug#end()
" Setup AirLine
@@ -426,3 +445,62 @@ let g:airline#extensions#branch#enabled=1
" Setup NerdTree
let NERDTreeShowHidden=1
map <F3> :NERDTreeToggle<CR>
+
+" Map FuzzyFinder key to ;
+map ; :Files<CR>
+" Add fzf path for mac
+set rtp+=/usr/local/opt/fzf
+
+" Setup Coc
+" Always show the signcolumn, otherwise it would shift the text each time
+" diagnostics appear/become resolved.
+if has("patch-8.1.1564")
+ " Recently vim can merge signcolumn and number column into one
+ set signcolumn=number
+else
+ set signcolumn=yes
+endif
+" Use tab for trigger completion with characters ahead and navigate.
+" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
+" other plugin before putting this into your config.
+inoremap <silent><expr> <TAB>
+ \ pumvisible() ? "\<C-n>" :
+ \ <SID>check_back_space() ? "\<TAB>" :
+ \ coc#refresh()
+inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
+
+function! s:check_back_space() abort
+ let col = col('.') - 1
+ return !col || getline('.')[col - 1] =~# '\s'
+endfunction
+
+" GoTo code navigation.
+nmap <silent> gd <Plug>(coc-definition)
+nmap <silent> gy <Plug>(coc-type-definition)
+nmap <silent> gi <Plug>(coc-implementation)
+nmap <silent> gr <Plug>(coc-references)
+
+" Use K to show documentation in preview window.
+nnoremap <silent> K :call <SID>show_documentation()<CR>
+
+function! s:show_documentation()
+ if (index(['vim','help'], &filetype) >= 0)
+ execute 'h '.expand('<cword>')
+ elseif (coc#rpc#ready())
+ call CocActionAsync('doHover')
+ else
+ execute '!' . &keywordprg . " " . expand('<cword>')
+ endif
+endfunction
+
+
+" Highlight the symbol and its references when holding the cursor.
+autocmd CursorHold * silent call CocActionAsync('highlight')
+
+" Symbol renaming.
+nmap <leader>rn <Plug>(coc-rename)
+
+" Formatting selected code.
+xmap <leader>f <Plug>(coc-format-selected)
+nmap <leader>f <Plug>(coc-format-selected)
+