Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first import.

  • Loading branch information...
commit 15fb0b5858dfa05fd29ed6817ee0ff9364dcee21 0 parents
@mattn authored
Showing with 49 additions and 0 deletions.
  1. +48 −0 autoload/ctrlp/mark.vim
  2. +1 −0  plugin/ctrlp-mark.vim
48 autoload/ctrlp/mark.vim
@@ -0,0 +1,48 @@
+if exists('g:loaded_ctrlp_mark') && g:loaded_ctrlp_mark
+ finish
+endif
+let g:loaded_ctrlp_mark = 1
+
+let s:mark_var = {
+\ 'init': 'ctrlp#mark#init()',
+\ 'exit': 'ctrlp#mark#exit()',
+\ 'accept': 'ctrlp#mark#accept',
+\ 'lname': 'mark',
+\ 'sname': 'mark',
+\ 'type': 'mark',
+\ 'sort': 0,
+\}
+
+if exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)
+ let g:ctrlp_ext_vars = add(g:ctrlp_ext_vars, s:mark_var)
+else
+ let g:ctrlp_ext_vars = [s:mark_var]
+endif
+
+function! s:parse_line(line)
+ let mx = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(\d\+\)\s\+\(.*\)$'
+ let cols = map(range(1, 4), "substitute(a:line, mx, '\\'.v:val, '')")
+endfunction
+
+function! ctrlp#mark#init()
+ let s = ''
+ redir => s
+ silent marks
+ redir END
+ return split(s, "\n")[1:]
+endfunc
+
+function! ctrlp#mark#accept(mode, str)
+ call ctrlp#exit()
+ exe "normal! g'".matchstr(a:str, '^\s*\zs.\ze\s.*')
+endfunction
+
+function! ctrlp#mark#exit()
+endfunction
+
+let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
+function! ctrlp#mark#id()
+ return s:id
+endfunction
+
+" vim:fen:fdl=0:ts=2:sw=2:sts=2
1  plugin/ctrlp-mark.vim
@@ -0,0 +1 @@
+command! CtrlPMark cal ctrlp#init(ctrlp#mark#id())
Please sign in to comment.
Something went wrong with that request. Please try again.