ci, (or something?)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ci, (or something?)

Jason Felice
Is there something that changes a function parameter in a C-style language, e.g. delimited by commas or parens?  I find myself wanting this frequently.

Thanks,
-Jason

--
--
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].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ci, (or something?)

Gary Johnson-4
On 2018-03-10, Jason Felice wrote:
> Is there something that changes a function parameter in a C-style language,
> e.g. delimited by commas or parens?  I find myself wanting this frequently.

ci) or ci( or cib will change everything within ( and ).
ct, will change everything from the cursor to the next comma.
T, will move the cursor to the right of the next comma to the left.

See

    :help 04.2
    :help 04.8
    :help text-objects
    :help left-right-motions

HTH,
Gary

--
--
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].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ci, (or something?)

John Passaro
In reply to this post by Jason Felice

On Sat, Mar 10, 2018, 19:02 Jason Felice <[hidden email]> wrote:
Is there something that changes a function parameter in a C-style language, e.g. delimited by commas or parens?  I find myself wanting this frequently.

Thanks,
-Jason

--
--
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].
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].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ci, (or something?)

Jason Franklin
In reply to this post by Jason Felice
On Saturday, March 10, 2018 at 7:02:15 PM UTC-5, Jason Felice wrote:
> Is there something that changes a function parameter in a C-style language, e.g. delimited by commas or parens?  I find myself wanting this frequently.
>
>
> Thanks,
> -Jason

Hey Jason,

I use the plugin "targets.vim" (https://github.com/wellle/targets.vim) for this exact purpose.  When you install this plugin, you will have the option to "cia" or "caa" or "dia", etc.  It also includes a number of other useful text objects you may have never considered (i.e., to change between two "/" chars in a path, use "ci/").

The project is also maintained.  I submitted an issue not too long ago, and it was eventually fixed.

Best,
Jason Franklin

--
--
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].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ci, (or something?)

Jason Felice
@John @Jason . Thanks!  Both seem neat!  I'm going to try vim-angry for now, since target changes a bunch, including things I probably rely on.

Thanks,
-Jason

On Mon, Mar 12, 2018 at 8:27 AM, Jason Franklin <[hidden email]> wrote:
On Saturday, March 10, 2018 at 7:02:15 PM UTC-5, Jason Felice wrote:
> Is there something that changes a function parameter in a C-style language, e.g. delimited by commas or parens?  I find myself wanting this frequently.
>
>
> Thanks,
> -Jason

Hey Jason,

I use the plugin "targets.vim" (https://github.com/wellle/targets.vim) for this exact purpose.  When you install this plugin, you will have the option to "cia" or "caa" or "dia", etc.  It also includes a number of other useful text objects you may have never considered (i.e., to change between two "/" chars in a path, use "ci/").

The project is also maintained.  I submitted an issue not too long ago, and it was eventually fixed.

Best,
Jason Franklin

--
--
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].
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].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ci, (or something?)

Ben Fritz
In reply to this post by Jason Felice
On Saturday, March 10, 2018 at 6:02:15 PM UTC-6, Jason Felice wrote:
> Is there something that changes a function parameter in a C-style language, e.g. delimited by commas or parens?  I find myself wanting this frequently.
>
>
> Thanks,
> -Jason

Here's a pull request I've been using that adds a "matched character" text object. My most common use is probably commas just as you say.

https://github.com/vim/vim/pull/958

--
--
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].
For more options, visit https://groups.google.com/d/optout.