vim remove LF at the end
I start up vim and type 4 characters 'asdf', no Enter at the end..
however when I save the file, it is 5 bytes long, containing 'asdf' + linefeed character.. how can I make vim not to append the LF character at the end of my file? thanks for your help.. |
If you hadn't already solved your problem...
After having saved with vim the file, from console: cat file |head -c -1 >file #remove last character from file |
thanks.. this is great..
I have not solved it with vim, but this really helps.. thanks again |
To avoid appending the extra char in vim, you need to set the binary and noeol options, i.e:
:set bin :set noeol then save your file. You can add these commands to your .vimrc if you will want them for every file, but I think this case would normally be the exception. |
thanks.. this is great
|
All times are GMT -5. The time now is 07:25 PM. |