2017-02-20 00:18:54 -05:00
|
|
|
;;; private/hlissner/config.el
|
|
|
|
|
|
|
|
(when (featurep 'evil)
|
2017-03-16 14:30:15 -04:00
|
|
|
(load! +bindings) ; my key bindings
|
2017-02-23 00:06:12 -05:00
|
|
|
(load! +commands)) ; my custom ex commands
|
2017-02-20 00:18:54 -05:00
|
|
|
|
|
|
|
(defvar +hlissner-snippets-dir
|
|
|
|
(expand-file-name "snippets/" (file-name-directory load-file-name)))
|
|
|
|
|
|
|
|
|
2017-03-16 23:39:35 -04:00
|
|
|
;; On Arch, bspwm is my window manager. When I open GUI Emacs a gap forms on the
|
|
|
|
;; right side of the frame (which causes display glitches). Cycling fullscreen
|
|
|
|
;; fixing this.
|
|
|
|
(when (and IS-LINUX (display-graphic-p))
|
|
|
|
(add-hook! 'window-setup-hook
|
2017-02-20 00:18:54 -05:00
|
|
|
(set-frame-parameter nil 'fullscreen 'fullboth)
|
|
|
|
(set-frame-parameter nil 'fullscreen nil)))
|
|
|
|
|
|
|
|
|
|
|
|
;; Don't use default snippets, use mine.
|
2017-02-23 00:06:12 -05:00
|
|
|
(after! yasnippet
|
2017-02-20 00:18:54 -05:00
|
|
|
(setq yas-snippet-dirs (append (list '+hlissner-snippets-dir)
|
|
|
|
(delete 'yas-installed-snippets-dir yas-snippet-dirs))))
|
|
|
|
|
|
|
|
|
|
|
|
;; Repeat all sorts of motion and searches with SPC & C-SPC
|
2017-02-23 00:06:12 -05:00
|
|
|
(defmacro +my!repeat-with-spc (command next-func prev-func)
|
2017-02-20 00:18:54 -05:00
|
|
|
"Repeat motions with SPC/S-SPC"
|
|
|
|
(let ((fn-sym (intern (format "+evil*repeat-%s" command))))
|
|
|
|
`(progn
|
|
|
|
(defun ,fn-sym (&rest _)
|
|
|
|
(define-key evil-motion-state-map (kbd "SPC") ',next-func)
|
|
|
|
(define-key evil-motion-state-map (kbd "S-SPC") ',prev-func))
|
|
|
|
(advice-add ',command :before ',fn-sym))))
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(after! evil
|
2017-02-20 00:18:54 -05:00
|
|
|
;; n/N
|
2017-02-23 00:06:12 -05:00
|
|
|
(+my!repeat-with-spc evil-ex-search-next evil-ex-search-next evil-ex-search-previous)
|
|
|
|
(+my!repeat-with-spc evil-ex-search-previous evil-ex-search-next evil-ex-search-previous)
|
|
|
|
(+my!repeat-with-spc evil-ex-search-forward evil-ex-search-next evil-ex-search-previous)
|
|
|
|
(+my!repeat-with-spc evil-ex-search-backward evil-ex-search-next evil-ex-search-previous)
|
2017-02-20 00:18:54 -05:00
|
|
|
|
|
|
|
;; f/F/t/T/s/S
|
2017-02-23 00:06:12 -05:00
|
|
|
(after! evil-snipe
|
2017-02-20 00:18:54 -05:00
|
|
|
(setq evil-snipe-repeat-keys nil
|
|
|
|
evil-snipe-override-evil-repeat-keys nil) ; causes problems with remapped ;
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(+my!repeat-with-spc evil-snipe-f evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(+my!repeat-with-spc evil-snipe-F evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(+my!repeat-with-spc evil-snipe-t evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(+my!repeat-with-spc evil-snipe-T evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(+my!repeat-with-spc evil-snipe-s evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(+my!repeat-with-spc evil-snipe-S evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(+my!repeat-with-spc evil-snipe-x evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(+my!repeat-with-spc evil-snipe-X evil-snipe-repeat evil-snipe-repeat-reverse))
|
2017-02-20 00:18:54 -05:00
|
|
|
|
|
|
|
;; */#
|
2017-02-23 00:06:12 -05:00
|
|
|
(after! evil-visualstar
|
|
|
|
(+my!repeat-with-spc evil-visualstar/begin-search-forward
|
2017-02-20 00:18:54 -05:00
|
|
|
evil-ex-search-next evil-ex-search-previous)
|
2017-02-23 00:06:12 -05:00
|
|
|
(+my!repeat-with-spc evil-visualstar/begin-search-backward
|
2017-02-20 00:18:54 -05:00
|
|
|
evil-ex-search-previous evil-ex-search-next)))
|
|
|
|
|