Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This plugin adds text object support for separated arguments enclosed by brackets.

License

NotificationsYou must be signed in to change notification settings

cposture/vim-textobj-argument

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This plugin adds text object support for separated arguments enclosed by brackets.

Installation

You can install it using your favorite plugin manager. Here's an example usingvim-plug

Plug 'kana/vim-textobj-user'Plug 'cposture/vim-textobj-argument'

Dependent on another pluginkana/vim-textobj-user, a Vim plugin to create your own text objects without pain

Examples

function(a, /*comment*/ b, c)
  • With the cursor on the character 'b', typingdaa, would getfunction(a, c), typingdia would getfunction(a, /*comment*/ , c)
  • Counts are supported. With the cursor on the character 'a' or before it for example character 'f', typingd2aa or2daa would getfunction(c)
  • Move to start of next argument, with the cursor on the character 'a', typing]a, the cursor will move to the 'b' parameter.

Configuration

Customize the separator, which is, by default, in regular expression format, refer to:help pattern:

let g:argument_separator = ','

Customize the left bracket, which is([ by default, in regular expression format, refer to:help pattern:

let g:argument_left_bracket = '[([]'

Customize the right bracket, which is)] by default, in regular expression format, refer to:help pattern:

let g:argument_right_bracket = '[)]]'

Customize motion mappings, default mappings are described in the following section "Motion commands":

let g:argument_mapping_select_around = 'aa'let g:argument_mapping_select_inside = 'ia'let g:argument_mapping_move_previous = '[a'let g:argument_mapping_move_start = '[A'let g:argument_mapping_move_next = ']a'let g:argument_mapping_move_end = ']A'

Motion commands

Motion commands on text objects are a powerful feature of Vim.

aa - select 'around' argument with separator and comment

ia - select ‘inside’ argument without separator and comment

[a - move to start of previous argument

]a - move to start of next argument

[A - move to first argument

]A - move to last argument

Inspiration

About

This plugin adds text object support for separated arguments enclosed by brackets.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp