sponsor Vim development Vim logo Vim Book Ad

Parameter Text Objects : Defines parameter text objects

 script karma  Rating 33/15, Downloaded by 1120  Comments, bugs, improvements  Vim wiki

created by
David Larson
 
script type
utility
 
description
This script defines a parameter text object. A parameter is the text between parentheses or commas, typically found in a function's argument list.

This script also adds mappings to help you associate printf-type "%"-formatted strings with their corresponding arguments.

See:
:help text-objects
  for a description of what can be done with text objects.

Like all the other text-objects, a parameter text object can be selected following these commands: 'd', 'c', 'y', 'v', etc. The script defines these operator mappings:

   aP    "a parameter", select a parameter, including one comma (if there is one).

   iP    "inner parameter", select a parameter, not including commas.

This script also adds commands that are helpful when constructing printf-style "%" formatted strings. Press ",a" (by default) to move the cursor to the corresponding argument. Press ",A" (by default) to do the opposite.
 
install details
Drop the vim script in your plugin directory.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
parameter_objects.vim 1.1 2020-03-14 7.0 David Larson Added mappings for %-formatted strings.
parameter_objects.vim 0.2a 2010-03-16 7.0 David Larson The script can handle counts now (eg. 2daP). Implementation suggestion by David Kotchan (thanks David!).
parameter_objects.vim 0.1d 2010-02-19 7.0 David Larson Added <Plug> mappings so that the user can easily remap the commands. Suggested by Kana Natsuno
parameter_objects.vim 0.1c 2010-02-18 7.0 David Larson Ignores strings and comments
ip used for rating: 44.200.77.59

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github