sponsor Vim development Vim logo Vim Book Ad

expand.vim : method to simply an quickly post expand a cmd.  "index ff<c-cr>" for example.

 script karma  Rating -1/3, Downloaded by 1173  Comments, bugs, improvements  Vim wiki

created by
Robert KellyIV
 
script type
utility
 
description
method to simply an quickly post expand a cmd.  "index ff<c-cr>" for example.
(<c-cr> being mapped to this cmd.)

NOTE this is a QUICKY!
For what it is worth, hopefully useful to someone :)

The reason for this over a basic mapping, or DrC.Stubs is the ability to
specify the variable(s) to work on.

I.e.
  iInd < m_array.size() for<c-cr>

  for    (    iInd = 0; iInd < m_array.size(); iInd++)
  {
      <cursor>
  }

or
  m_array ff<c-cr>

  for(int i=0;i<m_array.length; i++){
      <cursor>
  }//end for loop over array m_array[i]

NOTE that the command function shold leave the cursor in a position that a
normal mode `o` will place the cursor at the desired location. Kind of a HACK
but good enough for now.
 
install details
Drop in ~/.vim/plugin or the like.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
expand.vim 0.1 2003-10-27 6.0 Robert KellyIV Initial upload
ip used for rating: 18.221.85.33

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github