Skip to content

Commit

Permalink
add tiny_cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcWeber committed Jan 22, 2010
1 parent 35647b0 commit b6d69a5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
19 changes: 19 additions & 0 deletions autoload/tiny_cmd.vim
@@ -0,0 +1,19 @@
" vim suffers:

exec scriptmanager#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
11 changes: 11 additions & 0 deletions doc/tiny_cmd.txt
@@ -0,0 +1,11 @@
*tiny-cmd* make long commands short so that they hopefully no longer trigger "press Enter .. [ok]"
Author: Marc Weber, marco-oweber@gmx.de

-----------------------------------------------------------------------
HOWTO~

Example usage: >
let nr = tiny_cmd#Put('call MyFunc("long string")|....')
map <F2> :exec 'tiny_cmd#Get('.nr.')'<cr>
<
Use Pop instead of Get if the command is used once only

0 comments on commit b6d69a5

Please sign in to comment.