diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-06-26 15:36:49 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-06-27 10:41:08 +0530 |
| commit | e751362d9194d9291057759fa33073720c3535fd (patch) | |
| tree | b7098346db2317d2211d7445300d210c49647948 /snippets/typescript/react-usestate.snip.kak | |
| parent | fb52df34924781ed3d42ca8864402c3e7a52d4aa (diff) | |
| download | kakoune-config-e751362d9194d9291057759fa33073720c3535fd.tar.gz kakoune-config-e751362d9194d9291057759fa33073720c3535fd.zip | |
Shnippets
Diffstat (limited to 'snippets/typescript/react-usestate.snip.kak')
| -rw-r--r-- | snippets/typescript/react-usestate.snip.kak | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/snippets/typescript/react-usestate.snip.kak b/snippets/typescript/react-usestate.snip.kak new file mode 100644 index 0000000..8b2d232 --- /dev/null +++ b/snippets/typescript/react-usestate.snip.kak @@ -0,0 +1,11 @@ +prompt 'Name: ' %{ + set-register n %val{text} + prompt 'Initial value: ' %{ + set-register v %val{text} + evaluate-commands %sh{ + st=$(echo "$kak_reg_n" | sed 's/^[A-Z]/\L\0/') + setst="set$(echo "$kak_reg_n" | sed 's/^[a-z]/\U\0/')" + echo "execute-keys '<esc>,iconst [$st, $setst] = useState($kak_reg_v);<esc>'" + } + } +} |
