Le vendredi 17 avril 2015 01:49:38 UTC+2, Tim Chase a écrit :
> On 2015-04-16 15:58, av wrote:
> > g,^\w,exe '.,.-1 join'
> >
> > Is it possible to achive the g,something,norm kJ but with ex
> > command instead, maybe it will work for me.
>
> A couple observations:
>
> - you're using :exe but don't really need to
>
> - your range is backwards
>
> I suspect that you can accomplish what you want with
>
> :g/^\w/-j
>
>
> where "-j" is the Ex command to, on the previous line ("-"), join it
> with the next line (":help :j").
>
> -tim
Hi Tim,
It is not working also. So I have this function with your -j method:
fu! g:Gon()
bd! test.txt
exe 'split c:/temp/test.txt'
g, = ,-j
endfu
And I have this test text here:
--
MySingleLineTextField = testalsdkflkasdf
MyMultilineTextField = alsdfjlasdjflksdjlf
asldjflaskdfjasdjflasjkdf
asdlkflaskdfjasdjfjasdkfjklsd
alsdflkasdfjksdjklf
MySingleLineTextField = 2308230982309weofsf
MyMultilineTextField = asljf9u3f92jfj23fio32jfio3j2iojf23
asdfisdjafjs09fjsdf09sdj0f
as0dfj0asdj0fasd0j9fas09dfj09sdj0f9sdjf
--
Then I call using: call g:Gon()
And the result is:
--
MySingleLineTextField = testalsdkflkasdf MyMultilineTextField = alsdfjlasdjflksdjlf
asldjflaskdfjasdjflasjkdf
asdlkflaskdfjasdjfjasdkfjklsd
alsdflkasdfjksdjklf
MySingleLineTextField = 2308230982309weofsf MyMultilineTextField = asljf9u3f92jfj23fio32jfio3j2iojf23
asdfisdjafjs09fjsdf09sdj0f
as0dfj0asdj0fasd0j9fas09dfj09sdj0f9sdjf
--
The expected results would be that all text that have not " = " would be joined with the previous line with " = " in it, like this:
--
MySingleLineTextField = testalsdkflkasdf
MyMultilineTextField = alsdfjlasdjflksdjlf asldjflaskdfjasdjflasjkdf asdlkflaskdfjasdjfjasdkfjklsd alsdflkasdfjksdjklf
MySingleLineTextField = 2308230982309weofsf
MyMultilineTextField = asljf9u3f92jfj23fio32jfio3j2iojf23 asdfisdjafjs09fjsdf09sdj0f as0dfj0asdj0fasd0j9fas09dfj09sdj0f9sdjf
--
Do you obtain this result?
Thank you,
Alexandre
--
--
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
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment