On Mar 10, 5:35 pm, Jeroen Budts <[email protected]> wrote: > Hi, > > I'm looking for the quickest method to yank an entire (php) function > when the cursor is somewhere in the first line of the function > definition like this (| = cursor): > > fun|ction foobar() { > if (true) { > return "not false :)"; > } > > } > > One possible solution would be: > jvaBVy > But I'm wondering if there it is possible in a shorter way and maybe > without using visual mode. > > Another solution I found is: > v][Vy > But this only seems to work if the function itself is not indented and > when i tried it without visual mode (^y][) it didn't include the last > line (}). >
You can redefine the ][ meaning: [ :help section ] :map ][ /}<CR>b99]} and using your sequence, should work quite well: v][Vy It seems that only way to go is using visual mode... Regards, KF -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
