aboutsummaryrefslogtreecommitdiff
path: root/autoload/refactor/javascript.kak
blob: 514b883f0cb2581c2fe2e59cf28e1abf2a345cd7 (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: Doesnt work right. Switch to treesitter code mods
define-command js-test-toggle-it-state %{
  try %{
    execute-keys 'Z<a-;><a-i>imxsit\(<ret>cit.only(<esc>z'
  } catch %{
    execute-keys 'Z<a-;><a-i>imxsit\.only\(<ret>cit(<esc>z'
  }
}