Update indentation settings

* .dir-locals.el: Set `indent-tabs-mode' automatically.
This commit is contained in:
Oleh Krehel 2016-04-14 12:28:10 +02:00
parent 58d75804ff
commit 916d4a7034
2 changed files with 60 additions and 53 deletions

5
.dir-locals.el Normal file
View file

@ -0,0 +1,5 @@
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")
((emacs-lisp-mode
(indent-tabs-mode . nil)))

View file

@ -39,30 +39,32 @@
(require 'counsel) (require 'counsel)
(require 'projectile) (require 'projectile)
;;; counsel-projectile-find-file ;;; counsel-projectile-find-file
;;;###autoload ;;;###autoload
(defun counsel-projectile-find-file (&optional arg) (defun counsel-projectile-find-file (&optional arg)
"Replacement for `projectile-find-file'. Jump to a project's file using completion. "Jump to a project's file using completion.
Replacement for `projectile-find-file'.
With a prefix ARG invalidates the cache first." With a prefix ARG invalidates the cache first."
(interactive "P") (interactive "P")
(projectile-maybe-invalidate-cache arg) (projectile-maybe-invalidate-cache arg)
(ivy-read "Find file: " (ivy-read "Find file: "
(projectile-current-project-files) (projectile-current-project-files)
:action :action
(lambda (x) (lambda (x)
(with-ivy-window (with-ivy-window
(find-file (expand-file-name x (projectile-project-root))))) (find-file (expand-file-name x (projectile-project-root)))))
:require-match t :require-match t
:caller 'counsel-projectile-find-file) :caller 'counsel-projectile-find-file)
(run-hooks 'projectile-find-file-hook)) (run-hooks 'projectile-find-file-hook))
(ivy-set-actions (ivy-set-actions
'counsel-projectile-find-file 'counsel-projectile-find-file
'(("w" (lambda (x) '(("w" (lambda (x)
(with-ivy-window (with-ivy-window
(find-file-other-window (expand-file-name x (projectile-project-root))))) (find-file-other-window
(expand-file-name x (projectile-project-root)))))
"other window"))) "other window")))
;;; counsel-projectile-find-dir ;;; counsel-projectile-find-dir
@ -75,22 +77,22 @@ With a prefix ARG invalidates the cache first."
(interactive "P") (interactive "P")
(projectile-maybe-invalidate-cache arg) (projectile-maybe-invalidate-cache arg)
(ivy-read "Find dir: " (ivy-read "Find dir: "
(if projectile-find-dir-includes-top-level (if projectile-find-dir-includes-top-level
(append '("./") (projectile-current-project-dirs)) (append '("./") (projectile-current-project-dirs))
(projectile-current-project-dirs)) (projectile-current-project-dirs))
:action :action
(lambda (x) (lambda (x)
(with-ivy-window (with-ivy-window
(dired (expand-file-name x (projectile-project-root))))) (dired (expand-file-name x (projectile-project-root)))))
:require-match t :require-match t
:caller 'counsel-projectile-find-dir) :caller 'counsel-projectile-find-dir)
(run-hooks 'projectile-find-dir-hook)) (run-hooks 'projectile-find-dir-hook))
(ivy-set-actions (ivy-set-actions
'counsel-projectile-find-dir 'counsel-projectile-find-dir
'(("w" (lambda (x) '(("w" (lambda (x)
(with-ivy-window (with-ivy-window
(dired-other-window (expand-file-name x (projectile-project-root))))) (dired-other-window (expand-file-name x (projectile-project-root)))))
"other window"))) "other window")))
;;; counsel-projectile-switch-to-buffer ;;; counsel-projectile-switch-to-buffer
@ -100,20 +102,20 @@ With a prefix ARG invalidates the cache first."
"Switch to a project buffer." "Switch to a project buffer."
(interactive) (interactive)
(ivy-read "Switch-to-buffer: " (ivy-read "Switch-to-buffer: "
(-remove-item (buffer-name (current-buffer)) (-remove-item (buffer-name (current-buffer))
(projectile-project-buffer-names)) (projectile-project-buffer-names))
:action :action
(lambda (x) (lambda (x)
(with-ivy-window (with-ivy-window
(switch-to-buffer x))) (switch-to-buffer x)))
:require-match t :require-match t
:caller 'counsel-projectile-switch-to-buffer)) :caller 'counsel-projectile-switch-to-buffer))
(ivy-set-actions (ivy-set-actions
'counsel-projectile-switch-to-buffer 'counsel-projectile-switch-to-buffer
'(("w" (lambda (x) '(("w" (lambda (x)
(with-ivy-window (with-ivy-window
(switch-to-buffer-other-window x))) (switch-to-buffer-other-window x)))
"other window"))) "other window")))
;;; counsel-projectile ;;; counsel-projectile
@ -125,54 +127,54 @@ With a prefix ARG invalidates the cache first."
With a prefix ARG invalidates the cache first." With a prefix ARG invalidates the cache first."
(interactive "P") (interactive "P")
(ivy-read "Switch to project: " (ivy-read "Switch to project: "
(if (projectile-project-p) (if (projectile-project-p)
(cons (abbreviate-file-name (projectile-project-root)) (cons (abbreviate-file-name (projectile-project-root))
(projectile-relevant-known-projects)) (projectile-relevant-known-projects))
projectile-known-projects) projectile-known-projects)
:action :action
(lambda (dir) (lambda (dir)
(projectile-switch-project-by-name dir arg)) (projectile-switch-project-by-name dir arg))
:require-match t :require-match t
:caller 'counsel-projectile)) :caller 'counsel-projectile))
(ivy-set-actions (ivy-set-actions
'counsel-projectile 'counsel-projectile
'(("f" (lambda (dir) '(("f" (lambda (dir)
(let ((projectile-switch-project-action 'counsel-projectile-find-file)) (let ((projectile-switch-project-action 'counsel-projectile-find-file))
(projectile-switch-project-by-name dir arg))) (projectile-switch-project-by-name dir arg)))
"find file") "find file")
("d" (lambda (dir) ("d" (lambda (dir)
(let ((projectile-switch-project-action 'counsel-projectile-find-dir)) (let ((projectile-switch-project-action 'counsel-projectile-find-dir))
(projectile-switch-project-by-name dir arg))) (projectile-switch-project-by-name dir arg)))
"find directory") "find directory")
("b" (lambda (dir) ("b" (lambda (dir)
(let ((projectile-switch-project-action 'counsel-projectile-switch-to-buffer)) (let ((projectile-switch-project-action 'counsel-projectile-switch-to-buffer))
(projectile-switch-project-by-name dir arg))) (projectile-switch-project-by-name dir arg)))
"switch to buffer") "switch to buffer")
("s" (lambda (dir) ("s" (lambda (dir)
(let ((projectile-switch-project-action 'projectile-save-project-buffers)) (let ((projectile-switch-project-action 'projectile-save-project-buffers))
(projectile-switch-project-by-name dir arg))) (projectile-switch-project-by-name dir arg)))
"save all buffers") "save all buffers")
("k" (lambda (dir) ("k" (lambda (dir)
(let ((projectile-switch-project-action 'projectile-kill-buffers)) (let ((projectile-switch-project-action 'projectile-kill-buffers))
(projectile-switch-project-by-name dir arg))) (projectile-switch-project-by-name dir arg)))
"kill all buffers") "kill all buffers")
("r" (lambda (dir) ("r" (lambda (dir)
(let ((projectile-switch-project-action (let ((projectile-switch-project-action
'projectile-remove-current-project-from-known-projects)) 'projectile-remove-current-project-from-known-projects))
(projectile-switch-project-by-name dir arg))) (projectile-switch-project-by-name dir arg)))
"remove from known projects") "remove from known projects")
("l" (lambda (dir) ("l" (lambda (dir)
(let ((projectile-switch-project-action 'projectile-edit-dir-locals)) (let ((projectile-switch-project-action 'projectile-edit-dir-locals))
(projectile-switch-project-by-name dir arg))) (projectile-switch-project-by-name dir arg)))
"edit dir-locals") "edit dir-locals")
("g" (lambda (dir) ("g" (lambda (dir)
(let ((projectile-switch-project-action 'projectile-vc)) (let ((projectile-switch-project-action 'projectile-vc))
(projectile-switch-project-by-name dir arg))) (projectile-switch-project-by-name dir arg)))
"open in vc-dir / magit / monky") "open in vc-dir / magit / monky")
("e" (lambda (dir) ("e" (lambda (dir)
(let ((projectile-switch-project-action 'projectile-run-eshell)) (let ((projectile-switch-project-action 'projectile-run-eshell))
(projectile-switch-project-by-name dir arg))) (projectile-switch-project-by-name dir arg)))
"start eshell"))) "start eshell")))