Is there a command which does "repeat last command"? If not, how can I set up such a thing?
Basically what I want is to press some shortcut, and for it to repeat whatever the last command was, so I don't have to find it again in the menu or the ctrl-shift-p box.
Choose Refresh from the Window menu, or click the Refresh button in the toolbar.
You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character (such as the dot character (.) in JavaScript).
Ctrl+D selects the word at the cursor, or the next occurrence of the current selection. Tip: You can also add more cursors with Ctrl+Shift+L, which will add a selection at each occurrence of the current selected text.
You can press Ctrl + Shift + P
, then Enter
it also repeat the lastest command.
Take a look:
If you are specifically looking to rerun the last shell command, see Make a keybinding to run previous or last shell commands
Older answer (see above)
So this is a little funky because for the workbench.action.acceptSelectedQuickOpenItem
command to work, the command palette must be open. So it will flash open briefly whenever you use the macro keybinding.
Using the macrosRe extension:
"macros": {
"rerunCommand": [
"workbench.action.showCommands",
"workbench.action.acceptSelectedQuickOpenItem"
]
}
I assume you have "workbench.commandPalette.history": 50,
set to at least one so that the most recently used command is at the top of the command palette. [I think that setting always puts the last command at the top and selects it.]
And then some keybinding:
{
"key": "ctrl+;",
"command": "macros.rerunCommand"
},
On Mac simple Ctrl-P repeats the last command on the terminal. Looks like they updated it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With