sponsor Vim development Vim logo Vim Book Ad

self.vim : Vim Self Object Prototype System

 script karma  Rating 15/5, Downloaded by 2325  Comments, bugs, improvements  Vim wiki

created by
richard emberson
 
script type
utility
 
description
The self.vim library provides a base Object Prototype for a VimScript object
hierarchy which includes
method and data inheritance. Method dispatch is static rather than dynamic - a
VimScript
function calling limitation. Included are a couple of limited test scripts.

Source can be found at: https://github.com/megaannum/self
Self tutorial:
https://github.com/megaannum/self/blob/master/tutorial/self/Tutorial.md

The Self library is currently being used in the following scripts:
Forms Library
  http://www.vim.org/scripts/script.php?script_id=4150
Colorschemer utility
  http://www.vim.org/scripts/script.php?script_id=4240
Scalacommenter utility
  http://www.vim.org/scripts/script.php?script_id=3047
Vimside, Vim Scala IDE
  http://www.vim.org/scripts/script.php?script_id=4298
 
install details
    
Self.vim is a library plugin and can be placed in the autoload directory.
    $HOME/.vim/autoload/self.vim
    
Intalling with vim-addon-manager (VAM)

For more information about vim-addon-manager, see
[vim-addon-manager](https://github.com/MarcWeber/vim-addon-manager) and
[Vim-addon-manager getting
started](https://github.com/MarcWeber/vim-addon-manager/blob/master/doc/vim-addon-manager-getting-started.txt)

In your .vimrc, add self as shown below:

    fun SetupVAM()
      ...
      let g:vim_addon_manager = {}
      let g:vim_addon_manager.plugin_sources = {}
      ....
      let g:vim_addon_manager.plugin_sources['self'] = {'type': 'git', 'url':
'git://github.com/megaannum/self'}

      let plugins = [
        \ 'self'
        \ ]

      call vam#ActivateAddons(plugins,{'auto_install' : 0})
      ...
    endf
    call SetupVAM()

Now start Vim. You will be asked by vim-addon-manager
if you would like to download and install the self plugin (no dependencies).

Installing with pathogen
  I do not use pathogen. An example usage would be welcome.
 

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
self.zip 2.5 2012-11-29 7.0 richard emberson No longer use IS_TRUE/IS_FALSE (now, 1/0)
Added version function
self.zip 2.3 2012-08-24 7.0 richard emberson Changed '_type' attribute to '_kind' and getType() to getKind().
ObjectPrototype methods are now named not numbered.
Added tutorial.
Added rational number example.
self.zip 2.2 2012-07-30 7.3 richard emberson Vim 7.3 could not handle construct: call funcReturnDictionary().someFunc()
self.zip 2.1.1 2012-07-29 7.0 richard emberson Added additional documentation.
self.zip 2.1 2012-07-27 7.0 richard emberson Fixed FLOAT_TYPE value
self.zip 2.0 2012-07-27 7.0 richard emberson Corrected bugs found while writing the {Forms} library.
Re-organized code so that it could be autoloaded.
Added folding.
Added Object and Prototype Managers.
Added the 'reload(prefix)' function.
self.zip 1.0 2010-04-22 7.2 richard emberson Initial upload
ip used for rating: 3.149.213.209

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