On 03/11/2011 12:22 AM, Michael(Xi Zhang) wrote:

On Thu, Mar 10, 2011 at 3:44 PM, Jeroen Budts <jer...@lightyear.be
<mailto:jer...@lightyear.be>> wrote:

    On <tel:03%2F10%2F2011>03/10/2011 <tel:03%2F10%2F2011> 09:23 PM,
    Christian Brabandt wrote:

        Hi Jeroen!

        On Do, 10 Mär 2011, Jeroen Budts wrote:

            On <tel:03%2F10%2F2011>03/10/2011 <tel:03%2F10%2F2011> 10:57
            AM, Christian Brabandt wrote:

                On Thu, March 10, 2011 10:35 am, Jeroen Budts wrote:

                    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.



If 'jvaBVy' works, why not mapping  jvaBVy to a Fn key or shorter command?
For example :
nmap <F9>  jvaBVy
or
nmap  fy    jvaBVy

fy means function yank


I know it is possible to map long commands to shorter commands but I try not do this because I'm a bit afraid that I could end up with a Vim configuration with mappings for almost anything and thus loosing my ability to use a default Vim without my configuration. So I try to only create mappings for plugins which aren't available on a default Vim anyway and for very specific cases. For stuff as discussed in this thread I prefer to learn and use a method which will work in any Vim install. Thanks for the suggestion though!

Jeroen

--
website: http://budts.be/ - twitter: @teranex
___________________________________
Registered Linux User #482240 - GetFirefox.com - ubuntu.com

--
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

Reply via email to