How do I change bash history completion to complete what's already on the line?

后端 未结 5 1157
北荒
北荒 2020-12-02 03:54

I found a command a couple of months ago that made my bash history auto-complete on what\'s already on the line when pressing the up arrow:

$ vim fi
         


        
5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-02 04:11

    You may need to enabled bash completion.

    Check

    • /etc/profile
    • /etc/bash.bashrc
    • ~/.bashrc

    to see if any of the above files source /etc/bash_completion. i.e.

    . /etc/bash_completion
    

    If /etc/bash___completion is not sourced by any of the above files you will need to add it to one of them.

    If you want all bash users on your machine to have bash completion, source /etc/bash_completion from /etc/bash.bashrc.

    If it's just you who wants bash completion, source /etc/bash_completion from your ~/.bashrc.

提交回复
热议问题