Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

funky!

  • Loading branch information...
commit 3a78f4a1cf623b0258415514354647645c9af240 1 parent 948907d
@tacahiroy authored
View
2  README.markdown
@@ -1,4 +1,4 @@
-ctrlp.vim.exts
+ctrlp-funky
============
This is a collection of ctrlp.vim extension.
View
46 autoload/ctrlp/funks.vim → autoload/ctrlp/funky.vim
@@ -1,15 +1,15 @@
-" File: autoload/ctrlp/funks.vim
+" File: autoload/ctrlp/funky.vim
" Description: a ctrlp.vim extension provides jumping to function
" Author: Takahiro YOSHIHARA <tacahiroy```AT```gmail.com>
-if exists('g:loaded_ctrlp_funks') || v:version < 700 || &cp
+if exists('g:loaded_ctrlp_funky') || v:version < 700 || &cp
finish
endif
-let g:loaded_ctrlp_funks = 1
+let g:loaded_ctrlp_funky = 1
-let s:ctrlp_funks_all_buffers = get(g:, 'ctrlp_funks_all_buffers', 0)
-let s:ctrlp_funks_report_filter_error =
- \ get(g:, 'ctrlp_funks_report_filter_error', 0)
+let s:ctrlp_funky_all_buffers = get(g:, 'ctrlp_funky_all_buffers', 0)
+let s:ctrlp_funky_report_filter_error =
+ \ get(g:, 'ctrlp_funky_report_filter_error', 0)
" The main variable for this extension.
"
@@ -23,28 +23,28 @@ let s:ctrlp_funks_report_filter_error =
" | | `- match first tab delimited str
" | `- match full line like file/dir path
" `- match full line
-let s:funks_var = {
- \ 'init': 'ctrlp#funks#init(s:crbufnr)',
- \ 'accept': 'ctrlp#funks#accept',
- \ 'lname': 'Dory & Terry',
- \ 'sname': 'funks',
+let s:funky_var = {
+ \ 'init': 'ctrlp#funky#init(s:crbufnr)',
+ \ 'accept': 'ctrlp#funky#accept',
+ \ 'lname': 'Funky',
+ \ 'sname': 'funky',
\ 'type': 'line',
\ }
-" Append s:funks_var to g:ctrlp_ext_vars
+" Append s:funky_var to g:ctrlp_ext_vars
if exists('g:ctrlp_ext_vars')
- let g:ctrlp_ext_vars = add(g:ctrlp_ext_vars, s:funks_var)
+ let g:ctrlp_ext_vars = add(g:ctrlp_ext_vars, s:funky_var)
else
- let g:ctrlp_ext_vars = [s:funks_var]
+ let g:ctrlp_ext_vars = [s:funky_var]
endif
" Provide a list of strings to search in
"
" Return: a Vim's List
-function! ctrlp#funks#init(bufnr)
+function! ctrlp#funky#init(bufnr)
let bufs = []
- if s:ctrlp_funks_all_buffers
+ if s:ctrlp_funky_all_buffers
for bn in ctrlp#allbufs()
call add(bufs, bufnr(bn))
endfor
@@ -56,13 +56,13 @@ function! ctrlp#funks#init(bufnr)
for bufnr in bufs
let ft = getbufvar(bufnr, '&l:filetype')
if !s:has_filter(ft)
- if s:ctrlp_funks_report_filter_error
+ if s:ctrlp_funky_report_filter_error
echoerr ft.': filter does not exist'
endif
continue
endif
- let lines = ctrlp#funks#{ft}#filter(bufnr)
+ let lines = ctrlp#funky#{ft}#filter(bufnr)
for l in lines
call add(candidates, l)
endfor
@@ -72,7 +72,7 @@ function! ctrlp#funks#init(bufnr)
endfunction
function! s:has_filter(ft)
- let func = 'autoload/ctrlp/funks/'.a:ft.'.vim'
+ let func = 'autoload/ctrlp/funky/'.a:ft.'.vim'
return !empty(globpath(&runtimepath, func))
endfunction
@@ -83,7 +83,7 @@ endfunction
" a:mode the mode that has been chosen by pressing <cr> <c-v> <c-t> or <c-x>
" the values are 'e', 'v', 't' and 'h', respectively
" a:str the selected string
-function! ctrlp#funks#accept(mode, str)
+function! ctrlp#funky#accept(mode, str)
let [bufnr, lnum] = matchlist(a:str, '\m\C#.*:\(\d\+\):\(\d\+\)$')[1:2]
let fpath = fnamemodify(bufname(str2nr(bufnr, 10)), ':p')
call ctrlp#acceptfile(a:mode, fpath, lnum)
@@ -93,14 +93,14 @@ endfunction
" Give the extension an ID
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
" Allow it to be called later
-function! ctrlp#funks#id()
+function! ctrlp#funky#id()
return s:id
endfunction
" Create a command to directly call the new search type.
"
-" Put something like this in vimrc or plugin/funks.vim
-" com! CtrlPFunks cal ctrlp#init(ctrlp#funks#id())
+" Put something like this in vimrc or plugin/funky.vim
+" com! CtrlPFunky cal ctrlp#init(ctrlp#funky#id())
" vim:fen:fdl=0:ts=2:sw=2:sts=2
View
6 autoload/ctrlp/funks/ruby.vim → autoload/ctrlp/funky/ruby.vim
@@ -1,5 +1,5 @@
-" File: autoload/ctrlp/funks/ruby.vim
-" Description: a ctrlp.vim extension thenfunks's filter definition (ruby)
+" File: autoload/ctrlp/funky/ruby.vim
+" Description: a ctrlp.vim extension thenfunky's filter definition (ruby)
" Author: Takahiro YOSHIHARA <tacahiroy```AT```gmail.com>
" License: the MIT License
" Copyright 2012 Takahiro YOSHIHARA"{{{
@@ -22,7 +22,7 @@
" out of or in connection with the software or the use or other dealings in the
" software."}}}
-function! ctrlp#funks#ruby#filter(bufnr)
+function! ctrlp#funky#ruby#filter(bufnr)
let lines = getbufline(a:bufnr, 1, '$')
let filtered = []
let i = 1
View
6 autoload/ctrlp/funks/vim.vim → autoload/ctrlp/funky/vim.vim
@@ -1,5 +1,5 @@
-" File: autoload/ctrlp/funks/vim.vim
-" Description: a ctrlp.vim extension thenfunks's filter definition (vim)
+" File: autoload/ctrlp/funky/vim.vim
+" Description: a ctrlp.vim extension thenfunky's filter definition (vim)
" Author: Takahiro YOSHIHARA <tacahiroy```AT```gmail.com>
" License: the MIT License
" Copyright 2012 Takahiro YOSHIHARA"{{{
@@ -22,7 +22,7 @@
" out of or in connection with the software or the use or other dealings in the
" software."}}}
-function! ctrlp#funks#vim#filter(bufnr)
+function! ctrlp#funky#vim#filter(bufnr)
let lines = getbufline(a:bufnr, 1, '$')
let filtered = []
let i = 1
Please sign in to comment.
Something went wrong with that request. Please try again.