Robert Hicks <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > my friend uses vim > > and i use xemacs > > so our shared python code is a mix of tabs and spaces and it is hard > > for him to edit it in vim > > any idea on how to make it clean > > convert it all to 4 spaces? > > Thanks > > > > :set ts=4 > :retab! > > :h retab
ASCII TAB stops have only one defined width: 8 columns. Set "tabstop" to 8. Instead, use Vim's "softtabstops" feature, where the editor will backspace over space sequences as though there were "hard tabs" there; and the "shiftwidth" setting, to determine how many columns the "indent" and "dedent" commands move text. Then, use "expandtabs" so that ASCII TABs (and the <Tab> key) are converted to space sequences. Use "retab" to convert all tabs in the current buffer. ===== $HOME/.vim/vimrc ===== [...] " indent shift interval (for shifting text blocks in/out) set shiftwidth=4 " tab stop interval (for literal ASCII TAB character) set tabstop=8 " tab stop interval (for pressing <Tab> key) set softtabstop=4 " expand <Tab> chars to spaces? set expandtab ===== The important thing to do, more than a once-off conversion, is to ensure that your project's "tabs" or "no tabs" policy is automatically enforced from that point on for all files edited. -- \ "In the long run, the utility of all non-Free software | `\ approaches zero. All non-Free software is a dead end." —Mark | _o__) Pilgrim | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list