Saturday, March 25, 2017

Parallel or Serial jobs

Hi,

I have wrote some vimscript to launch some commands on windows? Here it is below.

Problem encountered is that some command/task/jobs launched depends on previous one so I want to be able to parallel or serialize them.

Have you got some advises or knwowledge to apply that on vimscript.

Thanks a lot.
Niva


--
--
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.

Re: Translate \u0041 to A

On Sa, 25 Mär 2017, JohnBeckett wrote:

> Given this text:
>
> A\u0042C\u0044E
>
> What substitute changes it to:
>
> ABCDE

Something like this:
:%s/\\u\(\x\{4\}\)/\=nr2char('0x'.submatch(1),1)/g

or with a function like this:

func! String(match)
exe 'return "'.a:match.'"'
endfunc

And then:
:%s/\\u\x\{4\}/\=String(submatch(0))/g

Best,
Christian
--
Abschied nehmen ist immer schmerzlich, selbst wenn es nur für kurze
Zeit ist.
-- Anne Morrow Lindbergh (Muscheln in meiner Hand)

--
--
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.

Translate \u0041 to A

Given this text:

A\u0042C\u0044E

What substitute changes it to:

ABCDE

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

---
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.

Friday, March 24, 2017

Re: Fixate window layout?

On Thursday, March 23, 2017 at 1:47:34 PM UTC-5, Christian Brabandt wrote:
> On Do, 23 Mär 2017, lith wrote:
>
> > The commands `wincmd c`, `bdelete` will remove the split and I end up with a
> > single vim window. Neither winfixheight nor winfixwidth protected me from this.
> > But I'd rather expect/want the other window to not change at all and the
> > current window be displaying a new empty buffer -- or the previous buffer if
> > any.
>
> Well don't use those commands unless you want to close those windows. I
> don't see the problem here. I think the flexible layout is an advantage
> compared to other applications.
>

To get an empty buffer, use :enew. To return to a previous buffer use CTRL-6 in normal mode.

--
--
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.

RE: Edit a Mac file with 0x13 CR newlines on Windows?

-----Original Message-----
>> Is it possible on Windows to edit a old-style, pre-OS/X file from a Mac that uses 0x0D (CR) as the newline? If so, how?
>>
>> Does this have something to do with 'set ffs='?
>
>Yes. The 'fileformats' option specifies which fileformat(s) you want Vim to recognize. It is a comma-separated list: >
>
>unix: each line ends with a single <NL>, 0x10
>dos: each line ends with a <CR><NL> pair, 0x13 0x10 in that order.
>mac: each line ends with only a <CR>, 0x13.
>
>Depending on the option's value, Vim will try to determine the 'fileformat' used for the file and set that. Note that Windows
> (dos-format) files lacking an end-of-line on their last line will usually be detected as "unix" if 'fileformats' includes it, displaying a ^M at the end of all other lines, and that when trying to read a file as "dos" (either because the option does not include "unix" or because you forced dos >mode, see below) lines lacking a <CR> before the <NL> will be silently accepted.
>
>To force a certain fileformat, add e.g. ++ff=mac between the command (:edit, :new, :vsplit, etc.) and the filename.
>
>
>See:
> :help 'fileformats'
> :help 'fileformat'
> :help file-formats
> :help ++opt

Many thanks to Tony Mechelynck and John Beckett.

*-*-*- Presbyterian_Healthcare_Services_DISCLAIMER -*-*-*
This message originates from Presbyterian Healthcare Services or one of its affiliated organizations.
It contains information, which may be confidential or privileged, and is intended only for the individual or entity named above. It is prohibited for anyone else to disclose, copy, distribute or use the contents of this message. All personal messages express views solely of the sender, which are not to be attributed to Presbyterian Healthcare Services or any of its affiliated organizations, and may not be distributed without this disclaimer.

If you received this message in error, please notify us immediately at info@phs.org
If you would like more information about Presbyterian Healthcare Services please visit our web site http://www.phs.org

--
--
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.

Re: Edit a Mac file with 0x13 CR newlines on Windows?

On Thu, 23 Mar 2017 21:23:04 -0700 (PDT)
JohnBeckett <johnb.beckett@gmail.com> wrote:

> On Friday, March 24, 2017 at 2:34:05 PM UTC+11, Paul Watson wrote:
> > Is it possible on Windows to edit a old-style, pre-OS/X file from a
> > Mac that uses 0x0D (CR) as the newline? If so, how?
> >
> > Does this have something to do with 'set ffs='?
>
> See
> http://vim.wikia.com/wiki/File_format
>
> If the file is open in Vim, entering the following reloads it using
> CR-only line endings.
>
> :e ++ff=mac
>
> John
>

You can also use Modeline Magic to set the file format in the file. See
http://vim.wikia.com/wiki/Modeline_magic


--
Don't stop where the ink does.

Shawn H Corey

--
--
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.

Thursday, March 23, 2017

Re: Edit a Mac file with 0x13 CR newlines on Windows?

OOps, I meant 0x0A or 10 decimal, not 0x10, and 0x0D or 13 decimal, not 0x13.

Tony.

On Fri, Mar 24, 2017 at 5:25 AM, Tony Mechelynck
<antoine.mechelynck@gmail.com> wrote:
> On Thu, Mar 23, 2017 at 4:02 PM, Paul Watson <paul.hermeneutic@gmail.com> wrote:
>> Is it possible on Windows to edit a old-style, pre-OS/X file from a Mac that uses 0x0D (CR) as the newline? If so, how?
>>
>> Does this have something to do with 'set ffs='?
>
> Yes. The 'fileformats' option specifies which fileformat(s) you want
> Vim to recognize. It is a comma-separated list:
>
> unix: each line ends with a single <NL>, 0x10
> dos: each line ends with a <CR><NL> pair, 0x13 0x10 in that order.
> mac: each line ends with only a <CR>, 0x13.
>
> Depending on the option's value, Vim will try to determine the
> 'fileformat' used for the file and set that. Note that Windows
> (dos-format) files lacking an end-of-line on their last line will
> usually be detected as "unix" if 'fileformats' includes it, displaying
> a ^M at the end of all other lines, and that when trying to read a
> file as "dos" (either because the option does not include "unix" or
> because you forced dos mode, see below) lines lacking a <CR> before
> the <NL> will be silently accepted.
>
> To force a certain fileformat, add e.g. ++ff=mac between the command
> (:edit, :new, :vsplit, etc.) and the filename.
>
> See:
> :help 'fileformats'
> :help 'fileformat'
> :help file-formats
> :help ++opt
>
> Best regards,
> Tony.

--
--
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.