VSCode使用小结

vscode是一款编辑器,而不是IDE

c/c++

.vscode目录下有4个文件,它们分别是c_cpp_properties.json,*.code-workspace,settings.json,tasks.json。c_cpp_proerties.json里配置的includePath,只是在编辑代码时提供智能提示的帮助,而编译时如果要配置includepath,应该是tasks.json里配置。
includePath in c_cpp_properties.json not working in VSCode for C

The c_cpp_properties.json controls, among other things, where intellisense in the IDE resolves include files. The IDE and the build tasks are independent things and as a result, configured and operate independently in VS Code.
The solution to your problem is to add the include path to your tasks.json file, as follows:

"args": [
        "-g",
        "${file}",
        "-o",
        "${fileDirname}/${fileBasenameNoExtension}",
        "--include-directory=/usr/include/glib-2.0/"
 ],

code snippets

VSC支持多种语言生成代码片断-官方链接
Extensions 搜索 “C/C++ Snippets”

设定自己的code snippets
方法:左下角Manage->Configure User Snippets,默认.json文件是存放在C盘,所以如果更换了操作系统,自设定的Snippets会失效。

插件安装

pylint

链接在这里vscode Python Pylint(代码检测插件)

VSCodeVim

这里要注意的是如果需要修改vim扩展的一些功能,需要在全局的settings.json里修改,一般路径是C:\Users\xxxxx\AppData\Roaming\Code\User\settings.json,如果是在单个工程的settings.json里配置,可能会出现对应的vim的json配置字段为灰色(失效)。一个简单的Vim按键映射功能,可以通过如下字段配置实现(j -> gj,即实际行向下改为屏幕行向下):

 "vim.normalModeKeyBindings": [
    {
   
      "before": ["j"],
      &
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值