From b1a73fb2ba06a95f895bbf834a7354a8882a5d5d Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Thu, 28 Jan 2021 11:06:03 +0100 Subject: vim changes --- Common/vimrc | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 81 insertions(+), 3 deletions(-) (limited to 'Common/vimrc') 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 :NERDTreeToggle + +" Map FuzzyFinder key to ; +map ; :Files +" 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 ' to make sure tab is not mapped by +" other plugin before putting this into your config. +inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ coc#refresh() +inoremap pumvisible() ? "\" : "\" + +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +" GoTo code navigation. +nmap gd (coc-definition) +nmap gy (coc-type-definition) +nmap gi (coc-implementation) +nmap gr (coc-references) + +" Use K to show documentation in preview window. +nnoremap K :call show_documentation() + +function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + elseif (coc#rpc#ready()) + call CocActionAsync('doHover') + else + execute '!' . &keywordprg . " " . expand('') + endif +endfunction + + +" Highlight the symbol and its references when holding the cursor. +autocmd CursorHold * silent call CocActionAsync('highlight') + +" Symbol renaming. +nmap rn (coc-rename) + +" Formatting selected code. +xmap f (coc-format-selected) +nmap f (coc-format-selected) + -- cgit v1.2.3