vim - Selecting a code block from middle of it -


i can select word when cursor @ middle of word doing --> v+i+w

but can select block middle of it?

for example:

def foo(x):     y = x + 5 --> cursor in line      return x * y 

is there way select whole block doing v+i+codeblock ?

the paragraph text object built-in, if block delimited empty lines, vip (visual mode, select inner paragraph) select it.

apart that, many plugins extend vim's built-in text objects custom ones. vim-dentures defines several useful ones based on indent. i've once seen 1 ruby blocks; can search vim.org such.

with countjump plugin, or textobj-user plugin, can (relatively) define own text objects!


Comments