Skip to content

CMake build automation utility

Zeioth edited this page Nov 18, 2023 · 7 revisions

When compiler.nvim detects a CMakeLists.txt file in the current working directory, Telescope will be populated with all its add_executable and add_custom_target entries.

Hello world

Create a package.json file in your working directory and copy/paste this:

{
  "name": "hello-world-app",
  "version": "1.0.0",
  "scripts": {
    "start": "node index.js"
  }
}

Now let's create the file we are building on the example above: Create index.js in the same directory.

console.log("Hello, World!");

When you open the compiler you will see the option to run it screenshot_2023-11-18_03-15-22_046195642

And this is the result screenshot_2023-11-18_03-16-00_517985199

In the same way you can run hello world, you can execute any command necessary to build your program.

More info

(optionally) You can define the next globals

global defaut value
NODE_PACKAGE_MANAGER yarn

Example:

let g:NODE_PACKAGE_MANAGER='npm'

Globals persist between Neovim sessions.