Skip to content

ErikMN/vscode_init

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VSCODE INIT logo

Automate creation of C/C++ projects with Visual Studio Code
This automation tool is mainly targeted at Linux and macOS users.
Clone this project into your $HOME directory (or any directory really).

demo

Elevator pitch

  • Simple to setup and use
  • No need to install (but possible)
  • No hidden configuration files
  • No modification of your system
  • Inspired by Create React App
  • Tested and maintained for Linux and macOS

Requirements

Bash is really the only true requirement to run the script.
The list below is additional software to get the most out of VSCODE INIT.

C/C++ for Visual Studio Code

Install the C/C++ for Visual Studio Code plugin https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools

How to run the scripts

After this repo has been cloned to your $HOME directory, the following commands can be used to create C/C++ projects.

To create a C project in the directory /tmp/test1 run:

~/vscode_init/bin/create-c-app /tmp/test1

To create a C++ project in the directory /tmp/test1 run:

~/vscode_init/bin/create-cpp-app /tmp/test1

Install the scripts

To install the scripts run (as root):

make install

default location is /usr/local/
to uninstall the scripts run (as root):

make uninstall

Use PREFIX to specify your own installation directory:

make install PREFIX=/usr/local

Optional shell profile alias

If you don't want to install the scripts, they can be run directly.
Add to ~/.zshrc (or your shell config of choice).
These aliases can be added automatically by running append_alias.sh

alias copy-vsctasks="$HOME/vscode_init/utils/copy_tasks.sh"
alias create-c-app="$HOME/vscode_init/bin/create-c-app"
alias create-cpp-app="$HOME/vscode_init/bin/create-cpp-app"
alias create-shared-lib-c-app="$HOME/vscode_init/bin/create-shared-lib-c-app"
alias create-c-meson-app="$HOME/vscode_init/bin/create-c-meson-app"

In a directory of choice then run:

create-c-app <name-of-my-app>

to setup a C project with VScode tasks.

Or run:

copy-vsctasks

in an existing project to copy VScode tasks to that directory.

Building my created project

To build your newly created C project run:

make

in the root directory of the project.
To build a production suitable binary run:

FINAL=y make

Custom project workspace settings

Edit settings.json to add custom project workspace settings.
Example: source a script for zsh at terminal startup.

{
  "terminal.integrated.profiles.linux": {
    "zsh": {
      "path": "zsh",
      "args": [
        "-c",
        "source ${workspaceFolder}/my_script.sh; zsh"
      ]
    }
  }
}

About

Fast C/C++ project creation tool with Visual Studio Code support

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published