visual sort folds

16 views
Skip to first unread message

Ni Va

unread,
Oct 18, 2017, 5:13:46 AM10/18/17
to vim_use
Hi,

Is it possible to visual sort folded code by head's name ?


See the example ?
Thank you
Nicholas

Capture.PNG

Christian Brabandt

unread,
Oct 18, 2017, 5:17:47 AM10/18/17
to vim_use

On Mi, 18 Okt 2017, Ni Va wrote:

> Hi,
>
> Is it possible to visual sort folded code by head's name ?
>
>
> See the example ?

Yes and I don't understand what exactly you want to be done.

Christian
--
Aus Murphy's Gesetze:
Auch in einem sonst gänzlich leeren Umkleideraum hat der einzige
andere immer das Schließfach direkt neben deinem.

Ni Va

unread,
Oct 18, 2017, 5:39:37 AM10/18/17
to vim_use
When you type :%sort, you sort all lines of file alphabeticaly.


I wonder if I can sort alphabeticaly folded parts of code by foldername.

Thank you

C.v.St.

unread,
Oct 18, 2017, 6:00:30 AM10/18/17
to vim...@googlegroups.com


Am 10/18/17 um 11:39 schrieb Ni Va:
> Le mercredi 18 octobre 2017 11:17:47 UTC+2, Christian Brabandt a écrit :
>> On Mi, 18 Okt 2017, Ni Va wrote:
...
>>> Is it possible to visual sort folded code by head's name ?
...
>> Yes and I don't understand what exactly you want to be done.
...
> I wonder if I can sort alphabeticaly folded parts of code by foldername.

I assume, you mean 'sort by the contents of the fold "header" line'?
So I tried this, folded some lines, and while folded did ':sort'.
Is sorted by 'lines', i.e. single lines, not folds.
Sorting 'by fold of same level' would be nice though ;-)

Stucki

Christian Brabandt

unread,
Oct 18, 2017, 6:06:57 AM10/18/17
to vim_use

On Mi, 18 Okt 2017, Ni Va wrote:

> Le mercredi 18 octobre 2017 11:17:47 UTC+2, Christian Brabandt a écrit:
> > Yes and I don't understand what exactly you want to be done.
>
> When you type :%sort, you sort all lines of file alphabeticaly.
>
> I wonder if I can sort alphabeticaly folded parts of code by foldername.

Is that what you are looking for?
https://stackoverflow.com/a/13554576/789222

Christian
--
Sollten die Lautsprecher ihrer Stereoanlage sehr dumpf klingen, dann
prüfen sie bitte, ob dieselben eventuell noch verpackt sind.

Ni Va

unread,
Oct 18, 2017, 7:45:40 AM10/18/17
to vim_use
It seems effectively.
Reply all
Reply to author
Forward
0 new messages