This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+tools/imenu-list/funcs.el
Cormac Cannon 097a1fc42d Added keybinding to focus the imenu-list sidebar, creating if necessary.
Bound under ~spc b i~.
Moved existing toggle binding under UI toggle prefix: ~spc T i~
Bindings now using spacebind macro.
2020-05-09 00:08:33 +02:00

9 lines
425 B
EmacsLisp

(defun spacemacs/imenu-list-smart-focus ()
"Focus the `imenu-list' buffer, creating as necessary.
If the imenu-list buffer is displayed in any window, focus it, otherwise create and focus.
Note that all the windows in every frame searched, even invisible ones, not
only those in the selected frame."
(interactive)
(if (get-buffer-window imenu-list-buffer-name t)
(imenu-list-show)
(imenu-list-smart-toggle)))