Vim logo vim online Vim Book Ad

basic Tip #243: Develop vim modules on Win

 tip karma   Rating 0/4, Viewed by 705 

created:   May 7, 2002 5:00      complexity:   basic
author:   SANFACE Software      as of Vim:   6.0

We're trying to develop txt2pdf.vim http://vim.sourceforge.net/scripts/script.php?script_id=283 on Win.
It's a very simple module to save the current file and convert it to PDF using our txt2pdf tool http://www.sanface.com/txt2pdf.html
On our Windows 2000 we've developed it. It works good.
Today we've tested the module on Linux. Surprise: it doesn't work.
Default Win Vim configure save on Win text in Win way: EOL \r\n.
A Vim module made in this way can't work on Linux (probably on every Unix OS).
If you want to make a Vim module on Win and you want it can work also on Unix (we hope the same rula can work also on different OS) you've to save the Vim module with Unix EOL (\n).

Please send us ([email protected]) your notes about other OS (e.g. OpenVMS).

 rate this tip  Life Changing Helpful Unfulfilling 

<<The power of "\_" in reg-ex | Ask vim where an option was set. >>

Additional Notes

[email protected], May 12, 2002 8:15
     I believe that Vim scripts saved with UNIX-style EOL characters can run on any platform.
Probably the easiest way to make sure they stay this way is to add a modeline at the top
or bottom of the file, for example

" vim:ff=unix

:help modeline
:help :source_crnl
:help 'fileformat'
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
SourceForge Logo