Re: substitute() regex trim last newline from register ?

2020-01-18 Thread M Kelly
Tony, hi I ended up using getregtype("*") along with the @*=substitute() to get a perfect solution for my use. Thank you again for this info. take care, -m On Wednesday, January 15, 2020 at 11:53:24 PM UTC-5, Tony Mechelynck wrote: > > On Thu, Jan 16, 2020 at 3:08 AM M Kelly > > wrote: > >

Re: substitute() regex trim last newline from register ?

2020-01-15 Thread Tony Mechelynck
On Thu, Jan 16, 2020 at 3:08 AM M Kelly wrote: > > Tony, hi > > ok, thanks. I can use 0 v $ y. But V y is handy/quick ... > Inside of vim its all great, V works perfectly - its just I wanted to > automatically remove the last newline from "* if possible, > so that a V y and then outside of vim

Re: substitute() regex trim last newline from register ?

2020-01-15 Thread Tim Chase
On 2020-01-15 18:08, M Kelly wrote: > V y is handy/quick Just in case you haven't encountered it, you can make that even quicker by just using Y :-) -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

Re: substitute() regex trim last newline from register ?

2020-01-15 Thread M Kelly
Tim, hi ok, awesome. I think this works now - "aygv:let @* = substitute(@a, "\\_s\\+$", "", "") thx so much! -m On Wednesday, January 15, 2020 at 8:47:54 PM UTC-5, Tim Chase wrote: > > On 2020-01-15 17:29, M Kelly wrote: > > Hi, > > > > In visual-line mode when I yank to the * register and

Re: substitute() regex trim last newline from register ?

2020-01-15 Thread M Kelly
Tony, hi ok, thanks. I can use 0 v $ y. But V y is handy/quick ... Inside of vim its all great, V works perfectly - its just I wanted to automatically remove the last newline from "* if possible, so that a V y and then outside of vim paste doesn't have the extra newline. I just wondered if I

Re: substitute() regex trim last newline from register ?

2020-01-15 Thread Tim Chase
On 2020-01-15 17:29, M Kelly wrote: > Hi, > > In visual-line mode when I yank to the * register and then outside > of vim paste - I am getting a newline at the end of the selection. > This does not happen in visual block or char mode. > Does anyone know of a way to load into * reg the same

Re: substitute() regex trim last newline from register ?

2020-01-15 Thread Tony Mechelynck
On Thu, Jan 16, 2020 at 2:29 AM M Kelly wrote: > > Hi, > > In visual-line mode when I yank to the * register and then outside of vim > paste - I am getting a newline at the end of the selection. > This does not happen in visual block or char mode. > Does anyone know of a way to load into * reg

substitute() regex trim last newline from register ?

2020-01-15 Thread M Kelly
Hi, In visual-line mode when I yank to the * register and then outside of vim paste - I am getting a newline at the end of the selection. This does not happen in visual block or char mode. Does anyone know of a way to load into * reg the same selection but have the last newline trimmed off ? ie