From b1a73fb2ba06a95f895bbf834a7354a8882a5d5d Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Thu, 28 Jan 2021 11:06:03 +0100 Subject: vim changes --- .gitignore | 2 + Common/tex/latex/misc/StdObligH2020.cls | 1 - Common/vim/plugged/ctrlp.vim | 2 +- Common/vim/plugged/nerdTree | 2 +- Common/vim/plugged/vim-airline | 2 +- Common/vim/plugged/vim-airline-themes | 2 +- Common/vim/plugged/vim-fugitive | 2 +- Common/vim/vim | 2 +- Common/vimrc | 84 +++++++++++++++++++++++++++++++-- 9 files changed, 89 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 5c502ac..91749a8 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,5 @@ $RECYCLE.BIN/ # End of https://www.gitignore.io/api/linux,macos,windows node_modules +/Common/vim/plugged/* +/Common/vim/autoload/* diff --git a/Common/tex/latex/misc/StdObligH2020.cls b/Common/tex/latex/misc/StdObligH2020.cls index b764361..e246be1 100644 --- a/Common/tex/latex/misc/StdObligH2020.cls +++ b/Common/tex/latex/misc/StdObligH2020.cls @@ -26,7 +26,6 @@ \usepackage{float} \usepackage{multicol} \usepackage{colortbl} -\usepackage{xcolor} \usepackage{svg} \usepackage{tabularx} \usepackage{listofitems} diff --git a/Common/vim/plugged/ctrlp.vim b/Common/vim/plugged/ctrlp.vim index 971c4d4..44c8e24 160000 --- a/Common/vim/plugged/ctrlp.vim +++ b/Common/vim/plugged/ctrlp.vim @@ -1 +1 @@ -Subproject commit 971c4d41880b72dbbf1620b3ad91418a6a6f6b9c +Subproject commit 44c8e24956d7dcfee3ee6083a0573fed31d136ed diff --git a/Common/vim/plugged/nerdTree b/Common/vim/plugged/nerdTree index aaa946f..82b1649 160000 --- a/Common/vim/plugged/nerdTree +++ b/Common/vim/plugged/nerdTree @@ -1 +1 @@ -Subproject commit aaa946fb6bd79b9af86fbaf4b6b63fd81d839bd9 +Subproject commit 82b1649f2e1c79ff17730fe0a3750bbec203dd29 diff --git a/Common/vim/plugged/vim-airline b/Common/vim/plugged/vim-airline index c7a633c..ce932f3 160000 --- a/Common/vim/plugged/vim-airline +++ b/Common/vim/plugged/vim-airline @@ -1 +1 @@ -Subproject commit c7a633ce8f4547e680377efe8ea70493fcce1349 +Subproject commit ce932f3825f59258f814d4b66174283875348a95 diff --git a/Common/vim/plugged/vim-airline-themes b/Common/vim/plugged/vim-airline-themes index 8f1aa2c..f4ba787 160000 --- a/Common/vim/plugged/vim-airline-themes +++ b/Common/vim/plugged/vim-airline-themes @@ -1 +1 @@ -Subproject commit 8f1aa2c7fa44bf33b1fd4678f9c7b40c126b0e2b +Subproject commit f4ba787e9c5455a6a88c6d04e61b189826375763 diff --git a/Common/vim/plugged/vim-fugitive b/Common/vim/plugged/vim-fugitive index bebe504..67efbf6 160000 --- a/Common/vim/plugged/vim-fugitive +++ b/Common/vim/plugged/vim-fugitive @@ -1 +1 @@ -Subproject commit bebe504e38d0a20c30d6dd666c4c793b3cc66104 +Subproject commit 67efbf66e0fcfd25e617d22892a7e9768bfd0f92 diff --git a/Common/vim/vim b/Common/vim/vim index 1353f12..f81b69e 120000 --- a/Common/vim/vim +++ b/Common/vim/vim @@ -1 +1 @@ -/home/jakob/_code/dotfiles/Common/vim \ No newline at end of file +/Users/jakobstendahl/_code/Personal projects/dotfiles/Common/vim \ No newline at end of file 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