Skip to content

Commit 2c10b31

Browse files
committedSep 19, 2022
Fixed errors if use vim configuration without plugins
1 parent 88d1b05 commit 2c10b31

File tree

4 files changed

+27
-17
lines changed

4 files changed

+27
-17
lines changed
 

‎.bashrc.global

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ alias whatsapp='google-chrome --app=https://web.whatsapp.com/' #'/opt/google/chr
8585
# Setup environment {{{ #
8686
LOCAL_BIN=${HOME}/.bin/
8787
mkdir -p $LOCAL_BIN
88+
export PATH=/opt/homebrew/bin/:$PATH
8889
export PATH=$LOCAL_BIN:$PATH
8990
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
9091

‎.vim/configs/common/statusline.vimrc

+3
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ function! ReadOnly()
166166
endfunction
167167

168168
function! GitInfo()
169+
if !exists('g:loaded_fugitive')
170+
return ''
171+
endif
169172
let git = FugitiveHead()
170173
if git != ''
171174
if g:isWindows

‎.vim/configs/plugins/lsp.vimrc

+19-17
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,25 @@ let g:coc_global_extensions = [
1212
\ 'coc-yank',
1313
\]
1414

15-
" Highlight symbol under cursor on CursorHold
16-
autocmd CursorHold * silent call CocActionAsync('highlight')
15+
if exists('g:did_coc_loaded')
16+
" Highlight symbol under cursor on CursorHold
17+
autocmd CursorHold * silent call CocActionAsync('highlight')
1718

18-
" Use K to show documentation in preview window.
19-
nnoremap <silent> K :call <SID>show_documentation()<CR>
19+
" Use K to show documentation in preview window.
20+
nnoremap <silent> K :call <SID>show_documentation()<CR>
2021
21-
function! s:show_documentation()
22-
if (index(['vim','help'], &filetype) >= 0)
23-
execute 'h '.expand('<cword>')
24-
elseif (coc#rpc#ready())
25-
call CocActionAsync('doHover')
26-
else
27-
execute '!' . &keywordprg . " " . expand('<cword>')
28-
endif
29-
endfunction
22+
function! s:show_documentation()
23+
if (index(['vim','help'], &filetype) >= 0)
24+
execute 'h '.expand('<cword>')
25+
elseif (coc#rpc#ready())
26+
call CocActionAsync('doHover')
27+
else
28+
execute '!' . &keywordprg . " " . expand('<cword>')
29+
endif
30+
endfunction
3031

31-
" Use `:Format` for format current buffer
32-
command! -nargs=0 Format :call CocAction('format')
33-
" Use `:Fold` for fold current buffer
34-
command! -nargs=? Fold :call CocAction('fold', <f-args>)
32+
" Use `:Format` for format current buffer
33+
command! -nargs=0 Format :call CocAction('format')
34+
" Use `:Fold` for fold current buffer
35+
command! -nargs=? Fold :call CocAction('fold', <f-args>)
36+
endif

‎README.md

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ I use riprep for search, it is really nice! For more information see [here](http
3131

3232
The next nice tool that I use is [FZF](https://github.com/junegunn/fzf). It helped me to use fuzzy finder in the terminal.
3333

34+
### Install cmake-language-server
35+
36+
For cmake lsp I use [cmake-language-server](https://github.com/regen100/cmake-language-server).
37+
3438

3539
## Mac Installation
3640

0 commit comments

Comments
 (0)
Please sign in to comment.