Skip to content

Instantly share code, notes, and snippets.

@novotnyr
Created January 6, 2020 21:26
Show Gist options
  • Save novotnyr/6580ff0468ab5840ef47c7fe5f86dfb5 to your computer and use it in GitHub Desktop.
Save novotnyr/6580ff0468ab5840ef47c7fe5f86dfb5 to your computer and use it in GitHub Desktop.

First Time Setup

  1. Run CLion
  2. Set Do not import settings, as there is nothing to import yet.
  3. Setup Light/Dark theme
  4. For the sake of simplicity, disable all plugins.
  5. Do not enable any featured plugins.
  6. Start using CLion.
  7. Toggle Evaluate for free for 30 days.
  8. Continue.

Toolchain Configuration

  1. On MacOS, hopefully everything is autoconfigured.
  • CMake is bundled
  • Make is autodetected from /usr/bin
  • CCompiler is taken from CommandLineTools
  • C++ Compiler is autodetected, too
  • Debugger is Bundled LLDB

A new Project

  1. Create a New Project.
  2. From the flavours on the left, pick C Executable.
  3. Pick an appropriate C Standard, such as C99.
  4. Wait a little bit for indexing to complete.
  5. Run main.c by clicking on the green "Play" triangle next to the int main() line in the editor line gutter.

Single File Execution

Install the plugin:

  1. Preferences > Plugins > C/C++ Single File Execution (by corochann).
  2. Restart IntelliJ

Usage:

  1. Create an additional file, e. g. number.c with main().
  2. Right click into the editor, select Add Executable for single c/cpp file.
  3. A notification “add_executable added for number.c.“ will be shown.
  4. Open CMakeLists.txt from the Project Tree. A Reload notification shows up. Enable Autoreload.
  5. Now, run the number.c by clicking on the green "Play" triangle next to the int main() line in the editor line gutter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment