From 61924ba95f7828b4b33d707dd83e8900f52968ef Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Sun, 9 Oct 2022 17:17:18 +0200 Subject: [PATCH] Add some scala-specific stuff --- home/kakoune/kakrc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/home/kakoune/kakrc b/home/kakoune/kakrc index ad8637b..503f285 100644 --- a/home/kakoune/kakrc +++ b/home/kakoune/kakrc @@ -161,6 +161,22 @@ hook global WinSetOption filetype=(rust) %{ set-option buffer makecmd "cargo check" } +hook global WinSetOption filetype=(scala) %{ + # Format the document if possible + hook -group scala-fmt window BufWritePre .* %{ lsp-formatting-sync } + + set window tabstop 2 + set window indentwidth 2 +} + +define-command -params 0 -docstring "Set up build" scala-build-connect %{ + lsp-execute-command 'build-connect' '"[]"' +} + +define-command -params 0 -docstring "Import build" scala-build-import %{ + lsp-execute-command 'build-import' '"[]"' +} + def -hidden insert-c-n %{ try %{ lsp-snippets-select-next-placeholders