> ## Content Index
> Fetch the complete content index at: https://linuxhandbook.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Show Hidden Special Characters in Vim
- URL: https://linuxhandbook.com/show-special-characters-vim/
- Published: 2022-03-16T12:59:50.000Z
- Updated: 2025-08-23T03:18:37.000Z
- Description: Wondering if it is 2 spaces or tabs? You can show special characters in Vim and easily identify them.
- Author: Abhishek Prakash
- Tags: Vim Tips, #docs-col, #group-additional-tips

Have you ever encountered a problem in a [YAML](https://linuxhandbook.com/yaml-basics/), Python or any other files that emphasizes indentation? 

And later, you realized that everything in the file was correct, except for the indentation and saw that there was a line indented with 3 spaces instead of 4 spaces?

That happens often. Most IDEs let you view the special characters and identify the end of line, spaces and tabs. Vim is not behind any other IDE. It can also show you those hidden characters.

## Hidden characters in Vim

Hidden characters in Vim can be thought of as "whitespaces". Below are the characters that Vim considers hidden for better readability.

- `eol` (end of line)
- `tab`
- `trail` (space character before a newline character)
- `extends` (character in the last column to show that next line is continuation of line wrap)
- `precedes` (character in the first column to show that this line is continuation of previous line as a line wrap)
- `conceal`
- `nbsp` (non breakable space character)

## Enable visibility of hidden characters

To temporarily enable the visibility of hidden characters, you can use the following command.

```vim
:set list
```

To reverse this change, you can hide the hidden characters again by using the command given below.

```vim
:set nolist
```

![enabling visibility of hidden characters](https://linuxhandbook.com/content/images/2022/02/01-demonstration-of-hidden-chars.gif)

As you can see, enabling the list option, there is now `$` character denoting a new-line or a line break.

To make this change permanent, add the following line to your 'vimrc' file.

```vimrc
set list
```

## Change hidden characters

When you turn on visibility of characters, Vim has a predefined set. As you saw in the gif above, enabling visibility using `set list`, the newline character was denoted by the dollar sign `$`.

But what if you don't want the dollar sign? What if you want a different character to denote a line break?

Below is an example of how you can use different characters for each hidden character.

```vim
:set listchars=eol:^,tab:-,trail:!,extends:>,precedes:<
```

The character you want to use to denote end of line (eol) is to be typed after `eol:` in the example command above.

![changing the what characters represent the hidden characters](https://linuxhandbook.com/content/images/2022/02/02-custom-chars.gif)

If you look at the video, I copied spaces and pasted it to the very end of line (also known as "trailing spaces") and they are now shown as `!` exclamation marks.

Also notice how the default `eol` character changed from `$` dollar symbol to `^` circumflex symbol.

If you want to make this permanent, you can add the same command you ran into your 'vimrc' as follows:

```vimrc
set listchars=eol:^,tab:-,trail:!,extends:>,precedes:<
```

[Basic Vim Commands Every Linux User Must Know \[With PDF Cheat Sheet\]A comprehensive guide explaining basic vim commands that will be useful to any Linux user be it a sysadmin or a developer.![](https://linuxhandbook.com/favicon.png)Linux HandbookAbhishek Prakash![](https://linuxhandbook.com/content/images/2020/06/basic-vim-command-guide-1.jpeg)](https://linuxhandbook.com/basic-vim-commands/)

## Conclusion

This article covers how to enable (and disable) the visibility of hidden characters. We also go over how you can change what symbols denote the presence of a hidden character.

If you are interested in learning more than just the [Vim Basics](https://linuxhandbook.com/basic-vim-commands/), I highly recommend using this program by Jovica Ilic.

[Mastering Vim Quickly - Jovica IlicExiting Mastering Vim Quickly From WTF to OMG in no timeJovica Ilic![](https://jovicailic.org/wp-content/uploads/2017/11/book_video_ebooks-1.jpg)](https://gumroad.com/a/322499699?ref=linuxhandbook.com)