CLion常用插件及c文件模板配置
文章目录
- CLion常用插件及c文件模板配置
- 1.常用插件
- 2.模板
- 2.1 c源文件模板:(使用文件模板)
- 2.2 c头文件模板:(使用文件模板)
- 2.3 c函数模板:(使用实时模板)
- 2.4 添加修改点
- 3.结果展示
- 4.最后
1.常用插件
- Chinese (Simplified) Language Pack / 中文语言包
- Monokai Pro Theme (主题theme插件)
- idea vim(idea的vim插件)
- codeglance(代码预览,右侧可以预览代码)
- Rainbow Brackets(彩虹括号,花括号的代码会有竖线关联)
2.模板
参考:https://www.jetbrains.com/help/clion/settings-file-and-code-templates.html
Variable | Description |
---|
${CALL_SUPER} | Base function call signature during the override generation |
${DATE} | Current system date |
${DAY} | Current day of the month |
${DEFAULT_RETURN_VALUE} | Default return value of the function |
${DIR_PATH} | Path to the directory of the new file (relative to the project root) |
${DS} | Dollar sign $. This variable is used to escape the dollar character, so that it is not treated as a prefix of a template variable. |
${FILE_NAME} | Name of the new C or C++ file |
${HEADER_COMMENTS} | Always returns true and is used for testing purposes |
${HEADER_FILENAME} | Name of the header file generated for a class or a source file |
${HOUR} | Current hour |
${INCLUDE_GUARD} | Prevents repeated include of a particular header file |
${MINUTE} | Current minute |
${SECOND} | Current second |
${MONTH} | Current month |
${MONTH_NAME_FULL} | Full name of the current month (January, February, and so on) |
${MONTH_NAME_SHORT} | First three letters of the current month name (Jan, Feb, and so on) |
${NAME} | Name of the new entity (file, %class%, interface, and so on) |
${NAMESPACE_CLOSE} | End of a namespace block created during refactoring |
${NAMESPACE_OPEN} | Beginning of a namespace block created during refactoring |
${PRODUCT_NAME} | Name of the IDE (for example, CLion) |
${PROJECT_NAME} | Name of the current project |
${RETURN_TYPE} | Type of the function’s return value (used for generating new functions) |
${SUIT_NAME} | Google test suite name |
${TEST_NAME} | Google test name |
${TIME} | Current system time |
${USER} | Login name of the current user (all platforms) |
${USER_NAME} | For Windows and Linux: login name of the current user For macOS: registered full name of the user |
${YEAR} | Current year |
2.1 c源文件模板:(使用文件模板)
2.2 c头文件模板:(使用文件模板)
#[[#ifndef]]# ${INCLUDE_GUARD}
#[[#define]]# ${INCLUDE_GUARD}
#[[#endif]]#
2.3 c函数模板:(使用实时模板)
2.4 添加修改点
3.结果展示
源文件:
头文件:
函数头:
添加修改:
4.最后
其实我们还可以将这些模版开发成插件上传到插件市场(Java就可以开发),这些留给以后折腾吧,感兴趣的可以自行先研究一下。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)