summaryrefslogtreecommitdiff
path: root/rc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2024-03-11 20:51:27 +1100
committerMaxime Coste <mawww@kakoune.org>2024-03-11 20:51:27 +1100
commit9cc2f47e31e2f0211573b079fe1a5b5a253bada2 (patch)
treec7bcd1b522da50f9ed68288fa93fa94f5e579d4b /rc
parent2b9b74091d89d2b77bffedd3a3d9a1c969d13332 (diff)
Modularize grep.kak, make.kak and jump.kak
Diffstat (limited to 'rc')
-rw-r--r--rc/tools/grep.kak10
-rw-r--r--rc/tools/jump.kak8
-rw-r--r--rc/tools/make.kak8
3 files changed, 20 insertions, 6 deletions
diff --git a/rc/tools/grep.kak b/rc/tools/grep.kak
index faef6ee9..60563166 100644
--- a/rc/tools/grep.kak
+++ b/rc/tools/grep.kak
@@ -1,8 +1,10 @@
-# require-module jump
-
declare-option -docstring "shell command run to search for subtext in a file/directory" \
str grepcmd 'grep -RHn'
+provide-module grep %{
+
+require-module jump
+
define-command -params .. -docstring %{
grep [<arguments>]: grep utility wrapper
All optional arguments are forwarded to the grep utility
@@ -58,3 +60,7 @@ define-command grep-next-match -docstring %{alias for "jump-next *grep*"} %{
define-command grep-previous-match -docstring %{alias for "jump-previous *grep*"} %{
jump-previous *grep*
}
+
+}
+
+hook -once global KakBegin .* %{ require-module grep }
diff --git a/rc/tools/jump.kak b/rc/tools/jump.kak
index a50958b4..51d0bca2 100644
--- a/rc/tools/jump.kak
+++ b/rc/tools/jump.kak
@@ -1,10 +1,10 @@
-provide-module jump %ยงยง
-
declare-option -docstring "name of the client in which all source code jumps will be executed" \
str jumpclient
declare-option -docstring "name of the client in which utilities display information" \
str toolsclient
+provide-module jump %{
+
declare-option -hidden int jump_current_line 0
define-command -hidden jump %{
@@ -64,3 +64,7 @@ define-command -hidden jump-select-previous %{
# See comment in jump-select-next
execute-keys ge %opt{jump_current_line}g<a-h> <a-/>^[^:\n]+:\d+:<ret>
}
+
+}
+
+hook -once global KakBegin .* %{ require-module jump }
diff --git a/rc/tools/make.kak b/rc/tools/make.kak
index 895877d1..5def6ee4 100644
--- a/rc/tools/make.kak
+++ b/rc/tools/make.kak
@@ -1,11 +1,11 @@
-# require-module jump
-
declare-option -docstring "shell command run to build the project" \
str makecmd make
declare-option -docstring "pattern that describes lines containing information about errors in the output of the `makecmd` command. Capture groups must be: 1: filename 2: line number 3: optional column 4: optional error description" \
regex make_error_pattern "^([^:\n]+):(\d+):(?:(\d+):)? (?:fatal )?error:([^\n]+)?"
+provide-module make %{
+require-module jump
define-command -params .. \
-docstring %{
@@ -86,3 +86,7 @@ define-command make-next-error -docstring %{alias for "jump-next *make*"} %{
define-command make-previous-error -docstring %{alias for "jump-previous *make*"} %{
jump-previous *make*
}
+
+}
+
+hook -once global KakBegin .* %{ require-module make }