<p>Thanks, that's probably the best way.</p>
<p>I made <code>~/.config/geany/filedefs/filetypes.kotlin</code>:</p>
<div class="highlight highlight-source-ini"><pre><span class="pl-en">[styling=Java]</span>

<span class="pl-en">[keywords=Java]</span>
<span class="pl-c"><span class="pl-c">#</span> https://kotlinlang.org/docs/reference/keyword-reference.html</span>
<span class="pl-k">primary</span>=as as? fun in !in object typealias val var when by constructor delegate dynamic field file get init param property receiver set setparam where actual annotation companion const crossinline data expect external infix inline inner internal lateinit noinline open operator out reified sealed suspend tailrec vararg field it
<span class="pl-c"><span class="pl-c">#</span> https://kotlinlang.org/docs/reference/basic-types.html</span>
<span class="pl-k">secondary</span>=Double Float Long Int Short Byte NaN
<span class="pl-c"><span class="pl-c">#</span> documentation keywords for javadoc</span>
<span class="pl-k">doccomment</span>=
<span class="pl-k">typedefs</span>=

<span class="pl-en">[lexer_properties=Java]</span>

<span class="pl-en">[settings=Java]</span>
<span class="pl-k">extension</span>=kt
<span class="pl-k">mime_type</span>=text/x-kotlin

<span class="pl-en">[build_settings]</span>
<span class="pl-c"><span class="pl-c">#</span> For this to work, the main class should be the same name as the file</span>
<span class="pl-k">compiler</span>=kotlinc <span class="pl-s"><span class="pl-pds">"</span>%f<span class="pl-pds">"</span></span>
<span class="pl-k">run_cmd</span>=kotlin <span class="pl-s"><span class="pl-pds">"</span>%e<span class="pl-pds">"</span></span>

<span class="pl-c"><span class="pl-c">#</span> If you usually use Kotlin as a scripting lang, use this instead</span>
<span class="pl-c"><span class="pl-c">#</span>compiler=</span>
<span class="pl-c"><span class="pl-c">#</span>run_cmd=kotlin -script "%f"</span></pre></div>
<p>Then, in <code>filetype_extensions.conf</code> I added:</p>
<div class="highlight highlight-source-ini"><pre><span class="pl-k">Kotlin</span>=*.kt<span class="pl-c"><span class="pl-c">;</span>*.kts;</span>

<span class="pl-en">[Groups]</span>
<span class="pl-k">Programming</span>=Arduino<span class="pl-c"><span class="pl-c">;</span>Clojure;CUDA;Cython;Genie;Scala;Kotlin</span></pre></div>
<p>I assume I need to do something more? Where should I specify filetypes.kotlin?<br>
Thanks</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1581#issuecomment-405221149">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ9UPlMvJl48pKr0b45k4t7_Yez9wks5uHHyRgaJpZM4O8lkX">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJ0hqJWd4KXCljYX2Bz9roGKvq7Lvks5uHHyRgaJpZM4O8lkX.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@esotericpig in #1581: Thanks, that's probably the best way.\r\n\r\nI made `~/.config/geany/filedefs/filetypes.kotlin`:\r\n```INI\r\n[styling=Java]\r\n\r\n[keywords=Java]\r\n# https://kotlinlang.org/docs/reference/keyword-reference.html\r\nprimary=as as? fun in !in object typealias val var when by constructor delegate dynamic field file get init param property receiver set setparam where actual annotation companion const crossinline data expect external infix inline inner internal lateinit noinline open operator out reified sealed suspend tailrec vararg field it\r\n# https://kotlinlang.org/docs/reference/basic-types.html\r\nsecondary=Double Float Long Int Short Byte NaN\r\n# documentation keywords for javadoc\r\ndoccomment=\r\ntypedefs=\r\n\r\n[lexer_properties=Java]\r\n\r\n[settings=Java]\r\nextension=kt\r\nmime_type=text/x-kotlin\r\n\r\n[build_settings]\r\n# For this to work, the main class should be the same name as the file\r\ncompiler=kotlinc \"%f\"\r\nrun_cmd=kotlin \"%e\"\r\n\r\n# If you usually use Kotlin as a scripting lang, use this instead\r\n#compiler=\r\n#run_cmd=kotlin -script \"%f\"\r\n```\r\n\r\nThen, in `filetype_extensions.conf` I added:\r\n\r\n```INI\r\nKotlin=*.kt;*.kts;\r\n\r\n[Groups]\r\nProgramming=Arduino;Clojure;CUDA;Cython;Genie;Scala;Kotlin\r\n```\r\n\r\nI assume I need to do something more? Where should I specify filetypes.kotlin?\r\nThanks"}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1581#issuecomment-405221149"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/1581#issuecomment-405221149",
"url": "https://github.com/geany/geany/issues/1581#issuecomment-405221149",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [geany/geany] Kotlin Language Support (#1581)",
"sections": [
{
"text": "",
"activityTitle": "**Jonathan Bradley Whited**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@esotericpig",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"geany/geany\",\n\"issueId\": 1581,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"geany/geany\",\n\"issueId\": 1581\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/geany/geany/issues/1581#issuecomment-405221149"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 250763543\n}"
}
],
"themeColor": "26292E"
}
]</script>