-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add imenu-list layer #3109
Add imenu-list layer #3109
Conversation
@bmag Perhaps this can be mentioned in VIMUSERS.org as a Spacemacs equivalent to tagbar? |
I don't know tagbar, so I don't know if imenu-list really is equivalent to it. I also didn't find a proper place in VIMUSERS.org, but maybe you meant I should add a line under the "Evil plugins" section in DOCUMENTATION.org (as was done for NeoTree)? |
Ah, you're right. I thought there was a section for that. Maybe I'll create it in the future. I don't think it fits under "Evil plugins" because this is not part of the spacemacs layer. |
Thank you, I do not know this extension before, it is usable for most languages, and extremly well for org mode; now I hope every document in the world is written as org file. |
I'm glad it helps you 😄 This layer is specifically for configuring the Sounds to me that your concern regards searching and discovering layers in Spacemacs in genereal, and isn't particular to
Going over the docs, I found a short section about package discovery in @syl20bnr I think that @stshine raises an important concern, but maybe you have thought about it already? |
0f01af6
to
11f443b
Compare
imenu-list provides a side bar that shows all imenu entries of the current buffer
@bmag So I tried your package :-) I like it, but I have a few question/remarks:
|
It's possible to write something for this, but the current behaviour matches Neotree. IMHO it's better to keep consistency with Neotree on this one.
You can use
That's already implemented with an idle timer of one second. If you wait one second without typing, the update should happen.
Good idea. Should be possible globally for Imenu jumps (including imenu-list) with: (add-hook 'imenu-after-jump-hook #'recenter) ;; also an option: reposition-window Or just for imenu-list jumps: (defun imenu-list-recenter ()
(when (memq this-command '(imenu-list-display-entry imenu-list-goto-entry))
(recenter)))
(add-hook 'imenu-after-jump-hook #'imenu-list-recenter) In fact, I think I'll add it upstream 😄 (on Wednesday) |
Indeed, it annoyed me with
I saw for
Doesn't work here. I notice an error in
Cool, I'll wait a little bit before adding it to my config then :-) |
Can you report an issue upstream for this as well? I suspect there's a bug in imenu-list that's triggered when Semantic is enabled. EDIT: yep, found a bag with the same error you quoted |
@bmag I'll report it then :-) |
How about call this layer |
I like this package and have been using it since long specially with pdf tools which displays nice outline in imenu-list. I did have same issues as @StreakyCobra mentioned about TAB not being used for [un]folding and position in imenu-list not being updated as I move in corresponding buffer. |
@nixmaniack can you tell me the major-mode and value of |
Should I see any outline (the way @nixmaniack is seeing) in the |
@mandarvaze there are screenshots on the homepage. |
The reason I asked was because :
|
Very nice, I see this package in default distribution at some point sharing the same window as Thank you ! 👍 |
If this is not the appropriate forum for my question please let me know where would be the best place. I find it unintuitive that the imenu list does not center the found entry in the edit buffer . I have tried to change this myself but I am so new to emacs and elisp that I can't figure it out. Can somebody possibly guide me on how to make the imenu-list perform an evil-scroll-to-center after pressing RET in the imenu-list window? |
It would be better to open a new issue at either spacemacs repository or imenu-list repository
imenu-list uses (add-hook 'imenu-after-jump-hook #'evil-scroll-to-center) I've created a new issue upstream to add a specific hook for imenu-list, and I'll implement it when I get to it. |
@bmag, thanks! I'm constantly amazed by the forward thinking towards extensibility that emacs has. Very easy to change the behavior. Along these lines, the imenu-list layer doesn't integrate with the color theme besides "light" or "dark". Is there a way to get the colors to match the theme colors? |
@JohnLunzer you can set the relevant faces via the |
@bmag, thank you again. When I add the hook you specified
|
The problem here is that |
Ahh, I also see the value in |
imenu-list provides a side bar that shows all imenu entries of the current buffer. More info at https://github.com/bmag/imenu-list
I chose
SPC b i
as the binding to toggle imenu-list, as mnemonic for "buffer index", but of course that can be changed.How imenu-list differs from NeoTree and sr-speedbar: NeoTree only shows files and directories, sr-speedbar shows files, directories and imenu indexes, and imenu-list shows only imenu indexes.
How imenu-list differs from
spacemacs/jump-in-buffer
(SPC s l): imenu-list is a side bar that stays visible and updates automatically when switching buffers and serves as a visual reminder of the buffer's structure, whilespacemacs/jump-in-buffer
serves as a jump command and doesn't remain visible.