How to display tabs characters as ^I

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to display tabs characters as ^I

Igor Forca
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

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to display tabs characters as ^I

Tim Chase
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





--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to display tabs characters as ^I

Tony Mechelynck
In reply to this post by Igor Forca
On Thu, Sep 21, 2017 at 12:59 PM, Igor Forca <[hidden email]> wrote:

> 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

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.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to display tabs characters as ^I

Igor Forca
In reply to this post by Igor Forca
@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.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.