Add toggle visual-line-navigation-globally

This commit is contained in:
Matt Kramer 2018-10-10 16:49:32 -07:00 committed by duianto
parent 5bcc96e9a9
commit e4c8cef412
3 changed files with 20 additions and 8 deletions

View File

@ -841,6 +841,8 @@ Other:
- Added workspaces transient state key bindings (thanks to duianto):
- ~SPC l w s~ =spacemacs/single-win-workspace= (exits the TS)
- ~SPC l w S~ =spacemacs/single-win-workspace=
- Added ~SPC t C-S-l~ =spacemacs/toggle-visual-line-navigation-globally=
(thanks to Matt Kramer)
- Improvements:
- Rewrote window layout functions for ~SPC w 1~, ~SPC w 2~, ~SPC w 3~, and
~SPC w 4~ (thanks to Codruț Constantin Gușoi):

View File

@ -535,6 +535,10 @@ a dedicated window."
(if dedicated "no longer " "")
(buffer-name))))
(defun spacemacs//init-visual-line-keys ()
(evil-define-minor-mode-key 'motion 'visual-line-mode "j" 'evil-next-visual-line)
(evil-define-minor-mode-key 'motion 'visual-line-mode "k" 'evil-previous-visual-line))
;; Copy file path

View File

@ -340,14 +340,7 @@
:on
(progn
(visual-line-mode)
(evil-define-minor-mode-key 'motion 'visual-line-mode "j" 'evil-next-visual-line)
(evil-define-minor-mode-key 'motion 'visual-line-mode "k" 'evil-previous-visual-line)
(when (bound-and-true-p evil-escape-mode)
(evil-escape-mode -1)
(setq evil-escape-motion-state-shadowed-func nil)
(evil-define-minor-mode-key 'motion 'visual-line-mode "j" 'evil-next-visual-line)
(evil-define-minor-mode-key 'motion 'visual-line-mode "k" 'evil-previous-visual-line)
(evil-escape-mode))
(spacemacs//init-visual-line-keys)
(evil-normalize-keymaps))
:off
(progn
@ -355,6 +348,19 @@
(evil-normalize-keymaps))
:documentation "Move point according to visual lines."
:evil-leader "tL")
(spacemacs|add-toggle visual-line-navigation-globally
:status global-visual-line-mode
:on
(progn
(global-visual-line-mode)
(spacemacs//init-visual-line-keys)
(evil-normalize-keymaps))
:off
(progn
(global-visual-line-mode -1)
(evil-normalize-keymaps))
:documentation "Move point according to visual lines globally."
:evil-leader "t C-S-l")
(spacemacs|add-toggle auto-fill-mode
:status auto-fill-function
:on (auto-fill-mode)