set-option global makecmd 'echo "Build command not set"; exit 1' define-command makecmd-set-tsc %{ set-option buffer makecmd "%val{config}/scripts/tsc-vimgrep.sh" } define-command makecmd-set-cabal %{ set-option buffer makecmd "cabal build" } define-command makecmd-set-cargo %{ set-option buffer makecmd "cargo build" } # Overriding the make command provide-module make-override %{ define-command -params .. -override -docstring %{ make []: make utility wrapper All the optional arguments are forwarded to the make utility } make %{ evaluate-commands -save-regs m %{ set-register m %opt{makecmd} evaluate-commands -try-client %opt{toolsclient} %{ fifo -scroll -name *make* -script %{ trap - INT QUIT trap 'echo -e "\n\nExited with $?" >&2' EXIT eval "$kak_reg_m \"\$@\"" } -- %arg{@} set-option buffer filetype make set-option buffer jump_current_line 0 } } } } hook -once global KakBegin .* %{ require-module make-override } define-command just -params .. %{ eval %sh{ if [ "$#" = "0" ]; then echo "terminal-singleton just just --choose" else echo "terminal-singleton just sh -c 'just ""$@""; echo ""Press enter to exit""; read a'" fi } }