Question

I have VIM version 7.3 with the spf13 bundle running on Debian Linux. I would like vim to not convert any line endings, just leave them alone. how can i accomplish this?

Was it helpful?

Solution 2

I figured out what was happening. First, I assumed that vim was changing my line endings because whenever i changed anything in a file and then looked at the diff in svn (or git same thing) i would see a bunch of lines that were modified that i never touched. Furthermore, none of these lines appeared to have any changes so i assumed that what was changed must have been the line endings. I was wrong

What was actually happening here is in my .vimrc file (supplied with the spf13 extension pack) there was use of the autocmd function which essentially allows you to modify your code automatically when it it loaded or saved. in my case the lines that were changed were changed because they had extra white spaces after the last visible character and the autocmd was removing these.

The solution:

comment out any lines that start with autocmd in your .vimrc (this is done by preceding them with a ")

OTHER TIPS

You could also edit the ~/.vimrc.before file and uncomment:

let g:spf13_keep_trailing_whitespace = 1

This should have the same effect without editing the main .vimrc file

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top