# Define SciTE settings for Nim files.

# File filters, patterns, language, lexer and source
file.patterns.nim=*.nim
filter.nim=Nim (nim)|$(file.patterns.nim)|
lexer.$(file.patterns.nim)=nim

*filter.nim=$(filter.nim)
*language.nim=Nim|nim||
*source.patterns.nim=$(file.patterns.nim);

# Primary keywords
keywords.$(file.patterns.nim)=addr and as asm bind block break case cast concept \
const continue converter defer discard distinct div do elif else end enum \
except export finally for from func if import in include interface is \
isnot iterator let macro method mixin mod nil not notin object of or out \
proc ptr raise ref return shl shr static template try tuple type \
using var when while xor yield

# Auto indentation
statement.indent.$(file.patterns.nim)=15 :
#statement.indent.$(file.patterns.nim)=8 block elif else except finally of for \
#if iterator macro proc template try while
statement.lookback.$(file.patterns.nim)=0

# Indent view
view.indentation.examine.*.nim=2

# Determines if generalized raw string Identifiers should have the same color as
# their corresponding string literal
lexer.nim.raw.strings.highlight.ident=0

# Comment insertion
comment.block.nim=#
comment.stream.start.nim=#[
comment.stream.end.nim=]#
comment.box.start.nim=#[
comment.box.middle.nim= #
comment.box.end.nim=]#

# Lexer styling
# White space/default
style.nim.0=fore:#808080
# Comment block
style.nim.1=fore:#007F00,$(font.comment)
# Comment block (doc)
style.nim.2=fore:#0000FF,$(font.comment)
# Comment line
style.nim.3=fore:#007F00,$(font.comment)
# Comment line (doc)
style.nim.4=fore:#D73A49,$(font.comment)
# Number
style.nim.5=fore:#007F7F
# String
style.nim.6=fore:#7F007F
# Character
style.nim.7=fore:#7F007F
# Word
style.nim.8=fore:#00007F,bold
# Triple
style.nim.9=fore:#7F0000
# Triple double
style.nim.10=fore:#7F0000
# Backticks
style.nim.11=fore:#000000
# Function name (eg. after proc, macro, template, etc.)
style.nim.12=fore:#007F7F,bold
# End of line where string is not closed
style.nim.13=fore:#000000,$(font.monospace),back:#E0C0E0,eolfilled
# Numeric format error (eg. when a binary value is incorrect, like 0b1510)
style.nim.14=fore:#000000,back:#FF8080
# Operator
style.nim.15=bold
# Identifier
style.nim.16=fore:#000000

# Nim Compiler User Guide:
# https://nim-lang.org/docs/nimc.html
if PLAT_WIN
	command.go.$(file.patterns.nim)=nim c -r "$(FileNameExt)"
	command.go.subsystem.$(file.patterns.nim)=1

if PLAT_GTK
	command.go.$(file.patterns.nim)=nim c -r "$(FileNameExt)"

command.compile.$(file.patterns.nim)=nim c "$(FilePath)"
command.help.$(file.patterns.nim)=nim -h

# Add command to Tools menu
command.name.1.$(file.patterns.nim)=Compile Release Version
command.1.$(file.patterns.nim)=nim c -d:release "$(FileNameExt)"
