How to make PowerShell tab completion work like Bash

后端 未结 7 1034
囚心锁ツ
囚心锁ツ 2020-12-12 10:17

Let\'s say I have the following files in my current directory:

buildBar.bat
buildFoo.bat
buildHouse.bat

And I type the following at my comm

7条回答
  •  情深已故
    2020-12-12 11:10

    tab only completes the command name not its previous arguments/parameters.

    to also autocomplete the complete command with arguments from history set the below keybinding.

    Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
    Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
    

    Now, type few characters of command name and use up/down arrow to autocomplete this command (with arguments) from history.

    real time saver.

提交回复
热议问题