sponsor Vim development Vim logo Vim Book Ad

vim-addon-mw-utils : some utilities I wrote

 script karma  Rating 2/7, Downloaded by 1080  Comments, bugs, improvements  Vim wiki

created by
Marc Weber
 
script type
utility
 
description
* cached file contents
  get some information from files and cache the result.
  Reparse the file when it has changed automatically.

* tiny-cmd : Never get the "Press ENTER or type command to continue"
   message again

* funcref:
  - poor man's closures for Vim.
  - Create function objects calling autoload function without sourcing that file
  - (be lazy, do the work when it has to be done)
  - get rid of the "Use upper case letters for custom functions" annoyance

   Example:
  let myFun = funcref#Function("return ARGS[0]")
  let result = funcref#Call(myFun, [2])

  let myFun2 =  funcref#Function("foo#bar#Baz")
  
  " pass arguments (kind of simple closure):
  let myFun2 =  funcref#Function("return ARGS", {args: [1]} )
  echo funcref#Call(myFun, [2])

  echoes [1,2]

  " bind function to an object:
  let myFun2 =  funcref#Function("return SELF.myvalue", {self: {"a": "myvalue"} } )

etc..

This library is used by many of my plugins

If something doesn't work it's a bug. So tell me to fix it!

Reuse this code if you like it!
 
install details
git repo: http://github.com/MarcWeber/vim-addon-mw-utils

I recommend using the vim-addon-manager to install this plugin.
-> http://www.vim.org/scripts/script.php?script_id=2905

Put this into your .vimrc and be done:
call scriptmanager#Activate(["vim-addon-mw-utils"])
 

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
vim-addon-mw-utils.zip 0.1 2010-01-22 7.2 Marc Weber Initial upload
ip used for rating: 52.14.168.56

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