diff options
author | David Li <li.davidm96@gmail.com> | 2016-02-21 18:48:36 -0500 |
---|---|---|
committer | David Li <li.davidm96@gmail.com> | 2016-02-21 18:48:36 -0500 |
commit | 31bc656db77e71b28d890ec087d082366dabe43f (patch) | |
tree | cf95721460fa49da5c1670f319456e4822338fdc | |
parent | d59f1f04d68f72f56c76b911b4d1854c071f6519 (diff) |
Use visual line navigation
-rw-r--r-- | init.el | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -60,6 +60,21 @@ This functions should be added to the hooks of major modes for programming." ;; evil (require 'evil) (evil-mode 1) +(setq-default evil-cross-lines t) +;; http://stackoverflow.com/a/32660401/262727 +(defun evil-next-line--check-visual-line-mode (orig-fun &rest args) + (if visual-line-mode + (apply 'evil-next-visual-line args) + (apply orig-fun args))) + +(advice-add 'evil-next-line :around 'evil-next-line--check-visual-line-mode) + +(defun evil-previous-line--check-visual-line-mode (orig-fun &rest args) + (if visual-line-mode + (apply 'evil-previous-visual-line args) + (apply orig-fun args))) + +(advice-add 'evil-previous-line :around 'evil-previous-line--check-visual-line-mode) (require 'evil-little-word) (define-key evil-motion-state-map (kbd "w") 'evil-forward-little-word-begin) @@ -111,7 +126,8 @@ This functions should be added to the hooks of major modes for programming." '(custom-enabled-themes (quote (cyberpunk))) '(custom-safe-themes (quote - ("561ba4316ba42fe75bc07a907647caa55fc883749ee4f8f280a29516525fc9e8" "a81bc918eceaee124247648fc9682caddd713897d7fd1398856a5b61a592cb62" default)))) + ("561ba4316ba42fe75bc07a907647caa55fc883749ee4f8f280a29516525fc9e8" "a81bc918eceaee124247648fc9682caddd713897d7fd1398856a5b61a592cb62" default))) + '(js2-strict-trailing-comma-warning nil)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. |