Does jedi vim support anything like intellijs https://www.jetbrains.com/help/idea/structure-tool-window-file-structure-popup.html ?
Asked
Active
Viewed 522 times
0
-
It's not jedi in charge of the feature. nerdtree or something others. – mattn Jul 06 '17 at 00:00
-
No, at the moment this is not a Jedi feature. – Dave Halter Jul 06 '17 at 00:09
2 Answers
4
This very simple command gives you an actionable outline of your document:
:g/def\|class/#
You can map it if you don't want to type it all the time; and make it a bit cleaner in the same move:
augroup PythonStuff
autocmd!
autocmd FileType python nnoremap <buffer> <F12> :<C-u>g/\<def\>\\|\<class\>/#<CR>
augroup END

romainl
- 186,200
- 21
- 280
- 313
-
I wonder, is it possible to set automatically a mark at every of these points? – A S Jul 07 '17 at 19:46
-
1It should be possible to put a mark on the 26 first matches with a bit of vimscript, yes. How would you use those marks? – romainl Jul 08 '17 at 06:57
-
Well, my thought wasn't exactly about Python (where you can use `gd` and the likes) but more about other kind of structured text. And in general, how can this be achieved? Collecting these "points of interest" into a list, and then assigning marks to list elements? Or is there some other way around, what do you think? – A S Jul 08 '17 at 07:56
-
1The technical part doesn't sound hard at all. It's the "business" part that needs a bit of thinking. For example, it will be impossible for anyone to remember 26 mark ↔︎ symbol mappings. An obvious workaround would be to use signs but that introduces complexity. A lightweight, on-demand, actionable TOC seems enough to me. – romainl Jul 08 '17 at 08:37
-
In my particular case it's kinda 8-10 marks at the **very** maximum :) (more like 5). Also, since I'm not a programmer, the technical part doesn't seem extremely obvious to me :). For example, how to actually collect those "points of interest"? – A S Jul 08 '17 at 08:55
-
1I would `:help :redir` the output of the command I posted to a variable, `:help map()` lines to letters and `:help :mark` every line with its corresponding letter in a `:help :for` loop. – romainl Jul 08 '17 at 09:16
-
Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/148677/discussion-between-a-s-and-romainl). – A S Jul 08 '17 at 10:34
0
Found majutsushi/tagbar which does this pretty well actually. This video explains how it works with ruby too.

Raghuram Onti Srinivasan
- 745
- 6
- 19