Skip to content

Commit

Permalink
Move whitespace settings to init-whitespace.el
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed Oct 17, 2015
1 parent 9808c04 commit 4f97efc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
1 change: 1 addition & 0 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
(require 'init-mmm)

(require 'init-editing-utils)
(require 'init-whitespace)

(require 'init-vc)
(require 'init-darcs)
Expand Down
24 changes: 0 additions & 24 deletions lisp/init-editing-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
save-interprogram-paste-before-kill t
scroll-preserve-screen-position 'always
set-mark-command-repeat-pop t
show-trailing-whitespace t
tooltip-delay 1.5
truncate-lines nil
truncate-partial-width-windows nil)
Expand All @@ -34,29 +33,6 @@

(transient-mark-mode t)


;;; Whitespace

(defun sanityinc/no-trailing-whitespace ()
"Turn off display of trailing whitespace in this buffer."
(setq show-trailing-whitespace nil))

;; But don't show trailing whitespace in SQLi, inf-ruby etc.
(dolist (hook '(special-mode-hook
Info-mode-hook
eww-mode-hook
term-mode-hook
comint-mode-hook
compilation-mode-hook
twittering-mode-hook
minibuffer-setup-hook))
(add-hook hook #'sanityinc/no-trailing-whitespace))


(require-package 'whitespace-cleanup-mode)
(global-whitespace-cleanup-mode t)

(global-set-key [remap just-one-space] 'cycle-spacing)


;;; Newline behaviour
Expand Down
28 changes: 28 additions & 0 deletions lisp/init-whitespace.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
(setq-default show-trailing-whitespace t)


;;; Whitespace

(defun sanityinc/no-trailing-whitespace ()
"Turn off display of trailing whitespace in this buffer."
(setq show-trailing-whitespace nil))

;; But don't show trailing whitespace in SQLi, inf-ruby etc.
(dolist (hook '(special-mode-hook
Info-mode-hook
eww-mode-hook
term-mode-hook
comint-mode-hook
compilation-mode-hook
twittering-mode-hook
minibuffer-setup-hook))
(add-hook hook #'sanityinc/no-trailing-whitespace))


(require-package 'whitespace-cleanup-mode)
(global-whitespace-cleanup-mode t)

(global-set-key [remap just-one-space] 'cycle-spacing)


(provide 'init-whitespace)

0 comments on commit 4f97efc

Please sign in to comment.