Closed QiangF closed 1 year ago
Have a picture of how it looks? Here I follow org, which uses the normal outline folded view by default.
On the left is the imenu-tree, it is in a side window. I'd prefer it in the same window, it would be nice to have folding on function definition.
That's looks nice. So there is some way to indent the higher depth heading nodes more? Do you have an example?
Maybe customize outline-level? I am not sure. I think indentation doesn't matter that much. Folding function definition and easily navigating between function definition would be nice.
I think indentation doesn't matter that much.
Then I'm not sure what you are asking for. I do use imenu-generic-expression
, which is why you see headings in imenu. Org does heading nesting down to some configurable level in its imenu, using an imenu-create-index-function
.
Folding function definition and easily navigating between function definition would be nice.
Function definitions are out of scope for outli, which concerns itself only with heading-separated sections. But you might look at hideshow-minor-mode
which is built-in and lets you fold functions, and which outli works fine with. E.g. hs-hide-all
gives a very nice condensed overview, and you can still collapse and navigate outline sections containing hidden functions:
There are lots of function navigation commands, e.g. I use lispy. But even C-M-a
and repeat-mode works great.
Thank you for the suggestion. Hideshow-minor-mode is a lot slower than outline-minor-mode for large files. Lispy only works for lisp. Imenu is both fast and works everywhere.
Imenu's job isn't the same as hs-minor-mode's. But if that is slow it's worth looking into why. From a top down view, hs shouldn't be any slower that outline's native section hiding, modulo searching for "block" units to hide.
I just ran hs-hide-all
in the largest file in Emacs progmodes directory: cc-engine.el, with 15.6k lines. It took less that 50ms. hs-show-all
took less than 2ms. So maybe something is wrong with your config or setup.
To get an in buffer tree view like: https://github.com/emacsmirror/imenu-tree