Skip to content

Instantly share code, notes, and snippets.

@krobelus
Created February 13, 2022 16:54
Show Gist options
  • Save krobelus/ead51b5d12f29dfa3ab5a4b9a7fa82b5 to your computer and use it in GitHub Desktop.
Save krobelus/ead51b5d12f29dfa3ab5a4b9a7fa82b5 to your computer and use it in GitHub Desktop.
define-command -override run-test-above-cursor %{
evaluate-commands -save-regs t %{
evaluate-commands -draft %{
execute-keys <a-l><a-/>test\s*"([^"]*)"<ret>
# Numbered registers are cleared liberally, so let's save this one.
set-register t %reg{1}
}
terminal sh -sc "echo run test %reg{t}"
}
}
map global user t %{: run-test-above-cursor<ret>}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment