문제

Is there a way to configure Vim so it combines tabs to use as horizontal indentation character, and spaces as vertical indentation character (for instance, when continuing long lines, giving out arguments to methods)? Basically, something like this (i have marked tabs with > and spaces with dot):

class xyz {
>   function abc()
>   {
>   >   $var1 = "this is a multi-"
>   >   ......+ "line string which spans "
>   >   ......+ "several lines";
>   }
}

Ideas or suggestions?

Edit: I'm not looking how to use spaces instead of tabs, I'd like to combine them in a way I described above.

도움이 되었습니까?

해결책

There is a "Smart Tabs" script that may be what you're looking for. It describes itself as using tabs for indentation and spaces for alignment.

다른 팁

Add the below lines to $HOME/.vimrc

set tabstop=4
set shiftwidth=4
set expandtab

This should set a tab to 4 spaces.
Here is the VIM Wiki on this: http://vim.wikia.com/wiki/Converting_tabs_to_spaces

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top