By Alvin Alexander. Last updated: April 10, 2024
vi/vim FAQ: How do I show hidden characters in the vi/vim editor?
Solution
I just learned that you can show hidden characters like tabs and end-of-line/newline characters in vi/vim with its set list
command. Just go into last-line mode with the :
character, then use that command:
:set list
When I do that in my current file, the $
is used to show newline characters, and TAB characters show up as ^I
:
#!/bin/sh$ exec scala "$0" "$@"$ !#$ $ println("Hello, world")$ $ ^I// tab test$ $ $
If you ever need to show hidden/invisible characters in vi/vim, I hope this is helpful.