       (switch-to-buffer-other-frame server-buf))))
 (add-hook 'server-done-hook 'delete-frame)
 (add-hook 'server-done-hook (lambda nil (kill-buffer nil)))
+;; auto revert a file if modified outside emacs
+(global-auto-revert-mode t)
+;; make files that start with a shebang executable
+(add-hook 'after-save-hook
+  'executable-make-buffer-file-executable-if-script-p)
 
 ;;; improve some of the standard keybindings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 

  :diminish global-whitespace-mode
  :config   (global-whitespace-mode)
  :custom   (whitespace-style '(face lines-tail))
  :hook     ((prog-mode .    (lambda () (setq show-trailing-whitespace 1)))
              (c-mode .      (lambda () (setq whitespace-line-column 80)))
              (c++-mode .    (lambda () (setq whitespace-line-column 80)))
              (elixir-mode . (lambda () (setq whitespace-line-column 80)))
              (java-mode .   (lambda () (setq whitespace-line-column 100)))
              (python-mode . (lambda () (setq whitespace-line-column 79)))
              (rust-mode .   (lambda () (setq whitespace-line-column 99)))))

(use-package windmove
  :config (windmove-default-keybindings)

;; if a region is selected when delete is pressed, it gets deleted
(delete-selection-mode)

;;; other stuff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; don't litter my hd with temp files
(setq backup-directory-alist `((".*" . "~/.emacs.d/tmp"))
  auto-save-file-name-transforms `((".*" , "~/.emacs.d/tmp" t)))

;;; init.el ends here
