Visual Studio Code by itself really rocks too. I like it much better than Atom (and Sublime 2/3).
Look at the features and their documentation. They speak for themselves:
If you have no time and just want to see why I am enthusiastic, check this out:
The Nim extension is to be found here (supports a lot of advanced stuff already, TY!):
My own try on a useful extension is also Nim related and helps to read indentation. You can find it here:
A very nice script "runner" type extension is here:
Another useful plugin for Nim is 4 Spaces/Tabs to 2 Spaces:
Not being a fan of Microsoft at all, I never would have thought that I one day post something like this :)
Here my Settings (mostly just for Nim so far):
// Place your settings in this file to overwrite the default settings
{
"telemetry.enableCrashReporter": false,
"editor.tabSize": 2,
"editor.scrollBeyondLastLine": false,
"editor.wrappingColumn": 0,
"editor.wrappingIndent": "none",
"editor.renderWhitespace": true,
"editor.quickSuggestionsDelay": 500,
"diffEditor.ignoreTrimWhitespace": true,
"window.reopenFolders": "all",
//"window.openFilesInNewWindow": false,
"files.exclude": {
"**/*.dSYM": true,
"**/callgrind.*": true,
"**/.git": true,
"**/.DS_Store": true
},
"search.exclude": {
"**/nimcache": true
},
"files.trimTrailingWhitespace": true,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1500,
"runner.languageMap": {
"nim": "~/bin/vsc-runner"
},
"runner.extensionMap": {
"nim": "~/bin/vsc-runner",
"nims": "~/bin/vsc-runner"
}
}
The very simple "vsc-runner" to use the runner extension for Nim:
#!/bin/bash
if [ -z "$1" ]; then
echo "You need to save first!"
exit 5
fi
cd `dirname "$1"`
time nim c --verbosity:0 --hints:off -d:release --parallelBuild:1 -r `basename "$1"`
And some bash "alias" to call vscode from the terminal (OSX):
function code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $*; }
@dom96 Yes. So it is even more in the tradition of Nim (just joking) ;-)
I was also searching for information and found it referenced as "vscode" usually which made that easier. Another name would have helped indeed.
But then I also found that very much is documented "inside" the editor and on the comprehensive website with all the examples and tutorials. If you edit preferences or the key-map and even on writing plugins you get error checking and helpful pop-ups at every corner.
All in all it was a pleasuring experience so far.
Thanks for the tip.
Not being a fan of Microsoft at all, I never would have thought that I one day post something like this :)
MS is surprising people lately. Try Bash ( Ubuntu ) for Windows 10 ( insiders build. Release in August with the Anniversary update ).
@idobai From my experience Atom is much slower than VSCode. They are completely different developments.. Alone that I could open some bigger files in VSCode where Atom gave an error was enough for me to try VSCode before it had all the features it has now. Atom feels to me like the "amateurish" version. But that may be just me.
BTW: Using Electron (and Chromium) for comparison is like saying Atom is like Wayward or Duelyst (the Games). There are a lot of different apps build with Electron these days. It is just the canvas and it can be really fast. You may look at https://github.com/sindresorhus/awesome-electron#apps
@OderWat Is Atom slower? Possibly. If I install enough plugin on Atom to make it seem like an IDE and open a project with it it can eat up to 4 GB of RAM which is unacceptable. Is Atom ameturish? vscode just introduced tabs and find-replace . Could electron be fast? Of course, the hello-world app. More "serious" apps like a git gui(https://www.gitkraken.com/) just wastes tons of resources for nothing when you open larger projects with them. It doesn't matter what electron app we use, both the startup and the runtime will be slower than it should be - even slower than a .net app while spawning a lot of processes because of chromium.
BTW: what a nice new world where most editors are written on one of the slowest platform. With such "progress" they'll never beat neither sublime nor vim.
hi,
I've been playing with Nim a bit to see if it's feasible to use it in my company, I’ve tested it with a few editors and currently I’m using vscode.
I think that the language is just great, it’s so much fun to program with it,just love it!! … but, there are a few things that must be addressed to make it appeal to a broad audience:
Editor integration:
Debugging:
It would be great if you could select a single editor/IDE (doen’t matter which (vscode or IntelliJ for example, although I think vscode is a good candidate) and make it work perfect, I’m sure it will attract many newcomers.
BTW: I’ll be happy to help with that ;)
Cheers and keep on this great work that you do
The VSCode plugin is supposed to do all of this very well. That is if @araq does not break it the day I promote that editor a lot :) ... Check out the newest Nim version in devel this may solve your problem. And see here for some screens of how it works:
Screen 1 Screen 2 Screen 3 Screen 4
And more of course...
BTW: It seems that the whole thing does not work for @araq either currently. There may be some strange setup problem on some systems. We are investigating :)
I'm using nimble to build, this is my vscode tasks.json:
{
"version": "0.1.0",
"command": "nimble",
"isShellCommand": true,
"args": ["build"],
"showOutput": "always"
}
the nimble project config looks like this - testapp.nimble:
version = "0.1.0"
author = "gil"
description = "testapp"
license = "MIT"
bin = @["testapp"]
binDir = "bin"
srcDir = "src"
# Dependencies
requires "nim >= 0.14.2"
in addition to that, I use the vscode GDB plugin to debug, so the launch.json looks like this:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "gdb",
"request": "launch",
"target": "./bin/testapp",
"cwd": "${workspaceRoot}",
"internalConsoleOptions": "openOnSessionStart"
//,"terminal": ""
}
]
}
to enable debug you need to pass debugger:"native" to nim compiler, i'm doing this by having a nim.cfg file in my project root folder with this inside
debugger:"native"
with these settings i hit ctrl+shift+B to build and F5 to debug.
The error/warning highlight does indeed work but it only works after you save the file! Because its not checking in real time for error/warnings, it can trow people think it does not work. I also was under the impression it did not work.
By the way: Another nice add-on is:
https://marketplace.visualstudio.com/items?itemName=spywhere.guides
Do not forget to put in your settings: "guides.sendUsagesAndStats": false
Why do I get suggestions like this? It looks like it is suggesting every possible symbol in scope. Is this supposed to be happening?
This is a bit annoying because I have to press ESC before Enter at the end of every line.
I use VSCode exclusively with Nim at the moment, and whilst I'm generally happy with it (I have yet to get gdb set up for debugging though) one thing that really annoys me is the suggestion boxes being so persistent!
I hope there's a setting to change it, but it's kinda irritating when I keep having to press escape to get rid of a code suggestion box - especially when your caret is in a proc and changing lines persists the popup for every line I go to until I press escape.
I just want them to go away once I change line to be honest. Is there an option to do that that I might have missed?
See: https://github.com/pragmagic/vscode-nim/issues/21
I don't know a way to disable a signature help provider :(