Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set softtabstop=0 when noexpandtab is set

softtabstop is useful when expandtab is set because it makes the
tab key a useful tool for indenting. When noexpandtab is set,
it causes the tab, >, and < keys to insert mixed spaces for
indentation which isn't a useful behavior. Setting to 0 disables
this and allows true tab characters to be used.

Fixes #1
  • Loading branch information...
commit 6725faba6ad6ee517dc6966c26381cb6e77c20ca 1 parent a4b900b
@ogier authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  plugin/guessindent.vim
View
2  plugin/guessindent.vim
@@ -124,9 +124,11 @@ fun! <SID>GuessIndent()
if l:leading_tabs >= 3 * l:leading_spaces
setl noexpandtab
+ let &l:softtabstop = 0
elseif l:leading_tabs >= 0.33 * l:leading_spaces &&
\ ! exists("g:guessindent_preferred_expandtab")
setl noexpandtab
+ let &l:softtabstop = 0
else
setl expandtab
let &l:shiftwidth = l:shortest_leading_spaces_run
Please sign in to comment.
Something went wrong with that request. Please try again.