Skip to content
Browse files

first import.

  • Loading branch information...
0 parents commit bde2280da970ddf8cd06ae1f8e622a945c55201f @mattn committed Apr 27, 2012
Showing with 44 additions and 0 deletions.
  1. +43 −0 autoload/ctrlp/register.vim
  2. +1 −0 plugin/ctrlp-mark.vim
43 autoload/ctrlp/register.vim
@@ -0,0 +1,43 @@
+if exists('g:loaded_ctrlp_register') && g:loaded_ctrlp_register
+ finish
+endif
+let g:loaded_ctrlp_register = 1
+
+let s:register_var = {
+\ 'init': 'ctrlp#register#init()',
+\ 'exit': 'ctrlp#register#exit()',
+\ 'accept': 'ctrlp#register#accept',
+\ 'lname': 'register',
+\ 'sname': 'register',
+\ 'type': 'register',
+\ 'sort': 0,
+\}
+
+if exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)
+ let g:ctrlp_ext_vars = add(g:ctrlp_ext_vars, s:register_var)
+else
+ let g:ctrlp_ext_vars = [s:register_var]
+endif
+
+function! ctrlp#register#init()
+ let s = ''
+ redir => s
+ silent registers
+ redir END
+ return split(s, "\n")[1:]
+endfunc
+
+function! ctrlp#register#accept(mode, str)
+ call ctrlp#exit()
+ exe "normal! ".matchstr(a:str, '^\S\+\ze.*')."p"
+endfunction
+
+function! ctrlp#register#exit()
+endfunction
+
+let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
+function! ctrlp#register#id()
+ return s:id
+endfunction
+
+" vim:fen:fdl=0:ts=2:sw=2:sts=2
1 plugin/ctrlp-mark.vim
@@ -0,0 +1 @@
+command! CtrlPRegister cal ctrlp#init(ctrlp#register#id())

0 comments on commit bde2280

Please sign in to comment.
Something went wrong with that request. Please try again.