From a88da087672723d1b9992221ee7606181bcb0042 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 7 Aug 2012 13:52:49 +0200 Subject: [PATCH] add rc/make.kak which provides make and errjump commands --- src/kakrc | 1 + src/rc/make.kak | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 src/rc/make.kak diff --git a/src/kakrc b/src/kakrc index 34efbf76..b60df82c 100644 --- a/src/kakrc +++ b/src/kakrc @@ -6,3 +6,4 @@ runtime rc/kakrc.kak runtime rc/git.kak runtime rc/global.kak runtime rc/diff.kak +runtime rc/make.kak diff --git a/src/rc/make.kak b/src/rc/make.kak new file mode 100644 index 00000000..d6b0ad90 --- /dev/null +++ b/src/rc/make.kak @@ -0,0 +1,14 @@ +def -env-params make %{ echo make in progress, please wait...; %sh{ + output=$(mktemp -t kak-make.XXXXXXXX) + make ${kak_param_0} ${kak_param_1} ${kak_param_2} ${kak_param_3} ${kak_param_4} >& ${output} + echo "echo; edit ${output}; setb filetype make; hook buffer BufClose ${output} %{ %sh{rm ${output} } }" +}} + +hook global WinSetOption filetype=make %{ + addhl group make-highlight + addhl -group make-highlight regex "^([^:]+):(\d+):(\d+):\h+(?:(error)|(warning)|(note)|(required from(?: here)?))?[^\n]*" 1:cyan 2:green 3:green 4:red 5:yellow 6:blue 7:yellow +} + +hook global WinSetOption filetype=(?!make).* %{ rmhl make-highlight; } + +def errjump %{ exec 'xs^([^:]+):(\d+)(?::(\d+))?'; edit %sh{ echo ${kak_reg_1} ${kak_reg_2} ${kak_reg_3} } }