John Beckett <johnb.beck...@gmail.com> [12-05-13 12:56]: > meino.cramer wrote: > > is it possible to a portion of one line of text alphabetically? > > There is an example using Python which sorts a whole line at: > http://vim.wikia.com/wiki/Use_filter_commands_to_process_text > > You should provide a before-and-after example of what you mean. > Sort words in visually selected area in a single line? > Put result back into the line? What about punctuation? > > It would be possible to do something like that with split() to > break some copied text into words, then sort() to sort them. > You may want the non-alpha characters to be omitted. > > To illustrate: > :let s = 'one, two, and three!' > :put =join(sort(split(s, '\W\+'))) > > Result: > and one three two > > John > > -- > You received this message from the "vim_use" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php >
Here is an example: Before sort Is there a way to sort bdacefhgjilnkm? a b After sorting the marked portion(a<->b): Is there a way to sort abcdefghijklmn? Or in other words: Everything of the marked portion is sorted alphbetically (ASCII-based) character by character. But: I wanted to this via "vim-power" and no to use vim as a "shell" to call python (or whatelse) scripts. For that I dont need vim...for that I have zsh. Best regards, mcc -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php