Skip to content

Commit 439c48a

Browse files
committed
Support coc for C/C++, Python.
1 parent 2fcecc5 commit 439c48a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

README.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can use it to set the tools below
99
2. Change the shell: `chsh -s /bin/zsh`.
1010
3. Logout and then login
1111
4. We use [vim-plug](https://github.com/junegunn/vim-plug) to manage plugins here. Use `:PlugInstall` in vim to install packages.
12-
5. Install coc in vim: `:CocInstall coc-rust-analyzer` in vim
12+
5. Install coc plugin in vim: `:CocInstall coc-rust-analyzer` and `CocInstall coc-pyright` in vim
1313
- If there is coc error while opening vim, it might be node version issue. Please use nvm to update node.
1414

1515
# vim
@@ -32,7 +32,3 @@ git clone https://github.com/longld/peda.git ~/peda
3232
echo "source ~/peda/peda.py" >> ~/.gdbinit
3333
```
3434

35-
# TODO
36-
37-
* Add C++ / Python coc
38-

coc-settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
}
1111
}
1212
}
13-
}
13+
},
14+
"diagnostic.displayByAle": true
1415
}

vimrc

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
" Author: evshary
1515
1616
" Updated:
17+
" 2022.12.28 Able to use coc for Rust, C/C++, and Python
1718
" 2022-12-12 Add some cheatsheet for vim
1819
" 2022-09-06 Add fzf plugin
1920
" 2019-09-28 Use vim-plug to replace NeoBundle and organize the order
@@ -258,6 +259,10 @@ nmap <silent> gr <Plug>(coc-references)
258259
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
259260
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
260261
262+
" disable ALE and only show from coc
263+
" https://github.com/dense-analysis/ale#5iii-how-can-i-use-ale-and-cocnvim-together
264+
let g:ale_disable_lsp = 1
265+
261266
" vim-plug
262267
call plug#begin('~/.vim/plugged')
263268
" -------------my plugin----------------

0 commit comments

Comments
 (0)