nim-lang / NimLime

The official Nim programming language plugin for Sublime Text
MIT License
132 stars 34 forks source link

how to set compiler options (eg path) or define a nimg.cfg in sublimetext nimline configuration? #93

Closed timotheecour closed 1 year ago

timotheecour commented 6 years ago

on the terminal I can call:

nim c -p:src -o:app -r tests/foo.nim
#or with a nim.cfg containing `path="src"` 
nim c -o:app -r tests/foo.nim

and it works; however sublimetext with nimline package will give syntax highlight error where i call import foo.bar because it doesn't know that src was added to the path (with file in src/foo.bar.nim)

how do I tell sublime to look for my nim.cfg so that syntax highlighting works?

Seems related to https://github.com/Varriount/NimLime/issues/89 :

The first problem is because NimLime doesn't add --threads:on. This could be fixed in in NimLime by adding --threads:on to the code. It could also be fixed by using a configuration file or NimScript file

EDIT: adding options inside ~/.config/nim.cfg seems to work; adding option in $project_root/nim.cfg also works (but not sure if always works?)

joshgoebel commented 6 years ago

I'm not 100% sure the answer but I just put mine in the project root and it seems to "just work" for the most part.