diff --git a/emacs b/emacs index fcf4c23..8e71520 100644 --- a/emacs +++ b/emacs @@ -28,6 +28,9 @@ ;disable vc-git (dont use it and too slow to start up) (setq vc-handled-backends nil) +;dont use tabs! +(setq-default indent-tabs-mode nil) + ;auto-indent (define-key global-map (kbd "RET") 'newline-and-indent) @@ -40,6 +43,9 @@ (require 'flymake-cursor) (add-hook 'find-file-hook 'flymake-find-file-hook) +(require 'flymake-jshint) +(add-hook 'js-mode-hook 'flymake-mode) + (require 'projectile) (setq projectile-completion-system 'grizzl) (setq projectile-enable-caching t) diff --git a/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-autoloads.el b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-autoloads.el new file mode 100644 index 0000000..cb16c57 --- /dev/null +++ b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-autoloads.el @@ -0,0 +1,18 @@ +;;; flymake-jshint-autoloads.el --- automatically extracted autoloads +;; +;;; Code: + + +;;;### (autoloads nil nil ("flymake-jshint-pkg.el" "flymake-jshint.el") +;;;;;; (21025 54429 922272 0)) + +;;;*** + +(provide 'flymake-jshint-autoloads) +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; coding: utf-8 +;; End: +;;; flymake-jshint-autoloads.el ends here diff --git a/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-pkg.el b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-pkg.el new file mode 100644 index 0000000..cacd795 --- /dev/null +++ b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-pkg.el @@ -0,0 +1 @@ +(define-package "flymake-jshint" "1.0" "making flymake work with JSHint" (quote nil)) diff --git a/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-pkg.elc b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-pkg.elc new file mode 100644 index 0000000..e2dfe2e Binary files /dev/null and b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint-pkg.elc differ diff --git a/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint.el b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint.el new file mode 100644 index 0000000..c5d174b --- /dev/null +++ b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint.el @@ -0,0 +1,119 @@ +;;; flymake-jshint.el --- making flymake work with JSHint + +;; Copyright (C) 2011 Wilfred Hughes + +;; Author: Wilfred Hughes +;; Created: 23 June 2011 +;; Version: 1.0 +;; Keywords: flymake, jshint, javascript + +;; This file is not part of GNU Emacs. +;; However, it is distributed under the same license. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary + +;; To use JSHint with emacs, you will need JSHint installed and available on +;; your path. You should be able to do + +;; $ jshint + +;; without problem. To do this, you can install node.js, npm and +;; jshint by doing the following: + +;; $ apt-get install nodejs # or your distro / OS equivalent +;; $ curl http://npmjs.org/install.sh | sh +;; $ npm install -g jshint + +;; You will probably want to configure the warnings that JSHint +;; produces. The full list is at http://www.jshint.com/options/ but +;; for reference I use: + +;; { "browser": true, //browser constants, such as alert +;; "curly": true, // require {} on one-line if +;; "undef": true, // non-globals must be declared before use +;; "newcap": true, // constructors must start with capital letter +;; "jquery": true, // jQuery constants +;; "nomen": false, // permit leading/trailing underscores, these do actually mean private in jQuery plugins +;; "nonew": true, // don't permit object creation for side-effects only +;; "strict": true // require "use strict"; +;; } + +;; Save this in a file called whatever.json and then set +;; jshint-configuration-path to point to it. + +;;; Usage + +;; Add to your emacs config: + +;; (require 'flymake-jshint) +;; (add-hook 'js-mode-hook 'flymake-mode) + +;; making sure that flymake-jshint.el is on your load-path. If not, +;; also add to your config: + +;; (add-to-list 'load-path "~/.emacs.d/path/to/flymake-jshint.el") + +;;; Debugging + +;; If JSHint isn't working for any reason, execute + +;; M-x set-variable flymake-log-level 3 + +;; and you will see what is going wrong listed in the *Messages* +;; buffer. + +(require 'flymake) + + +(defcustom jshint-configuration-path nil + "Path to a JSON configuration file for JSHint." + :type 'string + :group 'flymake-jshint) + + +(defun flymake-jshint-init () + (let* ((temp-file (flymake-init-create-temp-buffer-copy + 'flymake-create-temp-inplace)) + (local-file (file-relative-name + temp-file + (file-name-directory buffer-file-name)))) + (if jshint-configuration-path + (list "jshint" (list local-file "--config" (expand-file-name jshint-configuration-path))) + (list "jshint" (list local-file))))) + + + +(setq flymake-allowed-file-name-masks + (cons '(".+\\.js$" + flymake-jshint-init + flymake-simple-cleanup + flymake-get-real-file-name) + flymake-allowed-file-name-masks)) + + +(setq flymake-err-line-patterns + (cons '("^\\(.*\\): line \\([[:digit:]]+\\), col \\([[:digit:]]+\\), \\(.+\\)$" + 1 2 3 4) + flymake-err-line-patterns)) + +; load flymake automatically in JavaScript mode +(add-hook 'js-mode-hook 'flymake-mode) + +(provide 'flymake-jshint) + +;;; flymake-jshint.el ends herep \ No newline at end of file diff --git a/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint.elc b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint.elc new file mode 100644 index 0000000..7a772e4 Binary files /dev/null and b/emacs.d/elpa/flymake-jshint-1.0/flymake-jshint.elc differ