On 15-Mar-2014 10:06 +0100, Andre Sihera wrote: > Hi all, > > I have found an annoyance with the tab indenting (SHIFT + '>', SHIFT + > '<') and > was wondering if this was by design or should be fixed. > > My .vimrc contains the following: > > set ts=4 > set shiftwidth=4 > > So, when I visually select a block of text and press SHIFT + '>' it will > insert > a tab on the left on each line and the block moves four characters to > the right. > > However, this feature does not honour leading whitespace within each > line. I use a > mixture of tabs and whitespace to ensure that my code looks uniform on > all platforms > no matter what the tab size. However, the tab indent breaks this. For > example, > if I have the following text at ts=4 (a full stop "." character > indicates a space): > > TAB>sprintf(szSomeVariable, > TAB>........"Some text %i, %i, %i, %i\n", > TAB>........some_very_long_expression_that_takes_up_most_of_the_line_#1, > TAB>........some_very_long_expression_that_takes_up_most_of_the_line_#2, > TAB>........some_very_long_expression_that_takes_up_most_of_the_line_#3, > TAB>........some_very_long_expression_that_takes_up_most_of_the_line_#4); > > and I visually highlight the above block and press SHIFT + '>', I would > expect > it to look as follows: > > TAB>TAB>sprintf(szSomeVariable, > TAB>TAB>........"Some text %i, %i, %i, %i\n", > TAB>TAB>........some_very_long_expression_that_takes_up_most_of_the_line_#1, > > TAB>TAB>........some_very_long_expression_that_takes_up_most_of_the_line_#2, > > TAB>TAB>........some_very_long_expression_that_takes_up_most_of_the_line_#3, > > TAB>TAB>........some_very_long_expression_that_takes_up_most_of_the_line_#4); > > > However, it actually looks like this: > > TAB>TAB>sprintf(szSomeVariable, > TAB>TAB>TAB>TAB>"Some text %i, %i, %i, %i\n", > TAB>TAB>TAB>TAB>some_very_long_expression_that_takes_up_most_of_the_line_#1, > > TAB>TAB>TAB>TAB>some_very_long_expression_that_takes_up_most_of_the_line_#2, > > TAB>TAB>TAB>TAB>some_very_long_expression_that_takes_up_most_of_the_line_#3, > > TAB>TAB>TAB>TAB>some_very_long_expression_that_takes_up_most_of_the_line_#4); > > > i.e., ViM is being too clever and compressing all my whitespace into > tabs when I > didn't ask it to. > > Is this by design? Has it been fixed since my ancient version of ViM > (7.3.475)? > Did I miss something in the docs? Or is this just a "feature"?
I think you're looking for :set preserveindent copyindent -- regards, ingo -- -- You received this message from the "vim_dev" 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_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.