Vi indicator for loksh
October 09, 2019
When I switched from bash to (lo)ksh I did so because of bash being too bloated and prone to become slow under certain circumstances. However, there was a feature that I missed from bash – the ability to indicate vi modes (normal, input & replace).
I couldn’t find anyone already having implemented this feature in ksh, so I thought that I could do it myself. I made the implementation quite simple and straight forward. When using vi-mode and at the same time having the string ’[xxx]’ somewhere in the PS1 environment variable, the selected mode will be indicated between the first ’[’ and ’]’. What’s between the brackets will act as placeholder, which requires the indicators to be of the same size.