- Notifications
You must be signed in to change notification settings - Fork0
This plugin adds text object support for separated arguments enclosed by brackets.
License
cposture/vim-textobj-argument
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This plugin adds text object support for separated arguments enclosed by brackets.
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
function(a, /*comment*/ b, c)- With the cursor on the character 'b', typing
daa, would getfunction(a, c), typingdiawould getfunction(a, /*comment*/ , c) - Counts are supported. With the cursor on the character 'a' or before it for example character 'f', typing
d2aaor2daawould 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.
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 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
About
This plugin adds text object support for separated arguments enclosed by brackets.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.