diff --git a/README.md b/README.md index f971289..d36def1 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ nim c -o:bin/niminit niminit This will create a directory called ``bin/`` inside the repo. You can copy the binary into your path from there. +You'll also find two template files that can be used to initialise a nim project for VSCode inside ``config`` in this repo. You can copy these to ``~/.config/niminit`` or create your own. + ## Update 1. Open your terminal and ``cd`` into the repository. 2. Run ``git pull`` to update the local repo. diff --git a/config/launch.json b/config/launch.json new file mode 100644 index 0000000..5c6e203 --- /dev/null +++ b/config/launch.json @@ -0,0 +1,14 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "nim: debug current file", + "preLaunchTask": "nim: build current file (for debugging)", + "program": "${workspaceFolder}/bin/${fileBasenameNoExtension}", + "args": [], + "cwd": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/config/tasks.json b/config/tasks.json new file mode 100644 index 0000000..1771819 --- /dev/null +++ b/config/tasks.json @@ -0,0 +1,37 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "nim: build current file", + "command": "nim", + "args": [ + "c", + "-o:${workspaceRoot}/bin/${fileBasenameNoExtension}", + "-r", "${fileBasename}" + ], + "options": { + "cwd": "${workspaceRoot}" + }, + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "nim: build current file (for debugging)", + "command": "nim", + "args": [ + "c", + "-g", + "--debugger:native", + "-o:${workspaceRoot}/bin/${fileBasenameNoExtension}", + "${relativeFile}" + ], + "options": { + "cwd": "${workspaceRoot}" + }, + "type": "shell" + } + ] +} diff --git a/install.sh b/install.sh index 7259e80..5249f5f 100755 --- a/install.sh +++ b/install.sh @@ -12,6 +12,10 @@ mkdir -p $HOME/.local/bin # Copy binary to local bin folder cp bin/niminit $HOME/.local/bin/niminit +# Create config directory & copy files +mkdir -p $HOME/.config/niminit +cp config/* $HOME/.config/niminit + # Print info message to export local bin if not already echo -e "\n" echo -e "\e[92m>>> \e[0mDone! If you haven't already added your local bin folder to your PATH, you can do so by adding the following line to your .profile, .bashrc or .zshrc"