Skip to content

machakann/vim-textobj-functioncall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-textobj-functioncall

Build status Build Status

The vim textobject plugin to treat function-call regions.

Default mappings are assigned to if and af.

  • if and af, both of them select a region like func(argument).
  • if and af behave differently when a function takes another function as its argument.
  • if selects the most inner function under the cursor.
  • af selects the first function including the cursor position by its parenthesis. However if any candidate would be found, it falls back to if.
             #              : cursor position
call func1(func2(argument))

           |<-----if---->|
call func1(func2(argument))
     |<--------af-------->|

If you don't like to map to if and af, please define the variable named g:textobj_functioncall_no_default_key_mappings in your vimrc.

let g:textobj_functioncall_no_default_key_mappings = 1

And then map to your preferable keys.

xmap iF <Plug>(textobj-functioncall-i)
omap iF <Plug>(textobj-functioncall-i)
xmap aF <Plug>(textobj-functioncall-a)
omap aF <Plug>(textobj-functioncall-a)

This textobject could select following patterns.

  • func(argument)
  • array[index]

About

The vim textobject plugin to treat function-call regions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published