Skip to content

Instantly share code, notes, and snippets.

@kprofic
Forked from chriseidhof/swift.tex
Last active August 29, 2015 14:07
Show Gist options
  • Select an option

  • Save kprofic/ad27cd883b42fcc910c8 to your computer and use it in GitHub Desktop.

Select an option

Save kprofic/ad27cd883b42fcc910c8 to your computer and use it in GitHub Desktop.
\lstdefinelanguage{swift}
{
morekeywords={
func,if,then,else,for,in,while,do,switch,case,default,where,break,continue,fallthrough,return,
typealias,struct,class,enum,protocol,var,func,let,get,set,willSet,didSet,inout,init,deinit,extension,
subscript,prefix,operator,infix,postfix,precedence,associativity,left,right,none,convenience,dynamic,
final,lazy,mutating,nonmutating,optional,override,required,static,unowned,safe,weak,internal,
private,public,is,as,self,unsafe,dynamicType,true,false,nil,Type,Protocol,
},
morecomment=[l]{//}, % l is for line comment
morecomment=[s]{/*}{*/}, % s is for start and end delimiter
morestring=[b]" % defines that strings are enclosed in double quotes
}
\definecolor{keyword}{HTML}{BA2CA3}
\definecolor{string}{HTML}{D12F1B}
\definecolor{comment}{HTML}{008400}
\lstset{
language=swift,
basicstyle=\ttfamily,
showstringspaces=false, % lets spaces in strings appear as real spaces
columns=fixed,
keepspaces=true,
keywordstyle=\color{keyword},
stringstyle=\color{string},
commentstyle=\color{comment},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment