Clion是一个cross-platform C/C++ ide,写c++的时候我最喜欢的是windows的 VS,Mac上我喜欢Clion
如何获得免费版CLion?
- 答:找身边的学生或者老师,用教育邮箱免费申请
- 传送门 https://www.jetbrains.com/student/
用教育邮箱都可以
![f635691b2fe79a051e804b51320d8260.png](https://img-blog.csdnimg.cn/img_convert/f635691b2fe79a051e804b51320d8260.png)
1.设置代码提示模糊匹配格式-去掉大小写匹配
![7b5c5b9ac720166c9f6ea81317e9c38b.png](https://img-blog.csdnimg.cn/img_convert/7b5c5b9ac720166c9f6ea81317e9c38b.png)
2.万能的灯泡提示 ⌥ + Enter(Windows 下是 Alt + Enter),哪里不会点哪里
![29e05eda2816938160984976abdca066.png](https://img-blog.csdnimg.cn/img_convert/29e05eda2816938160984976abdca066.png)
3.好用的live template
![df3291dd6acd2f25c2cb9107ae830e6d.png](https://img-blog.csdnimg.cn/img_convert/df3291dd6acd2f25c2cb9107ae830e6d.png)
void testFunc1(){
std::vector<int> nums{2,3,4};
//输入for 按tab键
for (int i = 0; i < nums.size(); ++i) {
}
//输入iter 按tab
for (const auto &num : nums) {
}
//输入itit按tab
for (auto num = nums.begin(); num != nums.end(); ++num) {
}
}
4. surround with
快捷键 ⌥ + ⌘ + T
![fb678cb34cb0f9e103dfdeffca26153f.png](https://img-blog.csdnimg.cn/img_convert/fb678cb34cb0f9e103dfdeffca26153f.png)
5.Use first, define later
想用的函数可以直接写出来,clion会提示去创建函数
![739f00144788149acee3dfcc52873c06.png](https://img-blog.csdnimg.cn/img_convert/739f00144788149acee3dfcc52873c06.png)
6. Follow the hierarchal view
CLion provides you with a wide range of code navigation options:
- use standard goto declaration/definitions features;
- jump to a related symbol, recent files, or the place you edited last;
- search for any class, file or symbol by its name;
- use the context search with Find Usages;
- navigate through the current file using the File Structure view;
- and benefit from several hierarchical views, including Call Hierarchy, Type Hierarchy and Imports Hierarchy.
Call Hierarchy is my favorite. It lets me see the whole call stack with all the branches in details. Looks so simple, isn’t it?
![bf120e7e9880d549372c9f24b3c49d84.png](https://img-blog.csdnimg.cn/img_convert/bf120e7e9880d549372c9f24b3c49d84.png)
7.Refactor 万般皆重构-重构功能很强大
![bc2c7cebf9ea0579d2210d39afd7acc2.png](https://img-blog.csdnimg.cn/img_convert/bc2c7cebf9ea0579d2210d39afd7acc2.png)
轻度使用中,未完,待续...
参考:
http://www.cplusplus.com/articles/L0pk4iN6/www.cplusplus.com 工欲善其事,可能会有用的Clion技巧www.jianshu.com![c9a12d12d91a036b3a92254e7fedb52b.png](https://img-blog.csdnimg.cn/img_convert/c9a12d12d91a036b3a92254e7fedb52b.png)
附快捷键:
![1af44e14e154191c2e12c4372fbe6e0f.png](https://img-blog.csdnimg.cn/img_convert/1af44e14e154191c2e12c4372fbe6e0f.png)
![86b751ae97383689713779162de662c7.png](https://img-blog.csdnimg.cn/img_convert/86b751ae97383689713779162de662c7.png)