Questions tagged [tab-characters]

Question about how to handle white spaces tab characters with vim, insert them, remove them, convert them to space characters, etc...

Filter by
Sorted by
Tagged with
8
votes
2answers
6k views

Vim doesn't use the correct indentation in Python files

I have encountered something that I have never seen before in Vim. While I was tentatively modifying some of the source code for software I've been planning to work on, I noticed vim was displaying ...
114
votes
5answers
119k views

How to replace tabs with spaces?

Is it possible to convert tabs to spaces, while maintaining text alignment? Simply replacing only works usefully when there are no leading characters.
164
votes
8answers
185k views

Displaying tabs as characters

When I work on files in python, I sometimes mistake tabs for spaces and vice versa. Is there a way I can get Vim to display a character for a tab instead of a tab?
28
votes
4answers
28k views

What is `softtabstop` used for?

I've been aware of these tab related settings in Vim: ts sw expandtab smarttab sts My normal setting is set ts=4 sw=4 expandtab smarttab. But according to sts documentation, if expandtab is not ...
14
votes
2answers
10k views

Show listchars tab as spaces

I use list and listchars to show my whitespace, but the code style I adhere to uses tabs. Seeing > or ^I for all of my tabs is nauseating. How would I keep all of my existing list characters but ...
6
votes
1answer
71 views

Why are tabs adjacent to concealed tabs displayed wider than a single tabstop?

I just wrote the following code in an answer to another question: syntax match HideTwoIndents /\v^\t(\t)?/ conceal set conceallevel=2 This works great if 'list' is set and if 'listchars' does not ...
3
votes
3answers
651 views

Avoid spaces getting converted to tabs automatically during shift(>>)

I use 2 spaces as indentation. So I set shiftwidth using :set sw=2. However when I do the shift operator(>>) on a line twice, the indentation converts the 4 spaces automatically to a tab. So to ...
1
vote
0answers
103 views

Files with tabs are length 8 even with set tabstop=4 in vimrc [duplicate]

I have most of the usual tab commands in ~/.vimrc: set tabstop=4 set softtabstop=4 set shiftwidth=4 set expandtab set breakindent set autoindent set smartindent. There are no problems when I open a ...
0
votes
2answers
2k views

Getting Shift-Tab to work in VIM Insert mode

I've been trying to get Shift+Tab or <S-Tab> to work in VIM and for the life of me I can't figure it out. I read this document, but the remap solution only works for normal mode (because if I ...