mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-24 03:50:24 +10:00
Moving to Doom Emacs!
This commit is contained in:
15
.emacs.d/modules/lang/kotlin/autoload.el
Normal file
15
.emacs.d/modules/lang/kotlin/autoload.el
Normal file
@@ -0,0 +1,15 @@
|
||||
;;; lang/kotlin/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;autoload
|
||||
(defun +kotlin-locate-gradlew-file ()
|
||||
"Gradlew file location for this project."
|
||||
(locate-dominating-file buffer-file-name "gradlew"))
|
||||
|
||||
;;;###autoload
|
||||
(defun +kotlin/run-gradlew (command)
|
||||
"Run gradlew in this project."
|
||||
(interactive "sCommand: ")
|
||||
(let ((default-directory (+kotlin-locate-gradlew-file))
|
||||
(compilation-read-command nil)
|
||||
(compile-command (format "sh gradlew %s" command)))
|
||||
(call-interactively #'compile)))
|
||||
18
.emacs.d/modules/lang/kotlin/config.el
Normal file
18
.emacs.d/modules/lang/kotlin/config.el
Normal file
@@ -0,0 +1,18 @@
|
||||
;;; lang/kotlin/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(after! kotlin-mode
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'kotlin-mode-local-vars-hook #'lsp!))
|
||||
(set-docsets! 'kotlin-mode "Kotlin")
|
||||
|
||||
(map! :map kotlin-mode-map
|
||||
:localleader
|
||||
:prefix ("b" . "build")
|
||||
:desc "gradlew assemble" "a" (λ! (+kotlin/run-gradlew "assemble"))
|
||||
:desc "gradlew build" "b" (λ! (+kotlin/run-gradlew "build"))
|
||||
:desc "gradlew test" "t" (λ! (+kotlin/run-gradlew "test"))))
|
||||
|
||||
|
||||
(use-package! flycheck-kotlin
|
||||
:when (featurep! :tools flycheck)
|
||||
:hook (kotlin-mode . flycheck-kotlin-setup))
|
||||
8
.emacs.d/modules/lang/kotlin/doctor.el
Normal file
8
.emacs.d/modules/lang/kotlin/doctor.el
Normal file
@@ -0,0 +1,8 @@
|
||||
;;; lang/kotlin/doctor.el -*- lexical-binding: t; -*-
|
||||
|
||||
(unless (executable-find "ktlint")
|
||||
(warn! "ktlint not found. flycheck-kotlin won't work."))
|
||||
|
||||
(assert! (or (not (featurep! +lsp))
|
||||
(featurep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
7
.emacs.d/modules/lang/kotlin/packages.el
Normal file
7
.emacs.d/modules/lang/kotlin/packages.el
Normal file
@@ -0,0 +1,7 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/kotlin/packages.el
|
||||
|
||||
(package! kotlin-mode)
|
||||
|
||||
(when (featurep! :tools flycheck)
|
||||
(package! flycheck-kotlin))
|
||||
Reference in New Issue
Block a user