Thank you very much for your answer. The problem is, I am not skilled enough
(yet ;-)) to build something with your advice...
So I turned toward macros and came up with :
/[@&]^M^@:call setline('.',join(sort(split(getline('.'),' ')),'
'))^M<80>kuJ<80>kd0
(find @ or&, split the line there, sort this part of the line, move up, join
the two halves, go to the beginning of the next line)
which works. However, this seems far less elegant than what you suggested.
Thanks again
--
View this message in context: http://vim.1045645.n5.nabble.com/How-to-sort-inside-a-line-starting-from-a-precise-pattern-tp5711382p5711386.html
Sent from the Vim - General mailing list archive at Nabble.com.
--
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
Sunday, October 21, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment