From 188f55b6f08e455a3d1f8d18dded0a9cab4eb30e Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Tue, 23 May 2017 20:42:47 +0530 Subject: [PATCH 1/4] Add kotlin.nanorc Credits to https://github.com/bjarneh/kotkit/blob/master/misc/syntax/nano/kotlin.nanorc --- kotlin.nanorc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 kotlin.nanorc diff --git a/kotlin.nanorc b/kotlin.nanorc new file mode 100644 index 0000000..ccb8300 --- /dev/null +++ b/kotlin.nanorc @@ -0,0 +1,20 @@ +# Nano syntax file +# Language: Kotlin +# Maintainer: Bjarne Holen +# Last Change: 2012 Feb 14 + +syntax "kotlin" "\.kt$" +color brightred "\<[A-Z_][0-9A-Z_]+\>" +color green "\<(namespace|as|type|class|this|super|val|var|fun|for|null|true|false|is|in|throw|return|break|continue|object|if|try|else|while|do|when|trait|import|where|by|get|set|abstract|enum|open|annotation|override|private|public|internal|protected|catch|out|vararg|inline|finally|final|package)\>" +## +## String highlighting. You will in general want your comments and +## strings to come last, because syntax highlighting rules will be +## applied in the order they are read in. +color blue "<[^= ]*>" ""(\\.|[^"])*"" + +## Comment highlighting +color red "//.*" +color red start="/\*" end="\*/" + +## Trailing whitespace +color ,green "[[:space:]]+$" From 0f13ffd8c210736c5c20f394f2ffa569868f79b9 Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Tue, 23 May 2017 20:44:21 +0530 Subject: [PATCH 2/4] Add kotlin.nanorc --- nanorc | 1 + 1 file changed, 1 insertion(+) diff --git a/nanorc b/nanorc index f987aa1..3e74035 100644 --- a/nanorc +++ b/nanorc @@ -35,6 +35,7 @@ include "~/.nano/js.nanorc" include "~/.nano/json.nanorc" include "~/.nano/keymap.nanorc" include "~/.nano/kickstart.nanorc" +include "~/.nano/kotlin.nanorc" include "~/.nano/ledger.nanorc" include "~/.nano/lisp.nanorc" include "~/.nano/lua.nanorc" From d6b9ba466ddc0d3987aaad3dbf569b55a5e2a7a9 Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Wed, 24 May 2017 11:49:31 +0530 Subject: [PATCH 3/4] Adjust colors --- kotlin.nanorc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/kotlin.nanorc b/kotlin.nanorc index ccb8300..f13d992 100644 --- a/kotlin.nanorc +++ b/kotlin.nanorc @@ -1,16 +1,21 @@ # Nano syntax file # Language: Kotlin # Maintainer: Bjarne Holen -# Last Change: 2012 Feb 14 +# Edited by: Ritiek Malhotra +# Last Change: 2017 May 24 -syntax "kotlin" "\.kt$" -color brightred "\<[A-Z_][0-9A-Z_]+\>" -color green "\<(namespace|as|type|class|this|super|val|var|fun|for|null|true|false|is|in|throw|return|break|continue|object|if|try|else|while|do|when|trait|import|where|by|get|set|abstract|enum|open|annotation|override|private|public|internal|protected|catch|out|vararg|inline|finally|final|package)\>" +syntax "kotlin" "\.kt$" "\.kts$" +color magenta "\b(([1-9][0-9]+)|0+)\.[0-9]+\b" "\b[1-9][0-9]*\b" "\b0[0-7]*\b" "\b0x[1-9a-f][0-9a-f]*\b" +color yellow "[.:;,+*|=!\%@]" "<" ">" "/" "-" "&" +color green "\<(namespace|as|type|class|this|super|val|var|fun|is|in|object|when|trait|import|where|by|get|set|abstract|enum|open|annotation|override|private|public|internal|protected|out|vararg|inline|final|package)\>" +color yellow "\<(true|false|null)\>" +color cyan "\<(break|catch|continue|do|else|finally|for|if|return|throw|try|while|repeat)\>" +color brightred "\<(inner|outer)\>" ## ## String highlighting. You will in general want your comments and ## strings to come last, because syntax highlighting rules will be ## applied in the order they are read in. -color blue "<[^= ]*>" ""(\\.|[^"])*"" +color brightblue "<[^= ]*>" ""(\\.|[^"])*"" ## Comment highlighting color red "//.*" From acdc221649b98505f45ddc19020792c7f992a7ea Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Thu, 25 May 2017 01:06:26 +0530 Subject: [PATCH 4/4] Add copyright --- kotlin.nanorc | 1 + 1 file changed, 1 insertion(+) diff --git a/kotlin.nanorc b/kotlin.nanorc index f13d992..ac2bdf7 100644 --- a/kotlin.nanorc +++ b/kotlin.nanorc @@ -3,6 +3,7 @@ # Maintainer: Bjarne Holen # Edited by: Ritiek Malhotra # Last Change: 2017 May 24 +# Copyright (c) 2014, Bjarne Holen syntax "kotlin" "\.kt$" "\.kts$" color magenta "\b(([1-9][0-9]+)|0+)\.[0-9]+\b" "\b[1-9][0-9]*\b" "\b0[0-7]*\b" "\b0x[1-9a-f][0-9a-f]*\b"