]> code.delx.au - dotemacs/blobdiff - lisp/my-file-modes.el
ledger-mode: wider lines for posts
[dotemacs] / lisp / my-file-modes.el
index 6f1dd34e027efccdb3452014458b86c049db50ad..142e1a04f7c3908d8543e2810550aec7773e9f53 100644 (file)
@@ -1,6 +1,7 @@
 ;;; -*- lexical-binding: t -*-
 
 (setq-default indent-tabs-mode nil)
+(setq-default require-final-newline t)
 
 (require 'cc-mode)
 (setq c-auto-align-backslashes nil)
 (setq js2-mode-show-parse-errors nil)
 (setq js2-mode-show-strict-warnings nil)
 (setq js--declaration-keyword-re "x^") ; declarations should have normal indentation
+(when (require 'tern nil 'noerror)
+  (add-hook 'js2-mode-hook (lambda () (tern-mode t))))
+
+(when (require 'ledger-mode nil 'noerror)
+  (add-to-list 'auto-mode-alist '("\\.ledger\\'" . ledger-mode))
+  (setq ledger-post-amount-alignment-column 72))
 
 (require 'markdown-mode)
 (define-key markdown-mode-map (kbd "M-{") 'markdown-beginning-of-block)
 (require 'ssh-file-modes)
 
 (when (require 'stumpwm-mode nil 'noerror)
-  (add-hook 'find-file-hook
-            (lambda ()
-              (when (string=
-                     ".stumpwmrc"
-                     (file-name-nondirectory (buffer-file-name)))
-                (stumpwm-mode)))))
+  (add-to-list 'auto-mode-alist '("/\\.stumpwmrc\\'" . stumpwm-mode)))
 
 (require 'yaml-mode)