CLI Show line numbers in vim June 22, 2016 nicholas Leave a comment I want to save this little trick for later. To get vi(m) to show line numbers, use the following command: :set nu Hit escape first in case you’re in input mode. Then simply type the colon set nu and hit enter.