Skip to content

Q: Tweak makeprg #21

@vigilancer

Description

@vigilancer

How do you feel about adding support for appropriate makeprg into this plugin?
Something like this should do:

:setlocal makeprg=java\ -cp\ .:/usr/local/Cellar/kotlin/1.3.10/libexec/lib/kotlin-stdlib.jar\ %:r:gs?^.?\\u&?Kt

(
% filename
:r remove extension
gs?^.?\\u&? - capitalise first letter (hello - Hello) - same as in /^./\u&/gs
Kt - add to the end
)

This will cover scripts without specified package:
:!java -cp .:/usr/local/Cellar/kotlin/1.3.10/libexec/lib/kotlin-stdlib.jar HelloKt

But sure this can be extended with something like :echo substitute(getline(1), ‘package ‘, ‘’, ‘’).

I'm not totally clear on how to get kotlin stdlib path. We can try to guess it or require user to set env variable to the kotlin install dir.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions