ivy: improve jumping in buffer
This commit is contained in:
parent
e109777f8b
commit
dfd309a77b
|
@ -350,6 +350,15 @@ To prevent this error we just wrap `describe-mode' to defeat the
|
||||||
((headline inlinetask)
|
((headline inlinetask)
|
||||||
(save-excursion (goto-char (org-element-property :begin context))
|
(save-excursion (goto-char (org-element-property :begin context))
|
||||||
(call-interactively 'counsel-org-tag)) t)))))
|
(call-interactively 'counsel-org-tag)) t)))))
|
||||||
|
|
||||||
|
(defun spacemacs/counsel-jump-in-buffer ()
|
||||||
|
"Jump in buffer with `counsel-imenu' or `counsel-org-goto' if in in org-mode"
|
||||||
|
(interactive)
|
||||||
|
(call-interactively
|
||||||
|
(cond
|
||||||
|
((eq major-mode 'org-mode) 'counsel-org-goto)
|
||||||
|
(t 'counsel-imenu))))
|
||||||
|
|
||||||
|
|
||||||
;; Ivy
|
;; Ivy
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
evil
|
evil
|
||||||
flx
|
flx
|
||||||
helm-make
|
helm-make
|
||||||
|
imenu
|
||||||
ivy
|
ivy
|
||||||
ivy-hydra
|
ivy-hydra
|
||||||
(ivy-rich :toggle ivy-enable-advanced-buffer-information)
|
(ivy-rich :toggle ivy-enable-advanced-buffer-information)
|
||||||
|
@ -74,7 +75,7 @@
|
||||||
"ry" 'counsel-yank-pop
|
"ry" 'counsel-yank-pop
|
||||||
"rm" 'counsel-mark-ring
|
"rm" 'counsel-mark-ring
|
||||||
;; jumping
|
;; jumping
|
||||||
"sj" 'counsel-imenu
|
"sj" 'spacemacs/counsel-jump-in-buffer
|
||||||
;; themes
|
;; themes
|
||||||
"Ts" 'counsel-load-theme
|
"Ts" 'counsel-load-theme
|
||||||
;; search
|
;; search
|
||||||
|
@ -174,7 +175,7 @@
|
||||||
"cm" 'helm-make))))
|
"cm" 'helm-make))))
|
||||||
|
|
||||||
(defun ivy/post-init-imenu ()
|
(defun ivy/post-init-imenu ()
|
||||||
(spacemacs/set-leader-keys "ji" 'counsel-imenu))
|
(spacemacs/set-leader-keys "ji" 'spacemacs/counsel-jump-in-buffer))
|
||||||
|
|
||||||
(defun ivy/init-ivy ()
|
(defun ivy/init-ivy ()
|
||||||
(use-package ivy
|
(use-package ivy
|
||||||
|
|
Loading…
Reference in a new issue