Saturday, May 24, 2014

zsh enhanced autocomplete

Just another cool and helpful little zsh thing, I call it "enhanced autocomplete".
This works for any command with positional arguments (just type command [tab]) or with command switches (both - and --, just type command - [tab] / command -- [tab]). You will see the possible options displayed in your terminal. Bash is capable of doing that as well, but you will not see a description for each option and it does not work for short options (single dash). Furthermore, alt + h will route you to the man pages of command, without changing what you typed in the prompt so far (very useful!).

Completion for arguments is especially useful for zsh's cd -n (go back n entries in directory history), where you will see the directory for each an and can choose n appropriately.

Another thing, also related to tab complete, that I found out recently is [shift] + [tab]. This will give you a list of all commands that you can type in your current shell.

2 comments:

  1. hi Philipp! Nice blog) I will follow you.

    ReplyDelete
    Replies
    1. Thank you and congratulations on posting the very first comment on this blog! I did not know that you were interested in nerd business.

      Delete