delete until

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

delete until

Mathieu
Hello,
If i want to delete on my current line until say "a", i can do dfa.
If i do that, "a" is deleted.
Is there any command do delete strictly before a?
For exemple, if i am on the beginning of the line:
"star", i want to obtain "ar", and "not "r".

:he search-commands
did not give me the answer.

Best regards,
Mathieu Roux

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/a97a4d0c9bf644dbe25d9a0664188ac878ececad.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: delete until

Stefan Klein-2
Hi,

Am Sa., 18. Mai 2019 um 17:27 Uhr schrieb Mathieu Roux <[hidden email]>:
If i want to delete on my current line until say "a", i can do dfa.
[ ... ]
"star", i want to obtain "ar", and "not "r".

i guess you're looking for t(o) instead of f(orward)

regards,
Stefan
 

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAA%3DcwqFXFu2wYdWPxDo3YBdbpjvCCQ5F0WKb4r2iBAHCmF-FpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: delete until

Grant Taylor-2
On 5/18/19 9:34 AM, Stefan Klein wrote:
> i guess you're looking for t(o) instead of f(orward)

Agreed.

I've frequently seen it referred as (un)t(il).  (I think that's what I
see in vim :help.)

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/53b8dba0-8dfe-90ab-fe02-562b0ae9b085%40spamtrap.tnetconsulting.net.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: delete until

Mathieu
Thanks! that is exactly what i want!


On sam., 2019-05-18 at 10:51 -0600, 'Grant Taylor' via vim_use wrote:

> On 5/18/19 9:34 AM, Stefan Klein wrote:
> > i guess you're looking for t(o) instead of f(orward)
>
> Agreed.
>
> I've frequently seen it referred as (un)t(il).  (I think that's what
> I
> see in vim :help.)
>
> --

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/91f0441dfa77f0eaf79147faebe8d6caae8d59d3.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: delete until

Mathieu
In reply to this post by Stefan Klein-2
hmmmm....

and how can i say?: go to the next /, and if you don't find it, go to
the next '

For exemple, if i am at the beginning of the string
'abc/def/ghi',
it should go to /
and if i am on "g" on the same string, it should go to '

In fact i want to map this command to <F5>.

map <F5> f('|/)v0*

quelque chose comme ça...

Best regards,
Mathieu Roux





On sam., 2019-05-18 at 17:34 +0200, Stefan Klein wrote:

> Hi,
>
> Am Sa., 18. Mai 2019 um 17:27 Uhr schrieb Mathieu Roux <
> [hidden email]>:
> > If i want to delete on my current line until say "a", i can do dfa.
>
> [ ... ]
> > "star", i want to obtain "ar", and "not "r".
>
> i guess you're looking for t(o) instead of f(orward)
>
> regards,
> Stefan
>  
> --
> --
> 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 [hidden email].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vim_use/CAA%3DcwqFXFu2wYdWPxDo3YBdbpjvCCQ5F0WKb4r2iBAHCmF-FpA%40mail.gmail.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/6647abcb77c0d56d9b99a43d76a5d79b78f7f39b.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: delete until

Tim Chase
On 2019-05-19 19:21, Mathieu Roux wrote:

> and how can i say?: go to the next /, and if you don't find it, go
> to the next '
>
> For exemple, if i am at the beginning of the string
> 'abc/def/ghi',and some /
> it should go to /
> and if i am on "g" on the same string, it should go to '
>
> In fact i want to map this command to <F5>.
>
> map <F5> f('|/)v0*

Might try something like this?

nnoremap <f5> /\%#.\(.\{-}\/\<bar>[^\/]*'\)/e<cr>

-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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190519160353.4abf9eb2%40bigbox.christie.dr.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: delete until

Tim Chase
The way you described the problem, it sounded like you wanted to
go forward to the next slash even if there was an intervening "'"
char:

   this 'is/a/firstpath' and this 'is/another/path'

where, if your cursor was on the "f" of "firstpath", you wanted to
jump to the next slash (after the second "is") instead of the
single-quote at the end of "firstpath".  So that's what the solution
in my previous email does.  However, if you just want a "go to the
next slash-or-single-quote, whichever is next" it's a lot tidier:

 nnoremap <f5> /[/']/<cr>

-tim


On 2019-05-19 16:03, Tim Chase wrote:

> On 2019-05-19 19:21, Mathieu Roux wrote:
> > and how can i say?: go to the next /, and if you don't find it, go
> > to the next '
> >
> > For exemple, if i am at the beginning of the string
> > 'abc/def/ghi',and some /
> > it should go to /
> > and if i am on "g" on the same string, it should go to '
> >
> > In fact i want to map this command to <F5>.
> >
> > map <F5> f('|/)v0*  
>
> Might try something like this?
>
> nnoremap <f5> /\%#.\(.\{-}\/\<bar>[^\/]*'\)/e<cr>
>
> -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
> [hidden email]. To view this discussion on
> the web visit
> https://groups.google.com/d/msgid/vim_use/20190519160353.4abf9eb2%40bigbox.christie.dr.
> 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190519162132.7018d2e6%40bigbox.christie.dr.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: delete until

Mathieu
Wonderful!

This is exactly what i wanted...

map <f5> /[/']/<cr>hvF'*

Thanks a lot !






On dim., 2019-05-19 at 16:21 -0500, Tim Chase wrote:

> The way you described the problem, it sounded like you wanted to
> go forward to the next slash even if there was an intervening "'"
> char:
>
>    this 'is/a/firstpath' and this 'is/another/path'
>
> where, if your cursor was on the "f" of "firstpath", you wanted to
> jump to the next slash (after the second "is") instead of the
> single-quote at the end of "firstpath".  So that's what the solution
> in my previous email does.  However, if you just want a "go to the
> next slash-or-single-quote, whichever is next" it's a lot tidier:
>
>  nnoremap <f5> /[/']/<cr>
>
> -tim
>
>
> On 2019-05-19 16:03, Tim Chase wrote:
> > On 2019-05-19 19:21, Mathieu Roux wrote:
> > > and how can i say?: go to the next /, and if you don't find it,
> > > go
> > > to the next '
> > >
> > > For exemple, if i am at the beginning of the string
> > > 'abc/def/ghi',and some /
> > > it should go to /
> > > and if i am on "g" on the same string, it should go to '
> > >
> > > In fact i want to map this command to <F5>.
> > >
> > > map <F5> f('|/)v0*  
> >
> > Might try something like this?
> >
> > nnoremap <f5> /\%#.\(.\{-}\/\<bar>[^\/]*'\)/e<cr>
> >
> > -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
> > [hidden email]. To view this discussion on
> > the web visit
> >
https://groups.google.com/d/msgid/vim_use/20190519160353.4abf9eb2%40bigbox.christie.dr
> > .
> > 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/7282c1bc5bfb020d2e64e4e16012a52c85b98ebc.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.