►Developer Tools Playlist: [ Ссылка ]
►Find full courses on: [ Ссылка ]
►Join as Member to Support the channel: [ Ссылка ]
►Lesson Description: **READ Below** and watch the video for some notes.
I struggled to get something to work for a long time (without using CMake or an IDE), so I hope this will help you folks!
The main tools you'll need are Coc, ccls, and Bear to complete this lesson.
=========================== Coc =======================
Repo: [ Ссылка ]
You can follow the general directions provided in the repository. Make sure that you have version 8.1 or later for vim (test with vim --version)
I use Vim-plug ([ Ссылка ]) to install this plugin.
Then follow the guide on the CoC github for setting up your .vimrc, and then installing clangd, and also setting up the CocConfig.
=========================== ccls =======================
Here's a note on install 'ccls' tool: [ Ссылка ]
You could otherwise build it from source following: [ Ссылка ]
Here is the 'CocConfig' I used.
{
"languageserver": {
"ccls": {
"command": "ccls",
"args": ["--log-file=/tmp/ccls.log", "-v=1"],
"filetypes": ["c", "cc", "cpp", "c++", "objc", "objcpp"],
"rootPatterns": [".ccls", "compile_commands.json"],
"initializationOptions": {
"cache": {
"directory": "/tmp/ccls"
},
"client": {
"snippetSupport": true
}
}
}
},
"clangd.path": "~/.config/coc/extensions/coc-clangd-data/install/14.0.0/clangd_14.0.0/bin/clangd"
}
=========================== Bear ============================
Repository: [ Ссылка ]
It's possible you may have to update your default g++ when compiling bear to a modern version.
Here's an example of updating your g++ to a later version (First do: sudo apt-get install g++-10)
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
See this article for more: [ Ссылка ]
One other additional dependency I was missing was libssl (I already had openssl, but you'll need to the developer libraries): sudo apt-get install libssl-dev
00:00 Introduction and motivating question
00:57 Lack of a good C language intellisense in VIM
1:44 Conquer of Completion VIM plugin
2:30 Setting up our vimrc using vim plug
4:53 vimrc for Conquer of Completion (Coc tool)
6:03 diagnostics of errors
6:33 Setting up extensions for C++ (clang diagnostics)
9:42 Installing the Code completion engine for C (ccls)
10:30 language server setup (:CocConfig)
11:00 snap install for ccls
12:32 Compilation Database explanation
13:00 First attempt installing and running bear
14:50 Building 'bear' from source to get latest version
17:05 CMake with bear
20:00 Running bear to generate a compile_commands.json
21:05 Successful compilation databse
21:44 Successful intellisense
23:40 Recap of what we did
►YouTube Channel: [ Ссылка ]
►Please like and subscribe to help the channel!
►Join our free community: [ Ссылка ]
Ещё видео!