Deploy once,Code anywhere!
几乎任何浏览器都可以直接得到与VScode相近的编码体验。
安装
按照官方文档安装:Install - code-server Docs (coder.com)
配置
开启 https
下载 SSL 证书,解压到一个地方
在 .config/code-server/config.yaml
中加入:
cert: /path/to/*.crt |
使用systemd
重启服务即可
修改字体
目前最新版
code-server
不能用,实测 v4.7.1 可以
目前只能通过加入web-font的方式修改:
git clone https://github.com/tuanpham-dev/code-server-font-patch.git |
You may need to set font family in code-server settings:
"editor.fontFamily": "'Fira Code', Consolas, 'Courier New', monospace", |
Install Packages
Package | Function |
---|---|
clang | Compile |
clangd | Language support |
clang-format | Format the code |
lldb | Debug |
cmake | Quick configure project |
Install Plugins
Search the plugins, CodeLLDB
and clangd
.
Config the CMake and Clangd
Using plugin cmake tool
Open a WSL2 distro and get into a folder, input code .
and press enter
.
Vscode will be started. There is empty in the folder.
Press ctrl+shift+p
and input cmake: quick start
, select the CMake: Quick Start
.
Choice the clang
variant.
Input the name of you project.
A hello world
program will be auto-created.
Now, you can build
and run
your project.
Using little tool pm
个人开发的极不成熟的小工具,用以快速管理小型c++工程。
请查看Project Manager。
Config debug
Add a launch.json
in the workfolder
, and add configuration lldb
.
Modify the program.
{ |
MultiFolders
Add the include_directories(./Sources)
to CMakeLists.txt
.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) |
or cd ${PROJ_DIR}/build
then run command cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1
in terminal.
Clang-format
编辑 .clang-format
文件
IndentWidth: 4 |
Setting.json (personal backup)
这是我个人的设置备份,请不要直接复制使用,最好查明每一项作用再使用。
{ |
Termux
{ |
Issues
Font size in console of Script run (vscode plugin)
Add to stylesheet:
.script-view .line { |
CMake tools 在插件商店找不到
Ctrl+p
输入命令:
ext install ms-vscode.cmake-tools |
Codelldb配置
插件安装遇到问题,如下载失败,请看VS code 安装插件 lldb 调试 CPP 程序。
Install codelldb and create a launch.json
:
{ |
- If breakpoint doesn’t work, use cmake build a
debug
target.
Use shell:
cmake .. -DCMAKE_BUILD_TYPE=Debug |
Or add to CMakeLists.txt
:
set(CMAKE_BUILD_TYPE Debug) |
- 本文标题:Code-Server 配置 CPP 开发环境
- 创建时间:2023-05-25 17:34:01
- 本文链接:2023/05/25/note/Linux/Server/code_server/
- 版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!