介绍
本文章讲述了如何用coc.nvim来安装coc-clang插件,和如何安装前置要求(clangd, npm, nodejs),并配置.vimrc文件和clangd路径来让vim可以autofill cpp
目录
1. 配置 .vimrc 文件
在home中创建.vimrc文件(如果没有的话)
$ vim ~/.vimrc
在.vimrc中插入以下配置(对于已经有自己配置的,可以只插入call plugin 到 end来放入coc.nvim 插件)
1 set nu
2 " Set compatibilty to vim only
3 set nocompatible
4 " Auto text wrapping
5 set wrap
6 " Encoding
7 set encoding=utf-8
8 " Status bar
9 set laststatus=2
10 " Intent width
11 set shiftwidth=2
12 syntax on
13 filetype plugin indent on
14
15 set tabstop=2
16 set expandtab
17 set softtabstop=2
18 set autoindent
19 set smartindent
20
21 call plug#begin()
22
23 Plug 'neoclide/coc.nvim', {'branch':'release&#