get bash history to vi

前端 未结 5 1272
故里飘歌
故里飘歌 2021-02-19 04:57

When I try to read bash history into vim, I get nothing.

:r !history

If I just execute the command, i.e.

:!history
5条回答
  •  轮回少年
    2021-02-19 05:45

    Try:

    r !set -o history; HISTFILE=~/.bash_history; history -r; history 10
    

    This will include the timestamps and will not include history that hasn't been saved to the history file.

提交回复
热议问题