aboutsummaryrefslogtreecommitdiff
path: root/autoload/refactor/javascript.kak
blob: 7b60b2f96a1d5baedbe380c015b765de4100cc4a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
hook global BufSetOption filetype=(?:javascript|typescript|jsx|tsx) %{
  map global refactor o ': js-test-toggle-it-state<ret>' -docstring 'Toggle it/it.only'
}

# TODO: Use treesitter code mods?
define-command js-test-toggle-it-state %{
  try %{
    execute-keys -draft '<a-;><a-i>imxsit\(<ret>cit.only(<esc>'
  } catch %{
    execute-keys -draft '<a-;><a-i>imxsit\.only\(<ret>cit(<esc>'
  }
}