Commit Graph

95 Commits

Author SHA1 Message Date
Alexander Udalov
e2fd6fbe98 Fix highlighting of augmented assignment operators ("+=") 2021-11-07 04:03:00 +01:00
Alexander Udalov
c126f6dc72 Update syntax to Kotlin 1.6, highlight label in 'this@Foo' 2021-11-07 03:56:28 +01:00
Alexander Udalov
1ce19a8d73 Add undo_ftplugin and restore cpo 2021-11-07 03:14:26 +01:00
Alexander Udalov
1fb9b38dd8 Add sensible formatoptions 2021-11-07 02:47:01 +01:00
Alexander Udalov
089ed3048a Update information in metadata headers 2021-11-07 01:56:00 +01:00
Franz-Xaver Geiger
0d4d82fe27 Enable gf on import statements
The `gf` command opens files under the cursor. This change configures
the kotlin filetype to enable this command on import statements by
replacing dots and appending the file extension.

The functionality is copied from ftplugin/java.vim as distributed in vim
source code.
2021-11-07 01:42:54 +01:00
Alexander Udalov
d8e5ccc2f2 Add basic folding via braces
Co-authored-by: aiya000 <aiya000.develop@gmail.com>
2021-10-30 04:31:44 +02:00
Chaoren Lin
422115fdf5 Use shiftwidth() instead of &shiftwidth.
:help 'shiftwidth'
When zero the 'ts' value will be used. Use the shiftwidth()
function to get the effective shiftwidth value.
2021-10-30 03:24:03 +02:00
Alexander Udalov
9122b28054 Fix intermittent highlighting failures in multiline comments 2021-07-03 20:35:33 +02:00
Alexander Udalov
e043f6a2dd Fix highlighting of visibility modifiers on property accessors 2021-04-20 13:35:31 +02:00
Alexander Udalov
952af68f12 Fix highlighting of suspend before functional types 2021-04-16 18:16:53 +02:00
Alexander Udalov
df0e28cd09 Fix highlighting of visibility modifiers on interfaces 2021-04-16 12:30:25 +02:00
Alexander Udalov
ea258abc43 Fix highlighting of visibility modifiers on objects 2021-04-11 16:36:27 +02:00
Alexander Udalov
4e94ec5d3c Fix highlighting of visibility modifiers on constructors 2021-03-11 13:44:31 +01:00
Ben Kraft
4188c15714 Add three-piece comments declaration
This allows us to have C-style comments in kotlin, a la:
```
/**
 * Start of comment
 *
 * More comment
 */
```
and have vim autoindent them (according to your formatoptions setting,
that is).  I copied the setting from the builtin ftplugin for
JavaScript, since they have equivalent comment syntax.
2021-03-08 09:14:55 -08:00
MatejKastak
7e85cc806b spell: Enable spell checking in strings 2021-03-08 06:45:13 -08:00
Alexander Udalov
7f967873c8 Improve matching of some soft keywords
Words like "value" and "internal" are very common in code, yet they are
only parsed as modifiers if they're present before a class or some other
declaration. Use positive lookahead with the end-of-match token "\ze" to
only highlight them in this case too. This will prevent them from being
highlighted in multi-line case, but it's not very common to have a
declaration and its modifiers on separate lines anyway.
2021-02-17 14:52:42 +01:00
Alexander Udalov
cfa6be8fad Update to Kotlin 1.5 with value, @JvmInline and no experimental coroutines 2021-02-17 14:25:36 +01:00
Tom Plunket
f338707b2a It turns out that Kotlin "raw" strings can do interpolation. 2020-11-02 08:32:24 +01:00
Tom Plunket
d7d6e6a1bb Raw strings don't do interpolation nor backslash escaping. 2020-11-02 08:32:24 +01:00
Alexander Udalov
26970168ca Add Apache 2.0 license 2020-08-11 13:54:03 +02:00
Alexander Udalov
33606c3163 Add type names from kotlin-stdlib and kotlin-stdlib-common
Fixes #12.
2020-07-13 00:13:33 +02:00
Alexander Udalov
b9fa728701 Minor, merge conditions in indent/kotlin.vim 2019-05-26 18:51:59 +02:00
Chandra Sekar S
ab021e990d Do not double-indent argument lists
As described in [Kotlin coding conventions][1] parameters in class
headers, functions and method calls must be indented with a single
indent. Intellij IDEA is also [migrating to this style][2].

This change makes kotlin-vim adopt the official indentation format of
Kotlin.

[1]: https://kotlinlang.org/docs/reference/coding-conventions.html
[2]: https://kotlinlang.org/docs/reference/code-style-migration-guide.html
2019-05-26 18:49:46 +02:00
Alexander Udalov
7cf0cb874d Add Vim 8 to README as a recommended way to install
Inspired by @industrialist in #9 and @dino- in #29
2019-05-26 14:00:41 +02:00
Alexander Udalov
95848f43a7 Tweak ktOperator syntax group
- Add comparison operators: ==, !=, ===, !==, <, <=, >, >=. The latter
  four are highlighted only if there's a whitespace nearby (as per the
  Kotlin style guide), to avoid coloring generic type parameters and
  arguments
- Do not highlight '?', otherwise the safe call operator '?.' looks
  weird. Also '?' at the end of nullable types is not exactly an
  operator
- Add 'as' / 'as?'
2019-05-26 13:19:31 +02:00
Alexander Udalov
7fc458a195 Minor, replace double quotes with single quotes
An addition to 0a900d0 (#11)
2019-05-26 13:19:22 +02:00
Paolo Gavocanov
4b8675991c operators as agreed in https://github.com/udalov/kotlin-vim/pull/11 2019-05-26 13:17:02 +02:00
Paolo Gavocanov
0a900d06a2 vimlint, add operators, use hi link def 2019-05-26 13:17:01 +02:00
Alexander Udalov
aea4336a1d Add info about ftplugin to ReadMe, add did_ftplugin 2019-01-14 23:38:16 +01:00
Henré Botha
36a3d53882 Add ftplugin to set comment syntax (#14) 2019-01-14 23:37:37 +01:00
Alexander Udalov
30c6ad5689 Support unsigned integer literals 2019-01-14 23:20:06 +01:00
Alexander Udalov
7be3831fd2 Simplify kdoc regexes, accept param in see/sample 2019-01-14 21:00:26 +01:00
Alexander Udalov
aad2351bbd Exclude kdoc syntax from string interpolation 2019-01-14 20:59:31 +01:00
sciencesakura
e3273fcba8 Add kDoc syntax 2019-01-14 20:32:34 +01:00
Alexander Udalov
8f70d8161f Do not highlight special symbols and TODOs in string interpolation 2019-01-14 20:31:42 +01:00
Alexander Udalov
51578840c5 Remove obsolete modifiers 'header' and 'impl'
Fixes #19
2018-10-21 10:48:59 +02:00
Alexander Udalov
cf0f4814b9 Support multiple quotes at the end of raw strings
See https://github.com/JetBrains/kotlin/blob/1.2.0/compiler/frontend/src/org/jetbrains/kotlin/lexer/Kotlin.flex#L132

Fixes #10
2017-11-23 10:50:26 +01:00
Alexander Udalov
6f60b66bb4 Update to 1.2-Beta: add 'expect', 'actual' 2017-09-18 14:08:06 +03:00
笈川桐枝 (Snape3058)
7fa99d0706 Update number pattern with underscore separators (#8) 2017-08-17 10:33:33 +03:00
Alexander Udalov
01e3a4c6e9 Fix indent for multi-line comments
Use cindent to indent inside the comment, and use the comment start line
indent for the line following the comment.

Fixes #7
2017-07-15 12:34:17 +03:00
Alexander Udalov
135a4febf6 Update to 1.1-M04: add 'header', 'impl', remove 'coroutine' 2016-12-29 20:56:22 +03:00
Alexander Udalov
b45fdc92f9 Add a note about Syntastic support 2016-09-08 13:23:09 +03:00
Francis Agayapong
8a7605a65d Remove the optional IsAvailable function.
The implementation of this function is no different than what syntastic
provides as default.
2016-09-08 13:16:16 +03:00
Francis Agayapong
0949e48529 Update the checker following discussion with @udalov on github.
The changes in this commit are as a result of recommendations made by
github/udalov on here: https://github.com/udalov/kotlin-vim/pull/4
2016-09-08 13:16:16 +03:00
Francis Agayapong
c1ad578f2a Initialize fname to an empty string before checking for sourcepath to prevent undefined variable errors when sourcepath is empty 2016-09-08 13:16:16 +03:00
Francis Agayapong
a2edf43cac Add option for sourcepath in the config file
Previously the checker passed only the current buffer as input to the
kotlin compiler, everything else was passed as classpath. This meant
an access to an internal program element (function, type, variable, etc)
was reported as error. This commit adds a sourcepath option that will be
passed to the compiler during a check.
2016-09-08 13:16:16 +03:00
Francis Agayapong
079deebe41 Change the name of the classpath variable in the syntastic checker
The syntastic checker uses a name for the classpath variable that is
different from what is produced by the gradle plugin. This resulted in
the classpath not being read from the generated configuration file (from
gradle)
2016-09-08 13:16:16 +03:00
Francis Agayapong
38e5e6c7a4 Add a syntastic checker for the kotlin filetype 2016-09-08 13:14:56 +03:00
Alexander Udalov
9bb133b742 Update to development builds of 1.1: add 'typealias', 'coroutine', 'suspend', remove 'yield', 'async' 2016-07-04 14:58:54 +03:00