VSCode工具 - C/C++

记录一下开发中比较符合自己使用习惯的工具,以免之后再次出现花费长时间查找的问题

C/C++

  • 简介

The C/C++ extension adds language support for C/C++ to Visual Studio Code, including features such as IntelliSense and debugging.

  • 选择理由

支持C/C++的语法等功能

  • 使用方法

直接安装使用即可

Bracket Pair Colorizer 2

  • 简介

This extension allows matching brackets to be identified with colours. The user can define which tokens to match, and which colours to use.

  • 选择理由

修改括号对颜色的插件,可以在编码的过程中直接就看出来括号是否匹配

  • 使用方法

直接安装即可使用

  • VSCODE插件

CoenraadS.bracket-pair-colorizer-2-0.2.4.vsix

Chinese (Simplified) Language Pack for Visual Studio Code

  • 简介

此中文(简体)语言包为 VS Code 提供本地化界面。

  • 选择理由

中文插件,看个人习惯

  • 使用方法

直接安装即可使用

highlight-words

  • 简介

This extension is adapted from the sample VS code extension decorator-sample, inspired by atom-quick-highlight. It creates a decoration for each selected word that appears in all editors.

  • 选择理由

高亮选中的文本

  • 使用方法

直接安装使用,个人习惯配置为黄色背景,使用快捷键F2,修改配置如下:

  • VSCODE插件

rsbondi.highlight-words-0.1.4.vsix

代码格式化工具 Clang-Format

  • 简介

clang-format 是一种格式化 源代码的工具

  • 选择理由

在代码编写过程中,不免会有些格式不能人为的遵守,通过工具来进行格式化代码,可以保证格式完全一致,有一个好的阅读体验和书写体验

  • 使用方法

在.c和.h文件中,使用快捷键(默认:CTRL + ALT + F)或者文件中右键--格式化使用

保存自动格式化配置

settings.json文件中添加以下配置

"editor.formatOnSave": true

个人使用WebKit 风格比较匹配个人代码风格,后续看情况在模板上进行修改,适配个人使用。

在使用中发现,clang-format对于数组等内容格式化效果不尽人意,所以使用AStyle进行格式化代码,试用中,使用的是vscode插件加上AStyle可执行文件的方式;

Astyle

  • 使用方法

与clang format使用方法一致,只要配置了保存自动格式化,保存时就自动调用格式化了

  • VSCODE插件

chiehyu.vscode-astyle

  • 配置文件

    /* AStyle */
    "astyle.additional_languages": [
        "c",
        "cpp",
        "h",
    ],

    "astyle.cmd_options": [
        //Brace Style Options
        "--style=allman",
        //Tab Options
        "--indent=spaces=4",
        //Indentation Options
        "--indent-switches",
        "--indent-preproc-block",
        "--indent-preproc-define",
        "--indent-col1-comments",
        "--min-conditional-indent=0",
        "--max-continuation-indent=120",
        //Padding Options
        "--squeeze-ws",
        "--pad-oper",
        "--pad-comma",
        "--unpad-paren",
        "--fill-empty-lines",
        "--align-pointer=name",
        //Formatting Options
        "--break-one-line-headers",
        "--add-braces",
        "--add-one-line-braces",
        "--attach-return-type",
        "--attach-return-type-decl",
        "--convert-tabs",
        "--mode=c"
    ],

现在一直使用的都是AStyle进行格式化代码,所以更推荐使用AStyle

字符串大小写转换

突发奇想搜索了一下,真的发现有这样的一个小工具

  • 简介

将选中的字符转换成大写,小写,数字,字符串

  • 选择理由

一个很使用的小工具,当在需要用到的时候就知道比较好用了

  • 使用方法

  1. 选中要转换的字符串
  2. 右键选择要执行的命令

  •  VSCODE插件

xzzfxz.str-transform-0.0.2.vsix

不定期更新

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值