how to use vim's build in history (re run re play commands) by line number
prepare:
<span style="color: #00ffff;">
echo "com -nargs=1 HI exe histget('c', )" >> ~/.vimrc</span>
then start vim and type to show the history (commands last typed):
[ESC]
<span style="color: #00ffff;">:history</span>
# or short
<span style="color: #00ffff;">:his
</span>
now to re run the command #LineNumber 29, type:
<span style="color: #00ffff;">:HI 29
<a href="https://dwaves.de/wp-content/uploads/2022/02/how-to-use-vims-build-in-history-re-run-re-play-commands-by-line-number_2.jpg"><img alt="" class="alignnone size-full wp-image-25261" height="265" src="https://dwaves.de/wp-content/uploads/2022/02/how-to-use-vims-build-in-history-re-run-re-play-commands-by-line-number_2.jpg" width="500"></img></a>
</span>
#linux #gnu #gnulinux #opensource #administration #sysops #vim #howto #gnu-linux
Originally posted at: https://dwaves.de/2022/02/09/how-to-use-vims-build-in-history-re-run-re-play-commands-by-line-number/
One person like that