You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can provide a way to run custom repl commands bound to any shortcut if we let the user specify the command snippet definition as args to the shortcut binding.
This would evaluate the current form in the user namespace.
To achieve this today you need to first define a custom repl command snippet in settings, giving it some key, then bind the shortcut providing the key:
settings.json:
"calva.customREPLCommandSnippets": [
{
"name": "Eval Current Form in user NS",
"key": "eval-current-form-in-user-ns",
"ns": "user",
"snippet": "$current-form"
},
Another difference between the two implementations would be that with a direct shortcut binding, you will not get the snippet added to the custom repl commands menu. But you can always define it the second way, if you like.
The text was updated successfully, but these errors were encountered:
Just a note: I think (assuming other shortcuts set to default) the keyboard shortcut used in this example would better align with $top-level-form instead of $current-form.
We can provide a way to run custom repl commands bound to any shortcut if we let the user specify the command snippet definition as
args
to the shortcut binding.It would allow a keybinding like this:
This would evaluate the current form in the
user
namespace.To achieve this today you need to first define a custom repl command snippet in settings, giving it some key, then bind the shortcut providing the key:
settings.json:
keybindings.json:
Another difference between the two implementations would be that with a direct shortcut binding, you will not get the snippet added to the custom repl commands menu. But you can always define it the second way, if you like.
The text was updated successfully, but these errors were encountered: