Simplify fill column indicator configuration

Fixes #821
This commit is contained in:
syl20bnr 2015-03-14 11:08:31 -04:00
parent 4a493f450b
commit 3eed76a316
4 changed files with 12 additions and 42 deletions

View file

@ -778,8 +778,7 @@ Some graphical UI indicators can be toggled on and off (toggles start with `t`):
Key Binding | Description
----------------------|------------------------------------------------------------
<kbd>SPC t 8</kbd> | display a mark on the 80th column
<kbd>SPC t 0</kbd> | display a mark on the `fill-column`
<kbd>SPC t c</kbd> | display the fill column (by default the fill column is set to 80)
<kbd>SPC t F</kbd> | toggle frame fullscreen
<kbd>SPC t f</kbd> | toggle display of the fringe
<kbd>SPC t h</kbd> | toggle highlight of the current line

View file

@ -133,7 +133,7 @@ Can be installed with `brew install trash'."
(setq trash-directory "~/.Trash/emacs")))
;; auto fill breaks line beyond current-fill-column
(setq-default default-fill-column 78)
(setq-default default-fill-column 80)
(spacemacs|diminish auto-fill-function "" " f")
;; ---------------------------------------------------------------------------

View file

@ -130,16 +130,6 @@
"Sd" 'ispell-change-dictionary
"Sn" 'flyspell-goto-next-error)
;; toggle ---------------------------------------------------------------------
(spacemacs|add-toggle fill-column-indicator
:status nil
:on (toggle-fill-column-indicator)
:documentation "Display the fill column indicator."
:evil-leader "t8")
(spacemacs|add-toggle fill-column-indicator-custom
:status nil
:on (toggle-fill-column-indicator-custom)
:documentation "Display the fill column indicator at `fill-column`."
:evil-leader "t0")
(spacemacs|add-toggle fringe
:status (not (equal fringe-mode 0))
:on (call-interactively 'fringe-mode)

View file

@ -1063,36 +1063,17 @@ which require an initialization must be listed explicitly in the list.")
))
(defun spacemacs/init-fill-column-indicator ()
(setq fci-rule-width 1)
(setq fci-enabled 0)
(defun toggle-fill-column-indicator ()
(interactive)
(make-local-variable 'fci-enabled)
(if (> fci-enabled 0) (deactivate-fci) (activate-fci)))
(defun activate-fci (&optional fci--width)
(if fci--width
(setq fci-rule-column fci--width)
(setq fci-rule-column 79))
(setq fci-enabled 1)
(fci-mode 1))
(defun toggle-fill-column-indicator-custom ()
(interactive)
(make-local-variable 'fci-enabled)
(if (> fci-enabled 0) (deactivate-fci) (activate-fci fill-column)))
(defun deactivate-fci ()
(setq fci-enabled 0)
(fci-mode 0))
(use-package fill-column-indicator
:commands toggle-fill-column-indicator)
(use-package fill-column-indicator
:commands toggle-fill-column-indicator-custom))
:defer t
:init
(progn
(setq fci-rule-width 1)
(spacemacs|add-toggle fill-column-indicator
:status fci-mode
:on (turn-on-fci-mode)
:off (turn-off-fci-mode)
:documentation "Display the fill column indicator."
:evil-leader "tc"))))
(defun spacemacs/init-flx-ido ()
(use-package flx-ido