You can use rlwrap to get this function (search history using CTRL + R , file name and keyword) without compiling anything. If you are using Ubuntu, install it from the universe repositories by running:
sudo apt-get install rlwrap
Launch gnuplot with:
rlwrap -a -N -c -b \' -D 2 -s 1000 gnuplot
where -a -N overrides the built-in readline gnuplot support, -c gives you the completion of the file name, -b \' allows you to fill in things like plot 'incomp[TAB]lete' , -D 2 discards duplicates from the history and -s 1000 increases the size of the story from 300 by default.
Or add this line to your script run (i.e. .bashrc , .zshrc ), so you can use gnuplot without an extra entry:
alias gnuplot="rlwrap -a -N -c -b \' -D 2 -s 1000 gnuplot"
In addition, it is possible to complete a keyword by listing all the keywords in the $RLWRAP_HOME/gnuplot_completions . However, context-specific termination is not possible with rlwrap.
You can export the history of gnuplot commands to rlwrap (so you don't have to start from scratch), for example:
tail -n +2 ~/.gnuplot_history | while read -r; do print $REPLY; done > $RLWRAP_HOME/gnuplot_history
tail gets rid of the gnuplot header, and print converts escaped characters (I wonder why the history of gnuplot is stored like this).
source share