aboutsummaryrefslogtreecommitdiff
path: root/vim/bundle/vim-addon-mw-utils/autoload/tiny_cmd.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/bundle/vim-addon-mw-utils/autoload/tiny_cmd.vim')
-rw-r--r--vim/bundle/vim-addon-mw-utils/autoload/tiny_cmd.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/vim/bundle/vim-addon-mw-utils/autoload/tiny_cmd.vim b/vim/bundle/vim-addon-mw-utils/autoload/tiny_cmd.vim
new file mode 100644
index 0000000..052bbe0
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/autoload/tiny_cmd.vim
@@ -0,0 +1,19 @@
+" vim suffers:
+
+exec vam#DefineAndBind('s:c','g:vim_tiny_cmd', '{}')
+
+fun! tiny_cmd#Put(a)
+ let new = get(s:c,'next',0) +1
+ let s:c['next'] = new
+ let s:c[new] = a:a
+ return new
+endf
+
+fun! tiny_cmd#Get(nr)
+ return s:c[a:nr]
+endf
+
+" Get and remove item
+fun! tiny_cmd#Pop(nr)
+ let r = s:c[a:nr] | unlet s:c[a:nr] | return r
+endf