[success] Integrating jsl into vim

2006-12-09
2013-05-28
  • Philipp Kewisch

    Philipp Kewisch - 2006-12-09

    I asked in my last post if it was possible, now I found out how.

    Note this configuration is for vim on cygwin, there may be some differences with vim directly on win32.

    1. Copy jsl.exe to /usr/bin
    2. Copy jsl.default.conf to /etc/jsl.conf
    3. Edit /etc/jsl.conf:
       - Comment out the line containing "+process"
       - Comment out the line containing "+pauseatend"
       - Set the line containing "+context" to "-context"

    2. Add the Following line to your vimrc:
       autocmd FileType javascript set makeprg=jsl\ -nologo\ -nofilelisting\ -nosummary\ -nocontext\ -conf\ '/cygwin/etc/jsl.conf'\ -process\ %
       autocmd FileType javascript set errorformat=%f(%l):\ %m^M
    3. If you want to process ALL files in the directory instead of just the current, use these lines instead
       autocmd FileType javascript set makeprg=jsl\ -nologo\ -nofilelisting\ -nosummary\ -nocontext\ -conf\ '/cygwin/etc/jsl.conf'\ -process\ '*.js'
       autocmd FileType javascript set errorformat=%f(%l):\ %m^M
    4. If you want to process ALL files recursively, use these lines instead:
       autocmd FileType javascript set makeprg=jsl\ -nologo\ -nofilelisting\ -nosummary\ -nocontext\ -conf\ '/cygwin/etc/jsl.conf'\ -process\ '*.js'\ -recurse
       autocmd FileType javascript set errorformat=%f(%l):\ %m^M

    Note that ^M should be a control character! To enter it, Press {Ctrl-V}{Ctrl-M}. If this dosen't work for you, just leave out ^M. Note also that if using method 3 or 4 and vim on cygwin, you will probably get vim errors about "unable to open swap file...". I have no way around this, but if you are ok with not having a swap file in vim (no recovery on crash), then thats fine.

    Hope this helps! Matthias, feel free to include this on your main page.
    Philipp

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks