0

Can I use .dir-local.el to load a (remote) file with indentation setting, something like:

In .dir-locals.el:

((clojure-mode 
  (eval . (load "~/emacs/indents.el"))))

In indents.el:

;; use 2 spaces for tabs
(setq-default indent-tabs-mode nil)
(setq tab-width 2)

;; indent any newline
(define-key global-map (kbd "RET") 'newline-and-indent)

;; remove trailing whistespaces on buffer save
(add-hook 'before-save-hook 'whitespace-cleanup)

;; list of macros and indentation rules
(define-clojure-indent
  (defroutes 'defun)
  (GET 2)
  (POST 2)
  (PUT 2)
  (DELETE 2)
  (HEAD 2)
  (ANY 2)
  (OPTIONS 2)
  (PATCH 2)
  (rfn 2)
  (let-routes 1)
  (context 2)
  (wait-for 'defun))

Better yet, could I load it from a remote location, like a gist or a github repository?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.