From 77c0c10bcdb34aa909e0746a845b522a6042c15c Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Thu, 5 Oct 2017 21:58:27 +0200 Subject: [PATCH] imenu und bugs --- emacs/.emacs | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/emacs/.emacs b/emacs/.emacs index f49e582..769ca2c 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -57,7 +57,7 @@ '(menu-bar-mode nil) '(package-selected-packages (quote - (powerline-evil powerline origami projectile terminal-here shell-pop swiper neotree centered-cursor-mode ivy avy heroku-theme auto-complete use-package yasnippet evil-surround org evil-magit magit makefile-runner evil))) + (counsel powerline-evil powerline origami projectile terminal-here shell-pop swiper neotree centered-cursor-mode ivy avy heroku-theme auto-complete use-package yasnippet evil-surround org evil-magit magit makefile-runner evil))) '(scroll-bar-mode nil) '(shell-pop-shell-type (quote @@ -66,10 +66,8 @@ (ansi-term shell-pop-term-shell))))) '(shell-pop-window-position "top") '(shell-pop-window-size 20) - '(tool-bar-mode nil) - '(dired-listing-switches "-lh") - '(ac-ignore-case nil) - '(show-trailing-whitespace t)) + '(show-trailing-whitespace t) + '(tool-bar-mode 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. @@ -145,6 +143,14 @@ :ensure t) ;; Evil-mode +(defun my/evil-go-back () + (interactive) + (evil--jump-backward 1)) + +(defun my/evil-go-forward () + (interactive) + (evil--jump-forward 1)) + (use-package evil :ensure t :demand t @@ -152,6 +158,8 @@ (evil-mode 1) (setq evil-ex-substitute-global t) (define-key evil-normal-state-map "/" 'swiper) + (define-key evil-normal-state-map "gb" 'my/evil-go-back) + (define-key evil-normal-state-map "gn" 'my/evil-go-forward) (define-key evil-motion-state-map [down-mouse-1] 'silence) (define-key evil-motion-state-map [mouse-1] 'silence) (setq-default evil-cross-lines t)) @@ -189,6 +197,10 @@ (global-origami-mode))) ;; ivy +(defun my/save-imenu-jump (item) + "WIP: Tells evil-jump to save position before jumping via imenu (or counsel-imenu)" + (evil--jumps-push)) + (use-package ivy :ensure t :demand t @@ -196,6 +208,7 @@ (ivy-mode 1) (setq ivy-use-virtual-buffers t) (setq ivy-count-format "(%d/%d) ") + (advice-add 'imenu :before 'my/save-imenu-jump) (define-key ivy-minibuffer-map (kbd "") 'ivy-immediate-done))) (use-package counsel @@ -383,6 +396,8 @@ '("*Apropos*" display-buffer-same-window)) (add-to-list 'display-buffer-alist '("*Help*" display-buffer-in-side-window)) +(add-to-list 'display-buffer-alist + '("*evil-jumps*" display-buffer-in-side-window)) (add-to-list 'display-buffer-alist '("*compilation*" (display-buffer-reuse-window display-buffer-in-side-window) (side . bottom) (size . 0.2)))