Skip to content
Browse files

added jslint

  • Loading branch information...
1 parent 337e6e6 commit 6ef78e8420ff0cc80dd05a5712c470e7da26538b @gabesoft committed
View
2 .bashrc
@@ -61,7 +61,7 @@ alias s='sudo'
alias svisudo='sudo visudo' # edit the sudoers file
# delete
-alias rm='rm -i'
+alias ri='rm -i'
alias rf='rm -f'
alias rr='rm -f -r'
alias srm='sudo rm -i'
View
8 .jslintrc
@@ -0,0 +1,8 @@
+/*jslint
+ evil: true, browser: true, nomen: true, onevar: false, regexp: true, strict: false, white: false,
+ passfail: false, plusplus: true, fragment: true, eqeqeq: true, debug: false, devel: true
+ */
+
+/* global jQuery, $, Backbone */
+
+/* vim: set ft=javascript: */
View
13 .vim/bundle/jslint.vim/CHANGES
@@ -0,0 +1,13 @@
+# jslint.vim change log
+
+## v0.7
+
+- Updated jslint to version 2010-08-08.
+- Now checks for errors on leaving insert mode, cursor hold, and buffer save.
+- Changed from plugin to ftplugin specific to JavaScript files.
+- Supported JavaScript interpreters now include Node.js, Rhino, Spidermonkey,
+ Windows Script Host, and that interpreter that is installed by default in Mac
+ OS X.
+- Added support for overriding the JavaScript interpreter that is used by
+ setting a value for the JS_CMD environment variable.
+- Fixes bugs when running in Windows.
View
22 .vim/bundle/jslint.vim/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2008-2009 Jesse Hallett <hallettj@gmail.com>, except where
+otherwise noted
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
View
101 .vim/bundle/jslint.vim/README
@@ -0,0 +1,101 @@
+This is a mirror of http://www.vim.org/scripts/script.php?script_id=2729
+
+Vim plugin and command line tool for running JSLint (http://jslint.com/).
+
+JSLint is a handy tool that spots errors and common mistakes in JavaScript code.
+
+The source code for jslint.vim is hosted at (http://github.com/hallettj/jslint.vim).
+
+This is alpha software and is under heavy development.
+
+
+ Usage
+ -----------------------
+
+- This plugin automatically checks the JavaScript source and highlights the
+ lines with errors.
+
+ It also will display more information about the error in the commandline if the curser is
+ in the same line.
+
+- You also can call it manually via `:JSLintUpdate`
+
+- (optional) Add any valid JSLint options to `~/.jslintrc` file, they will be
+ used as global options for all JavaScript files.
+ For example:
+
+ /*jslint browser: true, regexp: true */
+ /*global jQuery, $ */
+
+ /* vim: set ft=javascript: */
+
+To get a detailed report of any issues in your JavaScript file outside of Vim,
+run the `bin/jslint` executable in a terminal. For example:
+
+ $ bin/jslint ftplugin/jslint/fulljslint.js
+
+You can copy `bin/jslint` into for `PATH` for easier access. The executable
+requires that the Vim plugin is installed and also requires Ruby.
+
+To disable error highlighting altogether add this line to your `~/.vimrc` file:
+
+ let g:JSLintHighlightErrorLine = 0
+
+
+Alternative Plugins
+---------------------
+
+There are other plugins for Vim that integrate JavaScript Lint (http://www.javascriptlint.com/). JavaScript Lint is another JavaScript checker that is similar to JSLint.
+
+jsl.vim (http://www.vim.org/scripts/script.php?script_id=2630) uses Vim's compiler infrastructure making its use consistent with syntax checkers for other languages.
+
+javaScriptLint.vim (http://www.vim.org/scripts/script.php?script_id=2578) runs the contents of a JavaScript file through JavaScript Lint after the file's buffer is saved and places any warnings in the quickfix error window.
+
+
+Credits
+---------
+
+- Jesse Hallett -- original author
+- Nathan Smith -- Windows compatibility, quickfix integration, better OS X
+ compatibility, support for node.js, and other improvements
+- Travis Jeffery -- Easy plugin installation with rake
+- Sam Goldstein -- Display of problem report for the current line and bug fixes
+- Bryan Chow -- Fixes for formatting issues and typos
+- Jeff Buttars -- Options to remove and to disable error highlighting
+- Rainux Luo -- Support for reading JSLint options from a `~/.jslintrc` file
+- Pascal Hartig -- Support for running jslint with rhino and other updates
+- Martin Schürrer -- Fixing path issues and error handling
+- Nik Graf -- Documentation updates
+- Ian McCracken -- Real-time error checking
+- Luke Smith -- Enhancement of OS X support
+- Michael Smith -- Feature to customize JavaScript executable that is used by
+ setting JS_CMD environment variable
+- Szilágyi Szilveszter -- Fixes for bugs when running in Windows
+
+
+License
+---------
+
+Copyright (c) 2008-2010 Jesse Hallett <hallettj@gmail.com>, except where
+otherwise noted
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
View
146 .vim/bundle/jslint.vim/README.markdown
@@ -0,0 +1,146 @@
+jslint.vim
+=============
+
+Vim plugin and command line tool for running [JSLint][].
+
+[JSLint]: http://jslint.com/
+
+JSLint is a handy tool that spots errors and common mistakes in
+JavaScript code.
+
+The source code for jslint.vim is hosted at
+<http://github.com/hallettj/jslint.vim>.
+
+This is alpha software and is under heavy development.
+
+
+Installation
+-----------------------
+
+- Make sure you have a JavaScript interpreter installed. On Linux jslint.vim
+ supports Spidermonkey, Rhino, and node.js. Spidermonkey or node.js are
+ recommended because Rhino tends to have a long startup time.
+
+ In Ubuntu you can install the Spidermonkey shell with this command:
+
+ $ sudo apt-get install spidermonkey-bin
+
+ Latest Ubuntu versions don't have spidermonkey in the default repositories.
+ You can use rhino instead:
+
+ $ sudo apt-get install rhino
+
+ Or you can find instructions for installing node.js on the [node.js website][nodejs].
+
+ [nodejs]: http://nodejs.org/
+
+ On Windows you can use `cscript.exe` - which is probably already installed.
+
+ On MacOS X you don't need to install any JavaScript interpreter because one
+ is included with OS X by default.
+
+- If you have rake installed, run:
+
+ $ rake install
+
+ Otherwise copy the directory ftplugin/ into your Vim ftplugin directory.
+ Usually this is `~/.vim/ftplugin/`. On Windows it is `~/vimfiles/ftplugin/`.
+
+ Usage
+ -----------------------
+
+- This plugin automatically checks the JavaScript source and highlights the
+ lines with errors.
+
+ It also will display more information about the error in the commandline if the curser is
+ in the same line.
+
+- You also can call it manually via `:JSLintUpdate`
+
+- (optional) Add any valid JSLint options to `~/.jslintrc` file, they will be
+ used as global options for all JavaScript files.
+ For example:
+
+ /*jslint browser: true, regexp: true */
+ /*global jQuery, $ */
+
+ /* vim: set ft=javascript: */
+
+To get a detailed report of any issues in your JavaScript file outside of Vim,
+run the `bin/jslint` executable in a terminal. For example:
+
+ $ bin/jslint ftplugin/jslint/fulljslint.js
+
+You can copy `bin/jslint` into for `PATH` for easier access. The executable
+requires that the Vim plugin is installed and also requires Ruby.
+
+To disable error highlighting altogether add this line to your `~/.vimrc` file:
+
+ let g:JSLintHighlightErrorLine = 0
+
+
+Alternative Plugins
+---------------------
+
+There are other plugins for Vim that integrate [JavaScript Lint][]. JavaScript
+Lint is another JavaScript checker that is similar to JSLint.
+
+[JavaScript Lint]: http://www.javascriptlint.com/
+
+[jsl.vim][] uses Vim's compiler infrastructure making its use consistent with
+syntax checkers for other languages.
+
+[jsl.vim]: http://www.vim.org/scripts/script.php?script_id=2630
+
+[javaScriptLint.vim][] runs the contents of a JavaScript file through
+JavaScript Lint after the file's buffer is saved and places any warnings in the
+quickfix error window.
+
+[javaScriptLint.vim]: http://www.vim.org/scripts/script.php?script_id=2578
+
+
+Credits
+---------
+
+- Jesse Hallett -- original author
+- Nathan Smith -- Windows compatibility, quickfix integration, better OS X
+ compatibility, support for node.js, and other improvements
+- Travis Jeffery -- Easy plugin installation with rake
+- Sam Goldstein -- Display of problem report for the current line and bug fixes
+- Bryan Chow -- Fixes for formatting issues and typos
+- Jeff Buttars -- Options to remove and to disable error highlighting
+- Rainux Luo -- Support for reading JSLint options from a `~/.jslintrc` file
+- Pascal Hartig -- Support for running jslint with rhino and other updates
+- Martin Schürrer -- Fixing path issues and error handling
+- Nik Graf -- Documentation updates
+- Ian McCracken -- Real-time error checking
+- Luke Smith -- Enhancement of OS X support
+- Michael Smith -- Feature to customize JavaScript executable that is used by
+ setting JS_CMD environment variable
+- Szilágyi Szilveszter -- Fixes for bugs when running in Windows
+
+License
+---------
+
+Copyright (c) 2008-2009 Jesse Hallett <hallettj@gmail.com>, except where
+otherwise noted
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
View
61 .vim/bundle/jslint.vim/Rakefile
@@ -0,0 +1,61 @@
+# written by travis jeffery <travisjeffery@gmail.com>
+# contributions by scrooloose <github:scrooloose>
+
+require 'rake'
+require 'find'
+require 'pathname'
+
+PLUGIN = [
+ "ftplugin/javascript/jslint.vim",
+ "ftplugin/javascript/jslint/jslint-core.js",
+ "ftplugin/javascript/jslint/runjslint.js",
+ "ftplugin/javascript/jslint/runjslint.wsf",
+]
+
+files = PLUGIN
+
+desc 'Zip up the project files'
+task :zip do
+ zip_name = File.basename(File.dirname(__FILE__))
+ zip_name.gsub!(/ /, '_')
+ zip_name = "#{zip_name}.zip"
+
+ if File.exist?(zip_name)
+ abort("Zip file #{zip_name} already exists. Remove it first.")
+ end
+
+ puts "Creating zip file: #{zip_name}"
+ system("zip #{zip_name} #{files.join(" ")}")
+end
+
+desc 'Install plugin and documentation'
+task :install do
+ vimfiles = if ENV['VIMFILES']
+ ENV['VIMFILES']
+ elsif RUBY_PLATFORM =~ /(win|w)32$/
+ File.expand_path("~/vimfiles")
+ else
+ File.expand_path("~/.vim")
+ end
+ files.each do |file|
+ target = File.join(vimfiles, file)
+ target_dir = File.dirname(target)
+ FileUtils.mkdir_p target_dir
+ FileUtils.cp file, target
+ puts "Installed #{file} to #{target_dir}/"
+ end
+
+end
+
+desc 'Pulls from origin'
+task :pull do
+ puts "Updating local repo..."
+ system("cd " << Dir.new(File.dirname(__FILE__)).path << " && git pull")
+end
+
+desc 'Calls pull task and then install task'
+task :update => ['pull', 'install'] do
+ puts "Update of vim script complete."
+end
+
+task :default => ['update']
View
25 .vim/bundle/jslint.vim/bin/jslint
@@ -0,0 +1,25 @@
+#!/usr/bin/env ruby
+
+target = File.expand_path(ARGV.first)
+
+if RUBY_PLATFORM =~ /win32/i
+ js_cmd = 'cscript'
+ runjslint_ext = 'wsf'
+ plugin_path = File.join(ENV['HOME'], 'vimfiles')
+else
+ if ENV['JS_CMD']
+ js_cmd = ENV['JS_CMD']
+ else
+ js_cmd = 'node'
+ end
+ runjslint_ext = 'js'
+ plugin_path = File.join(ENV['HOME'], '.vim')
+end
+
+Dir.chdir(File.join(plugin_path, 'bundle', 'jslint.vim', 'ftplugin', 'javascript', 'jslint')) do |dir|
+ IO.popen("#{js_cmd} runjslint.#{runjslint_ext}", 'r+') do |jslint|
+ jslint.write(File.open(target, 'r') { |f| f.read })
+ jslint.close_write
+ $stdout.write(jslint.read)
+ end
+end
View
188 .vim/bundle/jslint.vim/ftplugin/javascript/jslint.vim
@@ -0,0 +1,188 @@
+
+" Global Options
+"
+" Enable/Disable highlighting of errors in source.
+" Default is Enable
+" To disable the highlighting put the line
+" let g:JSLintHighlightErrorLine = 0
+" in your .vimrc
+"
+if exists("b:did_jslint_plugin")
+ finish
+else
+ let b:did_jslint_plugin = 1
+endif
+
+if has("win32")
+ let s:install_dir = '"' . expand("~/vimfiles/ftplugin/javascript") . '"'
+else
+ let s:install_dir = expand("<sfile>:p:h")
+endif
+
+au BufLeave <buffer> call s:JSLintClear()
+
+au BufEnter <buffer> call s:JSLint()
+au InsertLeave <buffer> call s:JSLint()
+"au InsertEnter <buffer> call s:JSLint()
+au BufWritePost <buffer> call s:JSLint()
+
+" due to http://tech.groups.yahoo.com/group/vimdev/message/52115
+if(!has("win32") || v:version>702)
+ au CursorHold <buffer> call s:JSLint()
+ au CursorHoldI <buffer> call s:JSLint()
+
+ au CursorHold <buffer> call s:GetJSLintMessage()
+endif
+
+au CursorMoved <buffer> call s:GetJSLintMessage()
+
+if !exists("g:JSLintHighlightErrorLine")
+ let g:JSLintHighlightErrorLine = 1
+endif
+
+if !exists("*s:JSLintUpdate")
+ function s:JSLintUpdate()
+ silent call s:JSLint()
+ call s:GetJSLintMessage()
+ endfunction
+endif
+
+if !exists(":JSLintUpdate")
+ command JSLintUpdate :call s:JSLintUpdate()
+endif
+
+noremap <buffer><silent> dd dd:JSLintUpdate<CR>
+noremap <buffer><silent> dw dw:JSLintUpdate<CR>
+noremap <buffer><silent> u u:JSLintUpdate<CR>
+noremap <buffer><silent> <C-R> <C-R>:JSLintUpdate<CR>
+
+" Set up command and parameters
+if has("win32")
+ let s:cmd = 'cscript /NoLogo '
+ let s:runjslint_ext = 'wsf'
+else
+ let s:runjslint_ext = 'js'
+ if exists("$JS_CMD")
+ let s:cmd = "$JS_CMD"
+ elseif exists("g:JSListCmd")
+ let s:cmd = g:JSListCmd
+ elseif executable('/System/Library/Frameworks/JavaScriptCore.framework/Resources/jsc')
+ let s:cmd = '/System/Library/Frameworks/JavaScriptCore.framework/Resources/jsc'
+ elseif executable('node')
+ let s:cmd = 'node'
+ elseif executable('js')
+ let s:cmd = 'js'
+ else
+ echoerr('No JS interpreter found. Checked for jsc, js (spidermonkey), and node')
+ endif
+endif
+let s:plugin_path = s:install_dir . "/jslint/"
+let s:cmd = "cd " . s:plugin_path . " && " . s:cmd . " " . s:plugin_path . "runjslint." . s:runjslint_ext
+
+let s:jslintrc_file = expand('~/.jslintrc')
+if filereadable(s:jslintrc_file)
+ let s:jslintrc = readfile(s:jslintrc_file)
+else
+ let s:jslintrc = []
+end
+
+
+" WideMsg() prints [long] message up to (&columns-1) length
+" guaranteed without "Press Enter" prompt.
+if !exists("*s:WideMsg")
+ function s:WideMsg(msg)
+ let x=&ruler | let y=&showcmd
+ set noruler noshowcmd
+ redraw
+ echo a:msg
+ let &ruler=x | let &showcmd=y
+ endfun
+endif
+
+
+function! s:JSLintClear()
+ " Delete previous matches
+ let s:matches = getmatches()
+ for s:matchId in s:matches
+ if s:matchId['group'] == 'JSLintError'
+ call matchdelete(s:matchId['id'])
+ endif
+ endfor
+ let b:matched = []
+ let b:matchedlines = {}
+ let b:cleared = 1
+endfunction
+
+function! s:JSLint()
+ highlight link JSLintError SpellBad
+
+ if exists("b:cleared")
+ if b:cleared == 0
+ call s:JSLintClear()
+ endif
+ let b:cleared = 1
+ endif
+
+ let b:matched = []
+ let b:matchedlines = {}
+
+ " Detect range
+ if a:firstline == a:lastline
+ let b:firstline = 1
+ let b:lastline = '$'
+ else
+ let b:firstline = a:firstline
+ let b:lastline = a:lastline
+ endif
+
+ let b:jslint_output = system(s:cmd, join(s:jslintrc + getline(b:firstline, b:lastline), "\n") . "\n")
+ if v:shell_error
+ echoerr 'could not invoke JSLint!'
+ end
+
+ for error in split(b:jslint_output, "\n")
+ " Match {line}:{char}:{message}
+ let b:parts = matchlist(error, "\\(\\d\\+\\):\\(\\d\\+\\):\\(.*\\)")
+ if !empty(b:parts)
+ let l:line = b:parts[1] + (b:firstline - 1 - len(s:jslintrc)) " Get line relative to selection
+
+ " Store the error for an error under the cursor
+ let s:matchDict = {}
+ let s:matchDict['lineNum'] = l:line
+ let s:matchDict['message'] = b:parts[3]
+ let b:matchedlines[l:line] = s:matchDict
+ if g:JSLintHighlightErrorLine == 1
+ let s:mID = matchadd('JSLintError', '\%' . l:line . 'l\S.*\(\S\|$\)')
+ endif
+ " Add line to match list
+ call add(b:matched, s:matchDict)
+ endif
+ endfor
+ let b:cleared = 0
+endfunction
+
+let b:showing_message = 0
+
+if !exists("*s:GetJSLintMessage")
+ function s:GetJSLintMessage()
+ let s:cursorPos = getpos(".")
+
+ " Bail if RunJSLint hasn't been called yet
+ if !exists('b:matchedlines')
+ return
+ endif
+
+ if has_key(b:matchedlines, s:cursorPos[1])
+ let s:jslintMatch = get(b:matchedlines, s:cursorPos[1])
+ call s:WideMsg(s:jslintMatch['message'])
+ let b:showing_message = 1
+ return
+ endif
+
+ if b:showing_message == 1
+ echo
+ let b:showing_message = 0
+ endif
+ endfunction
+endif
+
View
5,806 .vim/bundle/jslint.vim/ftplugin/javascript/jslint/jslint-core.js
5,806 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
87 .vim/bundle/jslint.vim/ftplugin/javascript/jslint/runjslint.js
@@ -0,0 +1,87 @@
+/*jslint laxbreak: true */
+
+if (typeof require != 'undefined') {
+ JSLINT = require('./jslint-core').JSLINT;
+ print = require('util').puts;
+} else {
+ load('jslint-core.js');
+}
+
+// Import extra libraries if running in Rhino.
+if (typeof importPackage != 'undefined') {
+ importPackage(java.io);
+ importPackage(java.lang);
+}
+
+var readSTDIN = (function() {
+ // readSTDIN() definition for nodejs
+ if (typeof process != 'undefined' && process.openStdin) {
+ return function readSTDIN(callback) {
+ var stdin = process.openStdin()
+ , body = [];
+
+ stdin.on('data', function(chunk) {
+ body.push(chunk);
+ });
+
+ stdin.on('end', function(chunk) {
+ callback(body.join('\n'));
+ });
+ };
+
+ // readSTDIN() definition for Rhino
+ } else if (typeof BufferedReader != 'undefined') {
+ return function readSTDIN(callback) {
+ // setup the input buffer and output buffer
+ var stdin = new BufferedReader(new InputStreamReader(System['in'])),
+ lines = [];
+
+ // read stdin buffer until EOF (or skip)
+ while (stdin.ready()){
+ lines.push(stdin.readLine());
+ }
+
+ callback(lines.join('\n'));
+ };
+
+ // readSTDIN() definition for Spidermonkey
+ } else if (typeof readline != 'undefined') {
+ return function readSTDIN(callback) {
+ var line
+ , input = []
+ , emptyCount = 0
+ , i;
+
+ line = readline();
+ while (emptyCount < 25) {
+ input.push(line);
+ if (line) {
+ emptyCount = 0;
+ } else {
+ emptyCount += 1;
+ }
+ line = readline();
+ }
+
+ input.splice(-emptyCount);
+ callback(input.join('\n'));
+ };
+ }
+})();
+
+readSTDIN(function(body) {
+ var ok = JSLINT(body)
+ , i
+ , error
+ , errorCount;
+
+ if (!ok) {
+ errorCount = JSLINT.errors.length;
+ for (i = 0; i < errorCount; i += 1) {
+ error = JSLINT.errors[i];
+ if (error && error.reason && error.reason.match(/^Stopping/) === null) {
+ print([error.line, error.character, error.reason].join(":"));
+ }
+ }
+ }
+});
View
39 .vim/bundle/jslint.vim/ftplugin/javascript/jslint/runjslint.wsf
@@ -0,0 +1,39 @@
+<job>
+<script src="jslint-core.js" language="javascript"></script>
+<script language="javascript">
+/*global JSLINT load readline WScript */
+
+var readSTDIN = function() {
+ var line,
+ input = [],
+ emptyCount = 0,
+ i;
+
+ var stdIn = WScript.stdIn,
+ stdOut = WScript.stdOut;
+
+ while (!stdIn.atEndofStream) {
+ line = stdIn.readLine();
+ input.push(line);
+ }
+
+ return input.join("\n");
+};
+
+var body = readSTDIN() || arguments[0],
+ ok = JSLINT(body),
+ i,
+ error,
+ errorCount;
+
+if (!ok) {
+ errorCount = JSLINT.errors.length;
+ for (i = 0; i < errorCount; i += 1) {
+ error = JSLINT.errors[i];
+ if (error && error.reason && error.reason.match(/^Stopping/) === null) {
+ WScript.echo([error.line, error.character, error.reason].join(":"));
+ }
+ }
+}
+</script>
+</job>
View
17 .vim/bundle/snipmate.vim/snippets/coffee.snippets
@@ -1,28 +1,22 @@
snippet if
if ${1:true}
${2}
-
snippet ife
if ${1:true}
${2}
else
${3}
-
snippet ift
${1} = if ${2:true} then ${3:first} else ${4:second}
-
snippet forin
${1:var} for $1 in ${2}
-
snippet forof
${1} = for ${2}, ${3} of ${4}
-
snippet try
try
${1:#code}
catch ${2:error}
${3:#code}
-
snippet tryf
try
${1:#code}
@@ -30,33 +24,28 @@ snippet tryf
${3:#code}
finally
${4}
-
snippet class class
class ${1:ClassName}
constructor: (${2:arguments})->
${3:#code}
-
snippet class class ... extends ...
class ${1:ClassName} extends ${2:ExtendedClassName}
constructor: (${3:arguments})->
${4:#code}
-
snippet switch
switch ${1}
when "${2}" then ${3}
when "${4}" then ${5}
${7:when}
else ${6}
-
snippet when
when ${1} then ${2}
-
snippet #
- #{${1}}
-
+ #{${1}}${2}
+snippet "
+ "${1}"${2}
snippet should
it 'should ${1:do stuff}', () ->
${2}
-
snippet lg
console.log ${1}
View
1 .vim/functions.vim
@@ -9,6 +9,7 @@ function! GlobalColorSettings()
highlight iCursor guifg=white guibg=red
highlight NonText guifg=#4A4A59
highlight SpecialKey guifg=#4A4A59
+ highlight SpellBad term=reverse ctermbg=1 gui=underline guisp=Red
hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
set showcmd
View
6 .vimrc
@@ -239,6 +239,11 @@ let g:MRU_Exclude_Files = 'COMMIT_EDITMSG\|^\/var\/folders\/kd\/.*\|^\/Users\/ga
let MRU_Window_Height = 20
nmap <leader>m :MRU<CR>u
+" jslint
+if executable('node')
+ let g:JSListCmd = 'node'
+endif
+
" key remapings
" ------------------------------------------------------------------------------
@@ -435,7 +440,6 @@ autocmd FileType java set tags=tags,$VIMHOME/tags/java.tags
" coffee-script view javascript code
autocmd FileType coffee nnoremap <C-M-V> :CoffeeView<CR>
-
" auto-compile coffee files when saved
autocmd BufWritePost,BufLeave,FocusLost *.coffee silent CoffeeMake -b | cwindow
View
16 .vimrc.view
@@ -115,20 +115,20 @@ setlocal nowrap
setlocal wrapmargin=0
silent! normal! zE
13,27fold
-379,456fold
-458,665fold
+384,460fold
+462,669fold
13
normal zo
-379
+384
normal zo
-458
-normal zc
-let s:l = 394 - ((67 * winheight(0) + 35) / 71)
+462
+normal zo
+let s:l = 244 - ((30 * winheight(0) + 30) / 60)
if s:l < 1 | let s:l = 1 | endif
exe s:l
normal! zt
-394
-normal! 054l
+244
+normal! 016l
let &so = s:so_save | let &siso = s:siso_save
doautoall SessionLoadPost
" vim: set ft=vim :
View
3 backup.dotfiles.sh
@@ -25,6 +25,9 @@ cp -f ~/.vim/tmp/views/~=+.vimrc= ~/dotfiles/.vimrc.view
cp -f ~/.vim/tmp/views/~=+.gitconfig= ~/dotfiles/.gitconfig.view
rsync -r ~/.vim ~/dotfiles/ --exclude 'tmp' --exclude '.git' --exclude '.vim/.netrwhist'
+# jslint
+cp -f ~/.jslintrc ~/dotfiles/
+
# pentadactyl
# ------------------------------------------------------------------------------
cp -f ~/.pentadactylrc ~/dotfiles/

0 comments on commit 6ef78e8

Please sign in to comment.
Something went wrong with that request. Please try again.