Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zsh: how to get back 'unexpanded' command

Tags:

zsh

zsh-zle

Zsh has a nice feature of expanding globs. For example, hitting Tab turns ls **/*.js into

ls app/assets/javascripts/application.js vendor/assets/javascripts/Markdown.Converter.js

Is there a way to collapse it back to original glob version? Or should I just disable glob expanding?

The reason I want it, is that when I am in the middle of debugging a glob and I hit Tab just to double check something, there is no way to get back and complete the pattern. I have to start from scratch.

like image 377
artemave Avatar asked Sep 04 '12 15:09

artemave


1 Answers

Use the undo zle command. For example, bind it to Ctrl_:

bindkey '^_' undo

From zshzle(1):

undo (^_ ^Xu ^X^U) (unbound) (unbound)
       Incrementally undo the last text modification.

redo   Incrementally redo undone text modifications.
like image 54
Thor Avatar answered Oct 08 '22 17:10

Thor