Modern C ++ development tools CLion from entry to the master

Author: allsochen, Tencent PCG background development engineers

This is CLion

A few years ago wrote an article eclipse C ++, and now also mention eclipse, then people will hate me, my friends and family will laugh at me, I cast aside. JetBrains home because of family CLion eclipse good experience playing a few blocks. Sign figurative reference to know almost CLion and vim / emacs, as shown:

As can be seen from the chart positioning CLion is a complete set of modern C ++ tool contains many useful features, and vim is lightweight and sharp, if you use Vim on CLion, that knife robots. This energy you know.


Prelude before takeoff

According to the last Tencent to you on a unique development model of windows, as shown below:

Windows environment on the need to prepare alchemy furnace: clion installation, cygwin, jce release of documents, taf source.

All the above software are involved in the development of machine 30:

/data/home/allsochen/software/clion。

You can see the corresponding files directly through samba. You can directly pick up, do not demonstrate your single Scissorhands. Do not click directly mounted on the samba, samba performance is worrying.

Clion:

  1. Installation: just click next, next installation, the installation is complete

  2. Authorization: The first time you open the prompts to authorize, support people to buy genuine, there's edu email can apply for a free trial. Other ways you know.

  3. Startup parameters: As clion is java development, is relatively memory consumption, it is recommended to set the maximum memory to 4086M, in specific settings:

    The C: \ Program Files \ JetBrains \ CLion 2018.1.5 \ bin directory:

    Clion64.exe.vmoptions more of the file, change the third line -Xmx2000m -Xmx4086m, at the same time open project propose to set up a large number of students, after all, our development machines have 16G, wayward.

Cygwin:

  1. Installation: Copy to c cygwin64.zip disc decompression, extraction if the directory is as follows:

  1. Path provided: To the cmd command may be used commonly used grep, find the commands linux, C added in the environment variable in the path: \ cygwin64 \ bin

Jce dependent files:

  1. Winscp installation, the software by winscp / home development machine 30 on / tafjce directory synchronization to D: / Codes / lower tafjce

  2. Synchronization configuration settings, carefully look at the options here, otherwise release accidentally deleted files on your development machine, you may end awards this year on the gg. Is the remote directory synchronization to a local directory, direction / destination directory: Local

  1. Setting Transfer Settings: only synchronizes * .h / * cpp / * mk / * jce file, exclude .svn directory.

  1. Periodic synchronization: full amount after the first synchronization, follow just idle in the process of developing the required time sync occasionally ok.

Font: Father's recommended kotlin, JetBrains CEO of recommended font Lucida Sans Typewriter

CLion configuration:

  1. Copy the file to config.zip:

    C:\Users\yourname\.CLion2018.1 下

  2. Delete the original config directory

  3. Decompression config.zip, extracted directory as follows

This configuration is the integration of the role: Programming C ++ Development Guide Statute browser, JCE
Editor, m2cmake and a series of open-source plug-ins and I realized.

Vim configuration:

  1. If you want a robot samurai sword and fit, try new strength after the next assembly.

  2. .Ideavimrc copy the file to the C: \ Users \ yourname root directory

Taf support:

1) taf.zip copy files to D: \ under Codes \ C ++ unzipped


take off

Open clion, this time will prompt some of my invalid project, simply delete it. Then be introduced through svn, git or a local file C ++ service, here do not avoid the introduction of a directory service has more than one project a service. After opening a service project:

Automatic deployment:

The local service directory files are automatically synchronized to the target compiler development of samba directory

  1. Configure the target directory synchronization: Files-> Settings-> Other Settings-> Quickly Sync
    Deployment

Configuration requires synchronization to compile their own development directory, please put your name into allsochen

2)> Quickly Sync Deployment for rapid deployment of synchronization through the menu Tools-

3) Confirm deployment: Tools-> Deployment-> Configuration-> OK

Always perform this step, the second part of the plug-in has a bug, it will lead to the first configuration does not take effect, not free to change the plug.

Cmake:

  1. By m2cmake plug the taf of relevant documents generated CMakeList.txt makefile file. Select the item with the catalog, right-click menu "Transfer
    TAF Makefile to cmake ..."

  1. Construction of the project: Select the project root directory, right-click menu "Reload Cmake
    Project", can also be constructed through the shortcut Alt + K, Alt + M

After the build is complete, try intelligent smart tips and jce dependent under the framework of taf prompt, confirm whether take effect.


Mysterious power

  1. Live Tempalte

Live
tempalte abstract template code, you can quickly generate code template with variables. For example in the open cpp editor forv, and then press the tab key, it will automatically generate a template for a cycle of the vector template. From the File-> Settings-> Editor-> Live
Tempaltes can see the template has been configured

  1. Common shortcuts: Help-> Keymap reference

JetBrains CEO of development tools is that they do not need to use the mouse

Here are several commonly used:

Shift + Ctrl + N: Open the file

Ctrl + E: Open Recent

Ctrl + Y: delete a row

Ctrl + F12: function include files, letters can be entered matches the search

Ctrl + Q: variables, functions and other documentation

Ctrl + W: extended selection

Ctrl + Shift + N: Last edited point

,, w: positioning the cursor within the screen ,, s: then need to search the letters: alphabet search screen

Shift + F6: Reconstruction of naming

The Alt + Shift + direction, the: code motion

Shift + Enter: Open a new window

More needs to search their own, as long as you use the mouse to place, there is a shortcut for you.

  1. Frame Switch Plug

Switch windows in different projects to support the search for a matching, shortcut Alt + F2

  1. M2cmake plug

Taf automatically generate a makefile file CMakeList.txt

https://github.com/Allsochen/clion-m2cmake

  1. QuicklySyncDeployment

The project file is automatically copied to the deployment of the development machine

https://github.com/Allsochen/clion-m2cmake

There are still a little bug, welcome people with lofty ideals with maintenance

  1. Jce Editor

Jce file format, jump, grammar tips, formatting Alt + Ctrl + L

There are still a little bug, welcome people with lofty ideals with maintenance

  1. StringStyle

Provides various conversions between strings, Alt + M shortcut

https://github.com/Allsochen/StringStyle

This article PPT source files in the background reply: Clion  obtained.

Recommended reading:

This is the real Git - Git internals of Secret!

Put your VS Code playing a C ++ development tool

On a microscopic features of the project recommendation system

Published 129 original articles · won praise 328 · views 290 000 +

Guess you like

Origin blog.csdn.net/Tencent_TEG/article/details/103516304