Syntax checking from vim is handy. By checking your Javascript syntax from vim, rather than the browser, you'll save time and aggravation. To do it, you'll need Spidermonkey, which allows you to run Javascript without a browser, and JsLint, a Javascript syntax-checker writter in Javascript.
Installing Spidermonkey
Consult the build instructions page for installation instructions for many architectures, or use the quick instructions below for Ubuntu and Centos.
Quick install for UbuntuQuick install for Centos 5sudo apt-get install spidermonkey-bin.wget http://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz tar zxvf js-1.7.0.tar.gz cd js/src make -f Makefile.ref mv Linux_All_DBG.OBJ/js /usr/bin
Once you've installed Spidermonkey you'll be able to enter a Javascript shell by entering the command 'js' (exit with CTRL-d).
Setting Up JsLint
Next you'll need to download the JsLint Javascript syntax checking library. JsLint is composed of one Javascript file: fulljslint.js.
Download it and put it somewhere handy, for example:
wget http://www.jslint.com/fulljslint.js mv fulljslint.js /home/admin/bin/js
Running JsLint
Next you'll need to add a Javascript file which will implement JsLint, using the technique outlined by Ian Bicking.
For example, I could create a file called runjslint.js like this as /home/admin/bin/js/runjslint.js:
load('/home/admin/bin/js/fulljslint.js');
var body = arguments[0];
var result = JSLINT(body);
if (result) {
print('All good.');
} else {
print('Problems:');
}
print(JSLINT.report());This file, when ran using Spidermonkey, will check the syntax of Javascript data passed as a command line argument.
Integrating with Vim
Next you'll need to add a line to your .vimrc script to allow you to enter a command for syntax checking.
Here's an example that enables me to syntax check by typing ":js
cabbr js !js /home/admin/bin/js/runjslint.js "`cat %`"
Formatting JsLint's Results
Last, but not least, you may want to add this Python script to change JsLint's results from HTML/CSS to plain text. Put this script in an appropriate place, for example '/home/admin/bin/python/format_lint_output.py'.
#!/usr/bin/python
import sys
import re
def format_lint_line(line):
line = line.replace('<p>', '\n')
line = line.replace(' ', ' ')
return line
def remove_html_tags(data):
p = re.compile(r'<.*?>')
return p.sub('', data)
for line in sys.stdin:
print remove_html_tags(format_lint_line(line)),Change your .vimrc file to use it as a filter.
For example:
cabbr js !js /home/admin/bin/js/runjslint.js "`cat %`" \| /home/admin/bin/python/format_lint_output.py

Sat, 2010-02-06 01:17
nowGoogle.com adalah Multiple Search Engine Popular agar semakin membuka
Peluang Usaha Ahasu Gnaulep yang bisa membuat kita memiliki
Efek Blogging Terhadap Motivasi Diri
Jasa Pembuatan Blog
Paket Ebook Bisnis
Blog Bisnis Online
Blog Motivasi
Increase Your Traffic With Klikrar
Financial Journey
Aetna Health Insurance
Free Download Mp3
Blogging Resources
Professional Journal
bibit parfum
Bisnis Hosting
Tue, 2010-02-02 12:25
メル友
メル友
逆援助
メル友
援交
セフレ
セフレ
セフレ
セフレ
セックスフレンド
逆援助
逆援助
出会い
出会い
出会い
メル友
出会い
出会い
処女
Thanks a lot!!
Mon, 2010-02-08 09:38
メル友
メル友掲示板onouesou
メル友募集
家出掲示板
家出サイト
神待ち
Sat, 2010-02-06 04:20
恋人探し
セフレ素人
出会いと失恋
暇な人妻の日記
政治との出会い
日常の出会い
出会い系で釣られる
無料出会いサイト
家出掲示板の主婦
援助交際して下さい!
出会いサイト
出会いのサイト
出会いのサイト
セフレとしたい
セフレがほしい
セフレとやりたい
セフレを作ろう
セフレが理想
Tue, 2010-02-02 08:15
Syntastic comes in two parts: the syntax checker plugins, and the core script
(i.e. syntastic.vim). 646-223 dumps The syntax checker plugins are defined on a per-filetype
basis where each one wraps up an external syntax checking program. The core
script delegates off to these plugins and uses their output to provide the syntastic functionality. Currently, syntax checking plugins exist for eruby,
haml, html, javascript, php, 642-357 dumps python, ruby and sass. If your language is not supported then see |syntastic- VCP-410 dumps syntax-checkers| for details on how to implement a syntax checking plugin, and be sure to send me a
patch ;-)
Thu, 2010-01-28 01:22
流水线
Wed, 2010-01-13 16:08
味噌は日本の心、味噌さえあれば、食が進む
Wed, 2010-01-20 09:52
セックスフレンド
家出
ロリコン
人妻
神待ち
逆援助交際
逆援
家出掲示板
逆援shimop
逆援助
家出
家出掲示板
家出サイト
神待ち
ネット出会い
アダルトライブチャット
家出少女掲示板
家出サイト
援交
逆援助交際
Mセカンエロ写メ
援助交際
恋人探し
メル友
Mon, 2010-02-08 09:39
メル友
メル友掲示板onouesou
メル友募集
家出掲示板
家出サイト
神待ち
Thu, 2009-11-12 07:10
イーモバイル ヒアルロン酸 毛穴 黒ずみ 育児相談 美白 結婚相談所
Thu, 2009-11-12 07:08
イーモバイル ヒアルロン酸 毛穴 黒ずみ 育児相談 美白 結婚相談所
Thu, 2009-10-29 10:20
shown publicly水泵
离心泵
隔膜泵
排污泵
磁力泵
Thu, 2009-10-29 10:18
水泵
离心泵
隔膜泵
排污泵
磁力泵
化工泵
螺杆泵
多级泵
自吸泵
卫生泵
真空泵
往复泵
深井泵
油桶泵
胶体磨
屏蔽泵
纸浆泵
计量泵
Thu, 2009-10-29 10:17
水泵
离心泵
隔膜泵
排污泵
磁力泵
化工泵
螺杆泵
多级泵
自吸泵
卫生泵
真空泵
往复泵
深井泵
油桶泵
胶体磨
屏蔽泵
纸浆泵
计量泵
试压泵
潜水泵
液下泵
耐酸泵
旋涡泵
转子泵
沥青泵
食品泵
空调泵
砂浆泵
消防泵
油泵
氟塑料泵
水泵配件
玻璃钢泵
水泵控制柜
水力喷射器
管道离心泵
给排水设备
Wed, 2009-10-28 19:07
Excellent post thank you very much for taking the time to share with those who are starting on the subject. Greetings
Fri, 2009-10-23 06:35
lovely shop
great online store
nice shop
wholesale china
wholesale china
fashion boutique
replica handbags
fashion doorbell
fshion e-store
Discussion About Louis VuittonMonogram Vernis Alma
Tue, 2009-10-20 01:31
一人暮らし インテリア 観葉植物 競馬予想ソフト
Sun, 2009-10-18 16:15
منتدى
دعم المواقع برامج حماية برامج النت برامج محمولة برامج نوكيا العاب نوكيا كرة القدم العاب كمبيوتر العاب بلاي ستيشن
العاب تورنت افلام كرتون العاب اطفال صور كرتون اغاني اطفال مطبخ المنتدى قــســم التشويق والاثارة منتدى التجارين
منتديات منتدانا
برج الجدى ,
برج الحمل ,
برج الميزان ,
برج الجوزاء ,
برج الحوت ,
برج العذراء ,
برج العقرب ,
برج الاسد ,
برج القوس ,
برج الثور ,
برج الدلو ,
برج السرطان
,
الابراج الصينية
صور عربيات , تحميل ثيمات نوكيا
, صور انتريهات
, طبخ جزائرى ,
اجدد الرسائل الرومانسية
, صور
دراغون بول ,
صور رعب ,
صور حزينه ,
المحاسبة
المالية ,
كوانزو
, ليلة
الدخله
switchsniffer شرح
,
اغاني عيد ميلاد
, حمامات
, غرف نوم الاطفال
, ستائر
, صالونات
, غرف النوم
, silkroad لعبة
اذكار الصباح والمساء
, محمد حسين يعقوب
, تفسير القران الكريم
مفاتيح كاسبر سكاي
, كاسبر سكاى , المواقع الاباحية
, مسلسل القناص
العاب باربى |
صور رعب |
الهالات السوداء
|
ملفات
psd |
خطوط للفوتوشوب |
ميريام |
طيور|
طلبات الاستضافة/الدومينات
الحوار العام
الشباب والبنات
التعارف
قضايا
المدونات
السياحة والسفر
العلوم النفسية
برامج مهمة
برامج الرسم
برامج الملتيمديا
الويندوز
برامج متنوعة
ثيمات نوكيا
مقاطع البلوتوث
الرسائل
كرة القدم العالمية
كرة القدم العربية
كرة القدم المصرية
المصارعة
شفرات الالعاب
الضحك والفرفشة
الكاريكاتير
السيارات
اليوتيوب
الافلام الاجنبية
الصور
تعليم جرافيكس
تزيين العروسة
العناية بالبشرة
الديكور
الاثاث
مطبخ
قصص رومانسية
كلام فى الحب
قصص رعب
طيور الزينة
اسماك
الصيد
اللغة الانجليزية
اللغة الفرنسية
اللغة الالمانية
اللغة الايطالية
الحاسب الالى
المحاسبة
البورصة
الشهادات التجارية
استضافة مواقع ومنتديات
اغاني الكرتون
امتحان ثانويه
عامه
Winning Eleven
نغمات مضحكة
القصص الاسلامية
الصور الاسلامية
صيانة الموبايل
برنامج رسم
صور حب
Sun, 2009-10-18 13:46
バイアグラ
超威龍
児童文学
チューハイ
アイス
花
漢字
猫の飼育
言葉
フィギュアスケート
パ・リーグ
化粧水
Sat, 2009-10-17 02:27
床暖房 価格
香水 価格
財布 価格
アクセサリー 価格
自転車 価格
ノート 価格
REGZA 42Z8000価格
BRAVIA KDL-40F5価格
EOS 50D 価格
D700 価格
COOLPIX P90 価格
is wonderful
Wed, 2009-07-15 14:44
awesome tutorial, man. I don't know what most js hackers use. Maybe notepad plus firebug? Anyway, your tutorial saved me a TON of time adapting my habitual linux/vim/php environment to js.
Suggestion: while it's nice to see an attempt at a CAPTCHA in your submit form, you might want to check out recaptcha to get something more ironclad in place and prevent any more chinese spam from piling up.
Anyway, thanks again
Fri, 2009-01-23 17:10
You can have vim auto-lint for you:
:autocmd BufWritePre,FileWritePre,FileAppendPre *.js js
You may prefer to use the *Post instead of the *Pre.
Sun, 2008-08-31 19:25
The next step would be making it integrate with Quickfix, I suppose. I do that with Python, so I type :make to syntax check my Python code.
Wed, 2010-01-13 20:11
This is exactly what I was looking for. Thanks for sharing this great article! That is very interesting Smile I love reading and I am always searching for informative information like this!
Top 10 MMA Pound For Pound Fighter Rankings | Mixed martial arts | Mma Pound For Pound day 1
Sun, 2008-08-31 07:53
eclim is a very weird project that tries to integrate vim with eclipse, but even if you don't use that, it comes bundled with integrated jslint checking. It's awesome. When you write out the file, it flags any lint errors in the file with a "sign" (type ":help signs").
http://eclim.sf.net
Sun, 2008-09-07 02:57
Very nice post, sir. Thanks for this.
I just posted a bit on my blog about using Lynx instead to filter the HTML output into plaintext. Maybe prettier output than the Python script.
Thanks again -- makes my JavaScripty day-to-day just a bit nicer.
Matthew
Tue, 2009-10-13 09:03
Djerba wczasy
Meksyk Last Minute
wczasy meksyk acapulco
wycieczki wczasy cancun
Goa Wakacje
Dubaj last minute
Jamajka last minute
Barbados wakacje
polinezja francuska wakacje
sri lanka last minute
Tanzania wycieczki
Zanzibar
fuertaventura last minute
Rejsy morskie
wycieczkowe
Last Minute all
inclusive wycieczki
Egipt last minute
wycieczki
first minute 2010
wczasy 2010 all
inclusive wycieczki wczasy bali tajlandia kuba teneryfa dominikana
wakacje
Thu, 2008-11-13 16:16
This and other blog posts inspired me to come up with another method, so I altered the rhino version so that it works with spidermonkey as a pipe or redirect target. It's a bit more flexible, doesn't require html parsing, and a pantload faster than the Rhino version. Enjoy!
http://whereisandy.com/code/jslint
Sat, 2010-02-06 01:12
Thanks for share this :)
nowGoogle.com adalah Multiple Search Engine Popular agar semakin membuka
Peluang Usaha Ahasu Gnaulep yang bisa membuat kita memiliki
Efek Blogging Terhadap Motivasi Diri
Jasa Pembuatan Blog
Paket Ebook Bisnis
Blog Bisnis Online
Blog Motivasi
Increase Your Traffic With Klikrar
Financial Journey
Aetna Health Insurance
Free Download Mp3
Blogging Resources
Professional Journal
bibit parfum
Bisnis Hosting
Thu, 2009-10-15 10:17
出会い系サイトにで安心の出会いを楽しんでみませんか?
出会い系サイトは出会うためのサイトなので確実に出会いが探せます!
出会い系サイトに登録している方生活していて出会いがあまりない方ばかりです!
出会い系サイトは安心で優良です!
出会い系サイトの登録は無料ででき、
出会い系サイトトでは楽しく出会うことが出来ます!
出会い系サイトの中には悪徳の
出会い系サイトのありちゃんと出会い系サイトを見極める必要があります!
出会い系サイトの見極め方はとてもかんたんで
出会い系サイト紹介所の紹介に掲載されているサイトなどが
出会い系サイトの中でも信用が出来る
出会い系サイトなんだと思います!
出会い系サイトにはとても多くの会員がいてその中には
出会い系サイトから誘導させて悪徳の
出会い系サイトに登録をされようとしてきます!
出会い系サイトでこういったユーザーに出会わないことが
出会い系サイトで出会える秘訣だと思います!
出会い系サイトはみなさんの出会いのために
出会い系サイトを経営しています!
出会い系サイトに抵抗がある方も一度無料の
出会い系サイトで出会いをしてみませんか??
出会い系サイトは貴方の出会いの気持ちを応援いたします!
出会い系サイトで素敵な出会いを見つけましょう!
Sun, 2009-10-18 13:47
児童文学
チューハイ
アイス
花
漢字
猫の飼育
言葉
フィギュアスケート
パ・リーグ
化粧水
Sun, 2009-10-25 21:55
I havent any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us.
Kenali Dan Kunjungi Objek Wisata Di Pandeglang | Love For Blogging | Belajar SEO Blogspot | Miss925 | seo go blog | Kenali dan kunjungi objek wisata di pandeglang | 6 M U | Apa Sih Asyiknya Belajar SEO?
Sat, 2010-01-09 04:00
中古DVD
DVD
中古ビデオ
ドカベン
韓国ドラマを紹介
中古ビデオ
オダギリジョー
デスメタル
アダルトDVD
アダルトDVD
チュモン
栗林里莉
香椎由宇
ドラゴンボールZ
星のカービィ
武勇伝
韓国ドラマ
中古DVD
中古DVD
牧場の少女カトリ
セックス・アンド・ザ・シティ
妖怪人間ベム
アダルトDVD
チャン・ドンゴン
伊勢谷友介
イ・ビョンホン
キム・ヘス
ペ・ヨンジュン
イ・ボヨン
アダルトDVD
持田茜
Thu, 2009-10-29 08:16
割り切り
セックスフレンド
処女
割り切り
割り切り処女セックスフレンド
Mon, 2010-01-25 20:17
Nice tutorial but the comments are spammy