Skip to content

Instantly share code, notes, and snippets.

@dhilst
Created May 15, 2021 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhilst/6c6249e56f8558f25d15da796033f685 to your computer and use it in GitHub Desktop.
Save dhilst/6c6249e56f8558f25d15da796033f685 to your computer and use it in GitHub Desktop.
OOP in VimL
function MyClass() abort
let this = {}
function this.setA() dict
let self.a = 1100
endfunc
function this.method() dict
return self.a
endfunc
return this
endfunc
let myObj = MyClass()
echo myObj.setA()
echo myObj.method()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment