When writing a new language using cursor i find myself selecting pieces of code, pressing CMD+L and then asking “explain this”.
I’m wondering if there is a way of making a shortcut where:
- inserts selection into the chat
- adds a custom string, in this case “please explain the pasted code”
- submits the question
Here is my imaginary shortcut config:
[
{
"key": "cmd+shift+e",
"command": "runCommands",
"args": {
"commands": [
"aichat.insertselectionintochat",
"aichat.append 'Please explain this'",
"aichat.submit"
]
},
"when": "editorHasSelection"
}
]