How to display tabs characters as ^I

34 views
Skip to first unread message

Igor Forca

unread,
Sep 21, 2017, 6:59:38 AM9/21/17
to vim_use
Hi,
when I open the file which includes tabs characters I can replace tabs with some other characters if I want like using:
:%s/^I/ /g
To get ^I I press Control+V and then press i key.

I know ^I is a symbol for tabs. But is there a way instead of horizontal spacing produced by pressing tab key to display ^I control character?
Just like for example when Control+V and m is pressed to display carriage return character ^M

So, how to display ^I (as single character) instead of horizontal spacing produced by tab key?

Thanks

Tim Chase

unread,
Sep 21, 2017, 7:11:55 AM9/21/17
to vim...@googlegroups.com
On 2017-09-21 03:59, Igor Forca wrote:
> So, how to display ^I (as single character) instead of horizontal
> spacing produced by tab key?

You want the 'list' setting:

:set list

or toggle it with

:set list!

which you can read about at

:help 'list'

-tim





Tony Mechelynck

unread,
Sep 21, 2017, 7:17:23 AM9/21/17
to vim...@googlegroups.com
See :help 'list' and :help 'listchars' -- these are local options,
boolean and comma-separated string respectively

If 'list' is off, a hard tab is represented as one or more spaces
If 'list' is on and 'listchars' includes tab:xy (where x and y are any
two characters, but see ":help option-backslash") a hard tab is
represented as one x and zero or more y (see examples under |lcs-tab|)
If 'list' is on and 'listchars' does not include tab: a hard tab is shown as ^I

Best regards,
Tony.

Igor Forca

unread,
Sep 25, 2017, 3:17:03 AM9/25/17
to vim_use
@Tim, @Tony, thanks for help.
It looks to me the simplest solution is to set bellow two settings in $VIMRC file:

set listchars=
set list

Thanks for help.

Reply all
Reply to author
Forward
0 new messages