How does one get uniform tabs/spaces to display properly in other programs (like Less)?
For example, say I am modifying my .vimrc in Vim and I've created two columns on the same line (one for rule and one for comment).
In Vim the comments all line up:
set textwidth=80 " set line length
set tabstop=4 " how many cols a tab counts for
set expandtab " insert spaces for <tab>
set softtabstop=4 " tabs are 4 spaces
set shiftwidth=4 " indent/outdent by 4 cols
Now for the sake of example, say I open it again in Less. The output would be something like:
set textwidth=80 " set line length
set tabstop=4 " how many cols a tab counts for
set expandtab " insert spaces for <tab>
set softtabstop=4 " tabs are 4 spaces
set shiftwidth=4 " indent/outdent by 4 cols
Am I unknowingly mixing a combination of tabs and spaces? Or does it have to do with my tab settings?
<tab>
and<space>
to align these comments? Did you use something like tabular or vim-easy-align? – Peter Rincker Sep 25 '15 at 15:00<tab>
and possibly<space>
– sussibar Sep 25 '15 at 15:02:set list
to see the tabs in Vim. You can settabstop
to 8 andsofttabstop
andshiftwidth
to 4 and get the editing behavior you want while preserving compatibility with other programs such asless
. – garyjohn Sep 25 '15 at 15:39