Sunday, January 31, 2016

Re: How would you repeatedly produce these lines?

* etoipm1i0@gmail.com <etoipm1i0@gmail.com> [160201 06:18]:
> I'm coding in Python and need to produce a number of lines like the following
> > p3[0] = {'name': , 'symbol': , 'number': }
For that I usually use keyboard macros: copy the line, jump to the
bracket, increase. The keys are
Ypf[CTRL-A
and as a macro e.g.
qqYpf[CTRL-Aq
100@q to repeat 100 times

Greetings,
mo

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

How would you repeatedly produce these lines?

I'm coding in Python and need to produce a number of lines like the following

> p3[0] = {'name': , 'symbol': , 'number': }
> p3[1] = {'name': , 'symbol': , 'number': }
> ...

and I'm wondering the best way to go about this. My main thought is to just copy-paste and maybe fill the brackets with some kind of place-keeper and then try to figure out a way to sequentially replace them with increasing integers. But somehow it seems like there out to be a more elegant Vim solution.

Any thoughts?

--
--
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: Can you edit EBCDIC files on non-OS390 builds of VIM?

On Sun, Jan 31, 2016 at 3:32 AM, Justin Dearing <zippy1981@gmail.com> wrote:
> I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:
>
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
> Included patches: 1-872
> Compiled by <alexpux@gmail.com>
> Huge version without GUI. Features included (+) or not (-):
> <snip/>
> -ebcdic +mouse +smartindent -xim
> <snip/>
>
> I cloned the git repo and configure --enable-ebcdic was not an option. Looking at src/auto/configure, it looks like ebcdic support is enabled if ASCII support is not present. Is there an option to turn it on?
>

IIUC, +ebcdic means "compiled on an EBCDIC machine", IOW, the Vim
_source_ was in EBCDIC. In order to edit EBCDIC _data_ files it is
enough to have a Vim which can thanslate the data losslessly back and
forth between the file's 'fileencoding' (i.e. the charset the file
uses on disk) and Vim's 'encoding' (i.e. the charset Vim uses in
memory, for which UTF-8 is the recommended value).

I expect that any Vim compiled with +iconv (or with +iconv/dyn with
the iconv or libiconv library found at runtime) should be able to edit
such files _provided_ that their 'fileencoding' be recognized when the
time comes to edit them. One of the possible ways is to tell Vim the
'fileencoding' when loading the file in order to edit it. See:
iconv --list
:help ++opt
http://vim.wikia.com/wiki/Working_with_Unicode

The first of these tells you which charsets are known to the iconv
program installed on your system (There are usually very many, so you
may want to filter the output though the less pager, or even through
"view -" without quotes). The second one tells you how to tell Vim the
charset of a given editfile. The third is general information about
using Vim for editing files not all in the same charset, by setting
Vim to use Unicode internally so any charset can be translated
losslessly to and from the one used internally by Vim.

Example:
:new ++enc=ebcdic-us /path/to/filename.ext

will edit the file in a new window and translate it from EBCDIC(US) to
Vim's 'encoding' (e.g. to UTF-8) when reading; when comes the time to
save your edited file, the opposite translation will happen.


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.

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

2016-02-01 2:14 GMT+03:00 Eric Christopherson <echristopherson@gmail.com>:
> On Sat, Jan 30, 2016, Justin Dearing wrote:
>> I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:
>>
>> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
>> Included patches: 1-872
>> Compiled by <alexpux@gmail.com>
>> Huge version without GUI. Features included (+) or not (-):
>> <snip/>
>> -ebcdic +mouse +smartindent -xim
>> <snip/>
>>
>> I cloned the git repo and configure --enable-ebcdic was not an option.
>> Looking at src/auto/configure, it looks like ebcdic support is enabled
>> if ASCII support is not present. Is there an option to turn it on?
>
> Sorry, I don't know the answer to that, but I find it interesting to see
> this question, just a few days after reading a page laying out the case
> for NeoVim -- although I can't find the exact page now, I believe it
> gave EBCDIC support as an example of something that no one would ever
> use Vim for!

Editing EBCDIC files is *not* what EBCDIC support in Vim means. It is
support for compiling and operating on systems where EBCDIC is an
encoding used by the compiler (specifically in string and character
literals). You may see in configure:

AC_TRY_COMPILE([ ],
[ /* TryCompile function for CharSet.
Treat any failure as ASCII for compatibility with existing art.
Use compile-time rather than run-time tests for cross-compiler
tolerance. */
#if '0'!=240
make an error "Character set is not EBCDIC"

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

2016-01-31 5:32 GMT+03:00 Justin Dearing <zippy1981@gmail.com>:
> I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:
>
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
> Included patches: 1-872
> Compiled by <alexpux@gmail.com>
> Huge version without GUI. Features included (+) or not (-):
> <snip/>
> -ebcdic +mouse +smartindent -xim
> <snip/>
>
> I cloned the git repo and configure --enable-ebcdic was not an option. Looking at src/auto/configure, it looks like ebcdic support is enabled if ASCII support is not present. Is there an option to turn it on?

+ebcdic means that *internal encoding* of Vim will be EBCDIC AFAIK.
And by "internal encoding" I mean not &encoding (though this also),
but encoding used by the compiler as well. I do not think this is what
you want.

To edit ebcdic file you need +iconv and you need to know how iconv
names used encoding. E.g. I can edit file using `e ++enc=ebcdicus`,
but `iconv --list | grep --ignore-case ebcdic | wc --lines` shows 77
*EBCDIC* encoding variants. Some look like an aliases to other (like
`ebcdic-us` and `ebcdicus`), but I can't be sure.

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

--
--
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: Can you edit EBCDIC files on non-OS390 builds of VIM?

On Sat, Jan 30, 2016, Justin Dearing wrote:
> I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:
>
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
> Included patches: 1-872
> Compiled by <alexpux@gmail.com>
> Huge version without GUI. Features included (+) or not (-):
> <snip/>
> -ebcdic +mouse +smartindent -xim
> <snip/>
>
> I cloned the git repo and configure --enable-ebcdic was not an option.
> Looking at src/auto/configure, it looks like ebcdic support is enabled
> if ASCII support is not present. Is there an option to turn it on?

Sorry, I don't know the answer to that, but I find it interesting to see
this question, just a few days after reading a page laying out the case
for NeoVim -- although I can't find the exact page now, I believe it
gave EBCDIC support as an example of something that no one would ever
use Vim for!

--
Eric Christopherson

--
--
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: Can you edit EBCDIC files on non-OS390 builds of VIM?

Justin Dearing <zippy1981@gmail.com> writes:
> I'd like to edit EBCDIC encoded files in VIM on windows vim

Windows VIM apparently supports all windows codepages as file
encodings [++enc=cpNNN] including cp37 and cp1047, etc. It seems
to work fine for me, though I'm not sure if there are any subtle
aspects that could cause problems.

--
--
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: Can you edit EBCDIC files on non-OS390 builds of VIM?

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iF4EAREIAAYFAlauCi0ACgkQRL8D6wymVNasJgD/ejbtsUVolJR1wrVAs7xLIiiI
uIGHLwR5Po1MWYj/v58A/jIm9XIE2Gz/CfCAlqZ36uZwjqeRXBUp9gtu0vcHkJWB
=ePX/
-----END PGP SIGNATURE-----
On 31 Jan 2016, at 02:32, Justin Dearing wrote:
> I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:
>
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
> Included patches: 1-872
> Compiled by <alexpux@gmail.com>
> Huge version without GUI. Features included (+) or not (-):
> <snip/>
> -ebcdic +mouse +smartindent -xim
> <snip/>
>
> I cloned the git repo and configure --enable-ebcdic was not an option. Looking at src/auto/configure, it looks like ebcdic support is enabled if ASCII support is not present. Is there an option to turn it on?

I edit copies of mainframe files locally by using netrw, and get ftp to translate between Ascii & EBCDIC

Regards, Andy


--
Andrew Long
Andrew dot Long at Mac dot 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

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

Saturday, January 30, 2016

Can you edit EBCDIC files on non-OS390 builds of VIM?

I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
Included patches: 1-872
Compiled by <alexpux@gmail.com>
Huge version without GUI. Features included (+) or not (-):
<snip/>
-ebcdic +mouse +smartindent -xim
<snip/>

I cloned the git repo and configure --enable-ebcdic was not an option. Looking at src/auto/configure, it looks like ebcdic support is enabled if ASCII support is not present. Is there an option to turn it on?

--
--
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: "Exploding" a paragraph into individual lines



fredag 29 januari 2016 skrev Tim Chase <vim@tim.thechases.com>:
On 2016-01-28 20:04, Rik wrote:
> 1. Please do not top-post.

Also, trim out the extra rubbish and only keep the stuff you're
responding to.  When you (Rik) replied, you included 96 lines of
quotation, of which less than a dozen could be considered valuable
context.  Especially when you're quoting things that come from Google
Groups which likes to bloat out quoting with empty quote-junk.

I'm as guilty of doing that. I was going to  defend myself by saying that it is difficult for me to select-and-cut extensively in the gmail app for iphone because I am literally lame, but I could have refrained from replying until I could do so on my desktop, where I edit mail in gvim.

/bpj

--
--
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, January 29, 2016

Re: "Exploding" a paragraph into individual lines

On 2016-01-28 20:04, Rik wrote:
> 1. Please do not top-post.

Also, trim out the extra rubbish and only keep the stuff you're
responding to. When you (Rik) replied, you included 96 lines of
quotation, of which less than a dozen could be considered valuable
context. Especially when you're quoting things that come from Google
Groups which likes to bloat out quoting with empty quote-junk.

-tim


--
--
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: "Exploding" a paragraph into individual lines

On 2016-01-29 00:03, Salman Halim wrote:
> Suddenly, the two-space option looks pretty good. :)

This is my main reason for sticking to the old-school
two-spaces-after-a-sentence since Vim knows how to work with
sentences distinct from abbreviations.

:help cpo-j
:h 'joinspaces'

Since all the prose I write ends up being processed (usually raw HTML
processed by a browser that formats inter-sentence spacing however it
sees fit; though any TeX, Markdown, or DocBook would do likewise), it
allows me to work predictably with sentences in Vim while getting
"proper" output from whatever is viewing the results.

-tim


--
--
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: "Exploding" a paragraph into individual lines



fredag 29 januari 2016 skrev Salman Halim <salmanhalim@gmail.com>:


On Jan 28, 2016 11:56 PM, "Chris Collision" <cfcollision@gmail.com> wrote:
>
>
>
> On Thu, Jan 28, 2016 at 8:04 PM, Rik <amphiboly@gmail.com> wrote:
>>
>> On Thursday, January 28, 2016 at 10:56:59 PM UTC-5, Chris Collision wrote:
>> > Well-formatted text isn't the same thing as natural language; I do not think this is doomed to fail.  Is there a way to use paragraph / sentence motions to do this "exploding"?  I have played around for a few minutes but have not had much luck.  Perhaps an expert can take this farther.
>> >
>> >
>> > On Thu, Jan 28, 2016 at 7:40 PM, Rik <amph...@gmail.com> wrote:
>> > On Wednesday, January 27, 2016 at 12:49:39 PM UTC-5, Chris Lott wrote:
>> >
>> > > I'd like to take a paragraph like the following:
>> >
>> > >
>> >
>> > > This is a paragraph. Wow! What do I do now?
>> >
>> > >
>> >
>> > > And break it into individual lines, ala:
>> >
>> > >
>> >
>> > > This is a paragraph.
>> >
>> > > Wow!
>> >
>> > > What do I do now?
>> >
>> > >
>> >
>> > > StackExchange revealed this regex that seems to work well matching the proper lines:
>> >
>> > > [.!?][])"']*\($\|[ ]\)
>> >
>> > >
>> >
>> > > So I can do this:
>> >
>> > > :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>> >
>> > >
>> >
>> > > But obviously need something where XXX is!
>> >
>> > >
>> >
>> > > c
>> >
>> >
>> >
>> > Regex cannot handle the complexity of natural language, and thus you are doomed to fail, Mr.
>> >
>> >
>> >
>> > Lott.
>> >
>> >
>> >
>> > --
>> >
>> > Rik
>> >
>> >
>> >
>> >
>> >
>> > --
>> >
>> > --
>> >
>> > 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+u...@googlegroups.com.
>> >
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>> >
>> >
>> >
>> > --
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > -Collision
>> > @cfcollision | http://idontevenownatelevision.com/ | http://tinyletter.com/collision | 503.997.1907
>>
>> 1. Please do not top-post.
>>
>> That would be parsed by the proposed regex as
>>   1.
>>   Please do not top-post.
>>
>> Doomed to fail, Mr. Lott.
>>
>> That would be parsed as:
>>   Doomed to fail, Mr.
>>   Lott.
>>
>> Do you see any problem here?
>>
>> --
>> rik
>>
>> --
>> --
>> 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.
>
>
>
> Please forgive me for top-posting: I forgot that gmail does that by default.  Won't happen again.  Would this incredibly difficult counterexample of yours be solved by the venerable convention of using two spaces after sentence-ending punctuation?
>
>
>
> --
> -Collision
> @cfcollision | http://idontevenownatelevision.com/ | http://tinyletter.com/collision | 503.997.1907

The convention of two spaces after sentences isn't something you can hold most people to these days. It might be easier to just rejoin lines that end in common abbreviations such as Mr., Dr., etc.

Of course, the case of the "etc." is more interesting because it could be the end of a sentence or it may not. Typically, if it's not the end of a sentence, it's followed by a comma. And, if it is the end of a sentence, it is followed by whitespace and a capital letter.

You may also have to contend with Ave., Blvd., St. (Saint or Street). I think it will require more logic than is afforded by a single substitute operation, as suggested before.

Suddenly, the two-space option looks pretty good. :)


Most of those abbreviations begin with a capital letter and are only <= 4 letters long. While a sentence certainly may end in something like "Bob." that may be an acceptable overkill. Then you need to look out for "e.g.", "i.e.", "viz." and a few more which I can't remember off the top of my head. That should be possible with lookbehind, something like (untested since I'm AFC)

s#\v%(%(%(\u\l{1,3}|i\.e|e\.g|viz)\.?)@<![.?!]\)?)@<=#\r\r#g

--
--
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, January 28, 2016

Re: "Exploding" a paragraph into individual lines


On Jan 28, 2016 11:56 PM, "Chris Collision" <cfcollision@gmail.com> wrote:
>
>
>
> On Thu, Jan 28, 2016 at 8:04 PM, Rik <amphiboly@gmail.com> wrote:
>>
>> On Thursday, January 28, 2016 at 10:56:59 PM UTC-5, Chris Collision wrote:
>> > Well-formatted text isn't the same thing as natural language; I do not think this is doomed to fail.  Is there a way to use paragraph / sentence motions to do this "exploding"?  I have played around for a few minutes but have not had much luck.  Perhaps an expert can take this farther.
>> >
>> >
>> > On Thu, Jan 28, 2016 at 7:40 PM, Rik <amph...@gmail.com> wrote:
>> > On Wednesday, January 27, 2016 at 12:49:39 PM UTC-5, Chris Lott wrote:
>> >
>> > > I'd like to take a paragraph like the following:
>> >
>> > >
>> >
>> > > This is a paragraph. Wow! What do I do now?
>> >
>> > >
>> >
>> > > And break it into individual lines, ala:
>> >
>> > >
>> >
>> > > This is a paragraph.
>> >
>> > > Wow!
>> >
>> > > What do I do now?
>> >
>> > >
>> >
>> > > StackExchange revealed this regex that seems to work well matching the proper lines:
>> >
>> > > [.!?][])"']*\($\|[ ]\)
>> >
>> > >
>> >
>> > > So I can do this:
>> >
>> > > :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>> >
>> > >
>> >
>> > > But obviously need something where XXX is!
>> >
>> > >
>> >
>> > > c
>> >
>> >
>> >
>> > Regex cannot handle the complexity of natural language, and thus you are doomed to fail, Mr.
>> >
>> >
>> >
>> > Lott.
>> >
>> >
>> >
>> > --
>> >
>> > Rik
>> >
>> >
>> >
>> >
>> >
>> > --
>> >
>> > --
>> >
>> > 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+u...@googlegroups.com.
>> >
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>> >
>> >
>> >
>> > --
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > -Collision
>> > @cfcollision | http://idontevenownatelevision.com/ | http://tinyletter.com/collision | 503.997.1907
>>
>> 1. Please do not top-post.
>>
>> That would be parsed by the proposed regex as
>>   1.
>>   Please do not top-post.
>>
>> Doomed to fail, Mr. Lott.
>>
>> That would be parsed as:
>>   Doomed to fail, Mr.
>>   Lott.
>>
>> Do you see any problem here?
>>
>> --
>> rik
>>
>> --
>> --
>> 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.
>
>
>
> Please forgive me for top-posting: I forgot that gmail does that by default.  Won't happen again.  Would this incredibly difficult counterexample of yours be solved by the venerable convention of using two spaces after sentence-ending punctuation?
>
>
>
> --
> -Collision
> @cfcollision | http://idontevenownatelevision.com/ | http://tinyletter.com/collision | 503.997.1907

The convention of two spaces after sentences isn't something you can hold most people to these days. It might be easier to just rejoin lines that end in common abbreviations such as Mr., Dr., etc.

Of course, the case of the "etc." is more interesting because it could be the end of a sentence or it may not. Typically, if it's not the end of a sentence, it's followed by a comma. And, if it is the end of a sentence, it is followed by whitespace and a capital letter.

You may also have to contend with Ave., Blvd., St. (Saint or Street). I think it will require more logic than is afforded by a single substitute operation, as suggested before.

Suddenly, the two-space option looks pretty good. :)

Salman

--
--
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: "Exploding" a paragraph into individual lines



On Thu, Jan 28, 2016 at 8:04 PM, Rik <amphiboly@gmail.com> wrote:
On Thursday, January 28, 2016 at 10:56:59 PM UTC-5, Chris Collision wrote:
> Well-formatted text isn't the same thing as natural language; I do not think this is doomed to fail.  Is there a way to use paragraph / sentence motions to do this "exploding"?  I have played around for a few minutes but have not had much luck.  Perhaps an expert can take this farther.
>
>
> On Thu, Jan 28, 2016 at 7:40 PM, Rik <amph...@gmail.com> wrote:
> On Wednesday, January 27, 2016 at 12:49:39 PM UTC-5, Chris Lott wrote:
>
> > I'd like to take a paragraph like the following:
>
> >
>
> > This is a paragraph. Wow! What do I do now?
>
> >
>
> > And break it into individual lines, ala:
>
> >
>
> > This is a paragraph.
>
> > Wow!
>
> > What do I do now?
>
> >
>
> > StackExchange revealed this regex that seems to work well matching the proper lines:
>
> > [.!?][])"']*\($\|[ ]\)
>
> >
>
> > So I can do this:
>
> > :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> >
>
> > But obviously need something where XXX is!
>
> >
>
> > c
>
>
>
> Regex cannot handle the complexity of natural language, and thus you are doomed to fail, Mr.
>
>
>
> Lott.
>
>
>
> --
>
> Rik
>
>
>
>
>
> --
>
> --
>
> 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+u...@googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
>
> --
>
>
>
>
>
>
>
> -Collision
> @cfcollision | http://idontevenownatelevision.com/ | http://tinyletter.com/collision | 503.997.1907

1. Please do not top-post.

That would be parsed by the proposed regex as
  1.
  Please do not top-post.

Doomed to fail, Mr. Lott.

That would be parsed as:
  Doomed to fail, Mr.
  Lott.

Do you see any problem here?

--
rik

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


Please forgive me for top-posting: I forgot that gmail does that by default.  Won't happen again.  Would this incredibly difficult counterexample of yours be solved by the venerable convention of using two spaces after sentence-ending punctuation?


--
--
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: "Exploding" a paragraph into individual lines

On Thursday, January 28, 2016 at 10:56:59 PM UTC-5, Chris Collision wrote:
> Well-formatted text isn't the same thing as natural language; I do not think this is doomed to fail.  Is there a way to use paragraph / sentence motions to do this "exploding"?  I have played around for a few minutes but have not had much luck.  Perhaps an expert can take this farther.
>
>
> On Thu, Jan 28, 2016 at 7:40 PM, Rik <amph...@gmail.com> wrote:
> On Wednesday, January 27, 2016 at 12:49:39 PM UTC-5, Chris Lott wrote:
>
> > I'd like to take a paragraph like the following:
>
> >
>
> > This is a paragraph. Wow! What do I do now?
>
> >
>
> > And break it into individual lines, ala:
>
> >
>
> > This is a paragraph.
>
> > Wow!
>
> > What do I do now?
>
> >
>
> > StackExchange revealed this regex that seems to work well matching the proper lines:
>
> > [.!?][])"']*\($\|[ ]\)
>
> >
>
> > So I can do this:
>
> > :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> >
>
> > But obviously need something where XXX is!
>
> >
>
> > c
>
>
>
> Regex cannot handle the complexity of natural language, and thus you are doomed to fail, Mr.
>
>
>
> Lott.
>
>
>
> --
>
> Rik
>
>
>
>
>
> --
>
> --
>
> 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+u...@googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
>
> --
>
>
>
>
>
>
>
> -Collision
> @cfcollision | http://idontevenownatelevision.com/ | http://tinyletter.com/collision | 503.997.1907

1. Please do not top-post.

That would be parsed by the proposed regex as
1.
Please do not top-post.

Doomed to fail, Mr. Lott.

That would be parsed as:
Doomed to fail, Mr.
Lott.

Do you see any problem here?

--
rik

--
--
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: "Exploding" a paragraph into individual lines

Well-formatted text isn't the same thing as natural language; I do not think this is doomed to fail.  Is there a way to use paragraph / sentence motions to do this "exploding"?  I have played around for a few minutes but have not had much luck.  Perhaps an expert can take this farther.

On Thu, Jan 28, 2016 at 7:40 PM, Rik <amphiboly@gmail.com> wrote:
On Wednesday, January 27, 2016 at 12:49:39 PM UTC-5, Chris Lott wrote:
> I'd like to take a paragraph like the following:
>
> This is a paragraph. Wow! What do I do now?
>
> And break it into individual lines, ala:
>
> This is a paragraph.
> Wow!
> What do I do now?
>
> StackExchange revealed this regex that seems to work well matching the proper lines:
> [.!?][])"']*\($\|[ ]\)
>
> So I can do this:
> :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> But obviously need something where XXX is!
>
> c

Regex cannot handle the complexity of natural language, and thus you are doomed to fail, Mr.

Lott.

--
Rik

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



--

--
--
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: "Exploding" a paragraph into individual lines

On Wednesday, January 27, 2016 at 12:49:39 PM UTC-5, Chris Lott wrote:
> I'd like to take a paragraph like the following:
>
> This is a paragraph. Wow! What do I do now?
>
> And break it into individual lines, ala:
>
> This is a paragraph.
> Wow!
> What do I do now?
>
> StackExchange revealed this regex that seems to work well matching the proper lines:
> [.!?][])"']*\($\|[ ]\)
>
> So I can do this:
> :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> But obviously need something where XXX is!
>
> c

Regex cannot handle the complexity of natural language, and thus you are doomed to fail, Mr.

Lott.

--
Rik

--
--
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: Multi-language support broken with patch 1165

On 28 January 2016 at 22:07, Bram Moolenaar <Bram@moolenaar.net> wrote:
>> > > After 1165, if I do something like set LANG=ja_JP, and then launch gVim,
>> > > the screen is totally corrupt.
>> > >
>> > > After analysing the patch, I find it is now picking up libintl-8.dll from
>> > > my Lua installation. It does not pick up the version that I tested to work
>> > > with Vim and put specifically inside the Vim directory. Also be reminded
>> > > the DLL shipped with Vim is called libintl.dll. So the change is not
>> > > intuitive to users at all.
>> > >
>> > > It seems to me "try the newer version first" is not a good idea, and I
>> > > would suggest reverting this patch.
>> >
>> > That's disappointing. Is it that the libintl-8.dll that comes with Lua
>> > is different than the one that Vim supports, or is that dll the same but
>> > does it not work?
>>
>> I am not familiar with the libintl details. Some observations: The Lua
>> libintl-8.dll exports 76 functions, while the original one shipped
>> with Vim exports 10 functions. The version I use (that works with Vim)
>> exports 25 functions.
>>
>> > I thought this libintl-8.dll was used by the iconv dll, but perhaps it's
>> > used in a different way?
>>
>> The version I use imports iconv.dll (so the opposite dependency),
>> besides msvcrt.dll and kernel32.dll. The problematic version only
>> depends on msvcrt.dll and kernel32.dll. Same for the libiconv2.dll in
>> the Lua directory.
>
> I'll revert the change to try libint-8.dll first.
>
> I hope the change to libiconf load ordering does not need to be
> reverted. Let me know if that also causes problems.

Thanks, Bram. The new build does not exhibit this issue any longer. :-)

--
Wu Yongwei
URL: http://wyw.dcweb.cn/

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

Conversion from binary key codes to key notations?

Hi,

Often I'll write a vim macro on the fly and then save it in a file.
However, when I paste the register contents the macro lists the binary
key codes (e.g., ^M, ^[) instead of the respective key notations (e.g.,
<CR>, <Esc>). Is there any way to convert a line with embedded binary
key codes to a line with the respective key notations?

Regards,

--
Mun

--
--
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: insert deselects rectselection

Hi Christian!

Christian Brabandt <cblists@256bit.org> writes:

> Hi christoph.kliemt!
>
> On Do, 28 Jan 2016, christoph.kliemt@pgxml.net wrote:
>
>> Ben Fritz <fritzophrenic@gmail.com> writes:
>>
>> > On Thursday, January 28, 2016 at 4:57:50 AM UTC-6, christoph.kliemt@pgxml.net wrote:
>> >> Hi,
>> >>
>> >> i select a rectangular region with Ctrl-v and some cursor movement
>> >> commands.
>> >> Next, i want to append some chars to every column of the rectangle
>> >> typing A.
>> >> This puts vim into insert-mode (as expected), but unselects the region
>> >> (not expected) so that the insert command only affects the line where
>> >> the cursor is.
>> >> Is this the expected behaviour?
>> >>
>> >
>> > It's expected that the visual block goes away, and your edit will only
>> > appear on a single line while you are in insert mode.
>> >
>> > But when you hit <Esc> to leave insert mode after appending your text,
>> > the change should get applied to every line anyway. Doesn't this
>> > happen for you?
>>
>> Hmmm... happens as expected when i use <Esc>, but if i use <Ctrl-C> to
>> leave visual mode, nothing happens; both end visual mode. Why is this?
>
> Always think of Ctrl-C of aborting your current operation.

I see... and <Esc> then is the (sql-like) commit of the current
transaction/operation?

I'm quite new to vim and i read the visual-mode helpfile, but i did not
find a hint about this difference between <Esc> and <Ctrl-C> (both exit
visual mode).

Where do i need to read further about things like these... i suppose
this is "vim-basic-just-have-to-know"-stuff?

Christoph

--
--
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: insert deselects rectselection

On Do, 28 Jan 2016, Ben Fritz wrote:

> Works for me in Windows, with 7.4.977
>
> Looks like it's time for me to pull some new changes...I seem to be
> over 200 patches behind :-)

Perhaps its time to mention
https://github.com/vim/vim-win32-installer/releases

BTW: pull requests that improve the wording are welcome ;)

Best,
Christian
--
Literatur ist das Fragment der Fragmente; das wenigste dessen,
was geschah und gesprochen worden, ward geschrieben; vom
Geschriebenen ist das wenigste übrig geblieben.
-- Goethe, Maximen und Reflektionen, Nr. 404

--
--
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: insert deselects rectselection

Hi christoph.kliemt!

On Do, 28 Jan 2016, christoph.kliemt@pgxml.net wrote:

> Ben Fritz <fritzophrenic@gmail.com> writes:
>
> > On Thursday, January 28, 2016 at 4:57:50 AM UTC-6, christoph.kliemt@pgxml.net wrote:
> >> Hi,
> >>
> >> i select a rectangular region with Ctrl-v and some cursor movement
> >> commands.
> >> Next, i want to append some chars to every column of the rectangle
> >> typing A.
> >> This puts vim into insert-mode (as expected), but unselects the region
> >> (not expected) so that the insert command only affects the line where
> >> the cursor is.
> >> Is this the expected behaviour?
> >>
> >
> > It's expected that the visual block goes away, and your edit will only
> > appear on a single line while you are in insert mode.
> >
> > But when you hit <Esc> to leave insert mode after appending your text,
> > the change should get applied to every line anyway. Doesn't this
> > happen for you?
>
> Hmmm... happens as expected when i use <Esc>, but if i use <Ctrl-C> to
> leave visual mode, nothing happens; both end visual mode. Why is this?

Always think of Ctrl-C of aborting your current operation.

Best,
Christian
--
Die Kreatur ist sehr schwach; denn sucht sie etwas, findet sie's
nicht. Stark aber ist Gott; denn sucht er die Kreatur, so hat er sie
gleich in seiner Hand.
-- Goethe, Maximen und Reflektionen, Nr. 623

--
--
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: insert deselects rectselection

Ben Fritz <fritzophrenic@gmail.com> writes:

> On Thursday, January 28, 2016 at 4:57:50 AM UTC-6, christoph.kliemt@pgxml.net wrote:
>> Hi,
>>
>> i select a rectangular region with Ctrl-v and some cursor movement
>> commands.
>> Next, i want to append some chars to every column of the rectangle
>> typing A.
>> This puts vim into insert-mode (as expected), but unselects the region
>> (not expected) so that the insert command only affects the line where
>> the cursor is.
>> Is this the expected behaviour?
>>
>
> It's expected that the visual block goes away, and your edit will only
> appear on a single line while you are in insert mode.
>
> But when you hit <Esc> to leave insert mode after appending your text,
> the change should get applied to every line anyway. Doesn't this
> happen for you?

Hmmm... happens as expected when i use <Esc>, but if i use <Ctrl-C> to
leave visual mode, nothing happens; both end visual mode. Why is this?

regards,

Christoph

--
--
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: editing a _corrupted_ CP1252 file


Erik Christiansen <dvalin@internode.on.net>: Jan 27 08:03PM +1100

On 26.01.16 13:11, Kenneth Reid Beesley wrote:
> setglobal fileencoding=utf-8
 
> " when editing an existing file, try to read it in these encodings, use the first that succeeds
> set fileencodings=ucs-bom,utf-8,latin1
 
It doesn't seem all that complicated. A quick test on a "simulated
corrupted CP1252" file like yours both displayed <81>, and 8g8 worked
here without any fiddling at all. I have:
 
set encoding=utf-8 " Is default anyway, IIRC.
 
fileencodings=ucs-bom,utf-8,default,latin1
 
which seems to have latched on: fileencoding=latin1
given the input file.
 
That seems to confirm what ":h 8g8" says:
 
This works in two situations:
1. when 'encoding' is any 8-bit encoding
2. when 'encoding' is "utf-8" and 'fileencoding' is any 8-bit encoding
 
And I don't even have any "++bad=keep" anywhere.
 
Erik




Hi Erik,

Thanks again.  Here are the key points:

I know (omnisciently) that certain files should be cp1252, but that some of them are corrupted with undefined-in-cp1252 bytes like \x81.

I want to edit the file as CP1252, i.e., I want the fileencoding to be cp1252 because that's what the file is _supposed_ to be.
I want to see/find any bad bytes so that I can manually correct them (but I'm not perfect—I might miss some bad bytes).

AND CRUCIALLY When I try to write the buffer back to file, I want the fileencoding to be set to cp1252 so that gvim will refuse to write the file if I've missed any bad bytes like \x81.

gvim -c "e ++enc=cp1252  ++bad=keep"   filethatshouldbecp1252.txt

gives me exactly what I want.  The fileencoding is forced to be cp1252.  I see bad-for-cp1252 bytes like \x81 kept and displayed in blue as <81>, and I can find
them with 8g8.   AND If I neglected to fix a bad byte like \x81, and I try to write the buffer back to file, I get an error message saying that conversion failed.
That effectively forces me to fix the file, make it legal cp1252, before the buffer is written back to file.

If the fileencoding defaults to latin1, gvim will happily write the bad-for-cp1252 bytes back to the original file, which remains corrupted.

Best,

Ken

Re: insert deselects rectselection

On Thursday, January 28, 2016 at 4:57:50 AM UTC-6, christoph.kliemt@pgxml.net wrote:
> Hi,
>
> i select a rectangular region with Ctrl-v and some cursor movement
> commands.
> Next, i want to append some chars to every column of the rectangle
> typing A.
> This puts vim into insert-mode (as expected), but unselects the region
> (not expected) so that the insert command only affects the line where
> the cursor is.
> Is this the expected behaviour?
>

It's expected that the visual block goes away, and your edit will only appear on a single line while you are in insert mode.

But when you hit <Esc> to leave insert mode after appending your text, the change should get applied to every line anyway. Doesn't this happen for you?

> I use:
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 28 2016
> 11:25:03) Included patches: 1-1187
>
> On a linux box in a gnome-terminal 3.4.11
>

Works for me in Windows, with 7.4.977

Looks like it's time for me to pull some new changes...I seem to be over 200 patches behind :-)

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

insert deselects rectselection

Hi,

i select a rectangular region with Ctrl-v and some cursor movement
commands.
Next, i want to append some chars to every column of the rectangle
typing A.
This puts vim into insert-mode (as expected), but unselects the region
(not expected) so that the insert command only affects the line where
the cursor is.
Is this the expected behaviour?

I use:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 28 2016
11:25:03) Included patches: 1-1187

On a linux box in a gnome-terminal 3.4.11

regards,

Christoph




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

Wednesday, January 27, 2016

Re: Augmenting built in mappings

On Wed, Jan 27, 2016 at 12:28 PM, Josef Fortier <josef.fortier@gmail.com> wrote:
> I'm trying to augment built in key (adding behavior) and came up with this approach, which in initial tests seems to work:
>
> " ======================
> " psuedo code for 'smart' augmenter
> function Smart()
> if [some test]
> [do augmented]
> else
> return [mapped letter]
> endif
> endfunction
>
> " and then a remap call
> nnoremap <expr> <nowait> [mapped letter] Smart()
>


That's perfectly fine.

---

Justin M. Keyes

--
--
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: add mapping for buftype=nofile?

On Wed, Jan 27, 2016 at 7:10 PM, Josef Fortier <josef.fortier@gmail.com> wrote:
> I'm rather pleased with my simple solution, and thought someone else here might appreciate it:
>
> nnoremap q<enter> :q!<cr>
>
> <enter> cannot be mapped to a buffer. It makes a nice "get out of here" mapping :-)

The built-in "ZQ" normal mode command already does that.

Justin M. Keyes

--
--
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: add mapping for buftype=nofile?

I'm rather pleased with my simple solution, and thought someone else here might appreciate it:

nnoremap q<enter> :q!<cr>

<enter> cannot be mapped to a buffer. It makes a nice "get out of here" mapping :-)

--
--
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: "Exploding" a paragraph into individual lines

2016-01-27 20:49 GMT+03:00 Chris Lott <chris@chrislott.org>:
> I'd like to take a paragraph like the following:
>
> This is a paragraph. Wow! What do I do now?
>
> And break it into individual lines, ala:
>
> This is a paragraph.
> Wow!
> What do I do now?
>
> StackExchange revealed this regex that seems to work well matching the proper lines:
> [.!?][])"']*\($\|[ ]\)
>
> So I can do this:
> :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> But obviously need something where XXX is!

This should be `\1`, while part before `\(` should be surrounded by
`\(\)`. And already existing `\(` should be `\%(` because you do not
need capturing here. You can also put `\zs` before `\%(`, in this case
`XXX` should be nothing, `\(\)` is also not needed.

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

--
--
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: "Exploding" a paragraph into individual lines

On 2016-01-27 09:49, Chris Lott wrote:
> I'd like to take a paragraph like the following:
>
> This is a paragraph. Wow! What do I do now?
>
> And break it into individual lines, ala:
>
> This is a paragraph.
> Wow!
> What do I do now?
>
> StackExchange revealed this regex that seems to work well matching
> the proper lines: [.!?][])"']*\($\|[ ]\)
>
> So I can do this:
> :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> But obviously need something where XXX is!

There are two possibilities: capture the stuff you want to keep
with "\(...\)" and put it where the "XXX" is with "\1":

:%s/\([.!?][])"']*\)\($\|[ ]\)/\1\r\r/g

or, simply start your replacement at that location using "\zs"

:%s/[.!?][])"']*\zs\($\|[ ]\)/\r\r/g

You might also want to capture multiple spaces, changing it from

\($\|[ ]\)

to

\($\|[ ]\+\)

(the brackets around the single space are optional, but do help with
readability; I'd have just used

\($\| \+\)

for one or more spaces)

-tim




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

"Exploding" a paragraph into individual lines

I'd like to take a paragraph like the following:

This is a paragraph. Wow! What do I do now?

And break it into individual lines, ala:

This is a paragraph.
Wow!
What do I do now?

StackExchange revealed this regex that seems to work well matching the proper lines:
[.!?][])"']*\($\|[ ]\)

So I can do this:
:%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g

But obviously need something where XXX is!

c

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

Augmenting built in mappings

I'm trying to augment built in key (adding behavior) and came up with this approach, which in initial tests seems to work:

" ======================
" psuedo code for 'smart' augmenter
function Smart()
if [some test]
[do augmented]
else
return [mapped letter]
endif
endfunction

" and then a remap call
nnoremap <expr> <nowait> [mapped letter] Smart()

" ============

Is this a reasonable approach?
Are there problems I should be aware of?

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