Vim tab to 2 spaces not working properly -
this question has answer here:
set tabstop=2 set shiftwidth=2 set softtabstop=2 set expandtab set autoindent
is in .vimrc. however, tabbing inconsistent, resulting in tab instead of 2 spaces. missing something? used work before upgrading ubuntu. program python.
thanks!
set smarttab
well. use set expandtab shiftwidth=4 softtabstop=4 smarttab
from vim's :help smarttab
when on, tab in front of line inserts blanks according 'shiftwidth'. 'tabstop' or 'softtabstop' used in other places. backspace delete 'shiftwidth' worth of space @ start of line.
when off, tab inserts blanks according 'tabstop' or 'softtabstop'. 'shiftwidth' used shifting text left or right shift-left-right.
what gets inserted (a tab or spaces) depends on 'expandtab' option. see ins-expandtab. when 'expandtab' not set, number of spaces minimized using tabs. note: option reset when 'compatible' set.
Comments
Post a Comment