0

The wanted behavior for many on Spf13 VIM is to eat up any whitespace or tabs on an empty line. I am working on an existing project, and I've got a lot of these changes in the change log:

enter image description here

How can I stop Spf13 VIM from deleting these tabs on empty lines?

Edit:

Never mind, it does work. Answering my own question now.

dan-klasson
  • 13,734
  • 14
  • 63
  • 101
  • 1
    Wouldn't it be preferable to set your diff tool to ignore whitespace? – Kyle Strand Dec 10 '14 at 17:00
  • 1
    Also, I do not believe Vim does this by default; what plugins are you using? – Kyle Strand Dec 10 '14 at 17:01
  • @KyleStrand: That's Github. I should have mentioned that. I'm using standard Spf13 install. – dan-klasson Dec 10 '14 at 17:03
  • 7
    @dan-klasson the "standard Spf13" is not standard at all. You don't know what is going on when you are using so called vim-distribution. But if you chose that way, post issue to the author once you got problem. – Kent Dec 10 '14 at 17:07
  • @Kent: I mean standard as in the standard install. Haven't added any additional plugins. – dan-klasson Dec 10 '14 at 17:14

2 Answers2

2

Found this in the Spf13 .vimrc file:

" To disable the stripping of whitespace, add the following to your
" .vimrc.before.local file:
"   let g:spf13_keep_trailing_whitespace = 1

After adding that it worked, also for tabs.

dan-klasson
  • 13,734
  • 14
  • 63
  • 101
1

If you use Python-mode, maybe setting its pymode_trim_whitespaces to zero will help:

let g:pymode_trim_whitespaces = 0
Júda Ronén
  • 294
  • 1
  • 10
  • I checked and Spf13 seems to be using `python-mode`. But it's not working, I apply the above from within vim. Add a tab on an empty line, save it and exit. And when I open the file again the tab is gone. – dan-klasson Dec 10 '14 at 17:23