summaryrefslogtreecommitdiffstats
path: root/emacs/.emacs.d/init.org
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/.emacs.d/init.org')
-rw-r--r--emacs/.emacs.d/init.org96
1 files changed, 78 insertions, 18 deletions
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org
index 1aab2b8..974d025 100644
--- a/emacs/.emacs.d/init.org
+++ b/emacs/.emacs.d/init.org
@@ -1024,24 +1024,6 @@
(add-hook 'scss-mode-hook #'scss-imenu-setup)
#+END_SRC
-** Haml
-
- - Check syntax on the fly
-
- #+BEGIN_SRC emacs-lisp
- (declare-function flycheck-mode "flycheck")
-
- (add-hook 'haml-mode-hook #'flycheck-mode)
- #+END_SRC
-
-** Ruby
-
- - Enable flycheck
-
- #+BEGIN_SRC emacs-lisp
- (add-hook 'ruby-mode-hook #'flycheck-mode)
- #+END_SRC
-
** PHP
*** Show tabs and spaces in indent
@@ -1329,6 +1311,84 @@
(add-hook 'comint-mode-hook #'oni:turn-on-compilation-shell-for-pony)
#+END_SRC
+** Automatic syntax checking on-the-fly
+
+ #+BEGIN_SRC emacs-lisp :tangle no
+ (depends-on "flycheck")
+ (depends-on "flycheck-cask")
+ (depends-on "flycheck-commit-check" :git "git://github.com/ryuslash/flycheck-commit-check.git")
+ #+END_SRC
+
+ Flycheck provides awesome syntax checkers for many languages.
+ Enable it for the languages I use.
+
+ #+BEGIN_SRC emacs-lisp
+ (add-hook 'haml-mode-hook 'flycheck-mode)
+ (add-hook 'emacs-lisp-mode-hook 'flycheck-mode)
+ (add-hook 'git-commit-mode-hook 'flycheck-mode)
+ (add-hook 'go-mode-hook 'flycheck-mode)
+ (add-hook 'html-mode-hook 'flycheck-mode)
+ (add-hook 'js2-mode-hook 'flycheck-mode)
+ (add-hook 'lua-mode-hook 'flycheck-mode)
+ (add-hook 'perl-mode-hook 'flycheck-mode)
+ (add-hook 'php-mode-hook 'flycheck-mode)
+ (add-hook 'python-mode-hook 'flycheck-mode)
+ (add-hook 'rst-mode-hook 'flycheck-mode)
+ (add-hook 'ruby-mode-hook 'flycheck-mode)
+ (add-hook 'rust-mode-hook 'flycheck-mode)
+ (add-hook 'sh-mode-hook 'flycheck-mode)
+ (add-hook 'texinfo-mode-hook 'flycheck-mode)
+ #+END_SRC
+
+ Whenever flycheck is started, try using it with Cask.
+
+ #+BEGIN_SRC emacs-lisp
+ (add-hook 'flycheck-mode-hook 'flycheck-cask-setup)
+ #+END_SRC
+
+ Load my own git commit checker.
+
+ #+NAME: flycheck-commit-checker
+ #+BEGIN_SRC emacs-lisp :tangle no
+ (require 'flycheck-commit-check)
+ #+END_SRC
+
+ Disable certain checkers.
+
+ #+NAME: flycheck-delete-checkers
+ #+BEGIN_SRC emacs-lisp :tangle no
+ (mapc (lambda (c) (delq c flycheck-checkers))
+ '(python-pylint python-pyflakes))
+ #+END_SRC
+
+ Set the highlighting mode to columns so I can see (if possible)
+ where errors/warnings belong.
+
+ #+NAME: flycheck-columns
+ #+BEGIN_SRC emacs-lisp :tangle no
+ (setq flycheck-highlighting-mode 'columns)
+ #+END_SRC
+
+ Try not to display the errors. A jumpy echo area makes me nervous
+ and {{{key(C-c ! l)}}} is a nicer way to look at it usually. It
+ still doesn't keep it from being displayed, only when nothing else
+ is displayed though.
+
+ #+NAME: flycheck-display
+ #+BEGIN_SRC emacs-lisp :tangle no
+ (setq flycheck-display-errors-function (lambda (_) nil))
+ #+END_SRC
+
+ Do most of these things after flycheck is loaded.
+
+ #+BEGIN_SRC emacs-lisp :noweb yes
+ (stante-after flycheck
+ <<flycheck-commit-checker>>
+ <<flycheck-delete-checkers>>
+ <<flycheck-columns>>
+ <<flycheck-display>>)
+ #+END_SRC
+
* Use Conkeror to browse URLs
Use the generic browse-url function to open URLs in Conkeror.