Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcut to repeat last command? #1402

Closed
x-ji opened this issue Apr 27, 2015 · 5 comments
Closed

Shortcut to repeat last command? #1402

x-ji opened this issue Apr 27, 2015 · 5 comments

Comments

@x-ji
Copy link
Contributor

x-ji commented Apr 27, 2015

Maybe Spacemacs can add a shortcut to repeat the last command? For example if I did an ACK search in the project, I might want to quickly repeat it.

Or is there any way to cycle through command history?

@tuhdo
Copy link
Contributor

tuhdo commented Apr 27, 2015

Is the ack search you were doing using Helm? If so, you can press SPC h l to resume last Helm session. If you Ack search is not the last active Helm session, you can add prefix argumente C-u to select one.

You can also press f3 to store the search result into a buffer (or press TAB to open action buffer and select the 3rd one; TAB is replaced by C-z for opening action menu in next Spacemacs release), and use M-n or M-p to navigate next and previous match, M-N or M-P to go to next and previous file in the search buffer.

@x-ji
Copy link
Contributor Author

x-ji commented Apr 27, 2015

I see. That applies to scenarios involving helm well. Thanks.

Also, for others like me who are unfamiliar with Emacs, from this Stackoverflow question http://stackoverflow.com/questions/275842/is-there-a-repeat-last-command-in-emacs, to repeat the last general command one can use C-x z, and to repeat the last "complex" command one can use C-x Esc Esc. To bring up complex command history one can use M-x M-p. Seems that commands like those of Ido can be repeated in this fashion.

@x-ji x-ji closed this as completed Apr 27, 2015
@Spadavecchia
Copy link

Spadavecchia commented Aug 24, 2016

The shorcut was changed from SPC h l to SPC r l

SPC r is the prefix for a wonderful collection of commands. Explore it.

@braham-snyder
Copy link
Contributor

braham-snyder commented Nov 26, 2016

would it make sense for Spacemacs to bind SPC. to repeat (as in C-xz)?

EDIT: I've made a new issue for this suggestion.

@mohkale
Copy link

mohkale commented Jul 9, 2019

That would be nice, but it doesn't seem to work as well as I'd like. For example, if I use aya-create to create a snippet (SPC-i-S-c) and then auto-yasnippet-expand (SPC-i-S-e) I'd probably want to repeat auto-yasnippet-expand command multiple times. In current spacemacs, using repeat would just repeat the last literal command, which in this case would be evil-normal-state. Maybe we need to introduce a repeat command working exclusively on spacemacs-leader-keys or ignoring evil state changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants