qingw / doom-private

Doom Emacs的个人配置,主要针对C/C++开发

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

简介

新建工程 cp-project-new

img/new-project.gif

补全

img/complete.gif

查看定义和引用 lsp-ui-peek-find-definitions lsp-ui-peek-find-references

img/def.gif

运行 cp-project-run

img/run.gif

调试 dap-debug

img/debug.gif

安装

安装配置文件

git clone -b develop https://github.com/hlissner/.emacs.d ~/.emacs.d
git clone https://github.com/xhcoding/doom-private.git ~/.config/doom
cd ~/.emacs.d
make all

安装补全服务端ccls

补全需要的服务端,ccls安装方法

Windows VS 工具链安装方法

  1. 第一步:安装VS2017及以上版本,安装时勾选上CMake
  2. 第二步:编译 clang及lldb(为了使用lldb-vscode 调试)

打开 适用于VS2017的x64本机工具命令提示 这个cmd

// 下载源码
git clone https://mirrors.tuna.tsinghua.edu.cn/git/llvm/llvm.git
git clone https://mirrors.tuna.tsinghua.edu.cn/git/llvm/clang.git llvm/tools/clang
git clone https://mirrors.tuna.tsinghua.edu.cn/git/llvm/lldb.git llvm/tools/lldb
// 进入目录
cd llvm
// 编译
cmake -H. -BRelease -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DLLVM_TARGETS_TO_BUILD=X86
ninja -C Release clangFormat clangFrontendTool clangIndex clangTooling clang lldb
  1. 第三步:编译 ccls
// 下载代码
git clone  --recursive https://github.com/MaskRay/ccls
// 生成
cmake -H. -BRelease -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang-cl -DSYSTEM_CLANG=On -DCMAKE_PREFIX_PATH="D:/Code/CCPro/llvm/Release;D:/Code/CCPro/llvm/Release/tools/clang;D:/Code/CCPro/llvm;D:/Code/CCPro/llvm/tools/clang"
// 构建
ninja -C Release

CMAKE_PREFIX_PATH 为你的llvm的目录。

最后把 ccls和lldb-vscode 放到 $PATH 里

安装调试服务端lldb-vscode

安装方法

用法

打开一个CMake 项目后先运行 M-x cp-project-refresh

  • 新建项目:M-x cp-project-new
  • 生成CMake 配置文件:M-x cp-project-gen
  • 构建项目:cp-project-build
  • 运行项目:cp-project-run

About

Doom Emacs的个人配置,主要针对C/C++开发


Languages

Language:Emacs Lisp 96.5%Language:YASnippet 3.5%