Coder Social home page Coder Social logo

tacahiroy / ctrlp-funky Goto Github PK

View Code? Open in Web Editor NEW
395.0 395.0 71.0 598 KB

A super simple function navigator for ctrlp.vim

Home Page: http://www.vim.org/scripts/script.php?script_id=4592

License: MIT License

Vim Script 100.00%
ctrlp function navigator search vim

ctrlp-funky's Introduction

dotfiles

Bash, Vim, tmux, etc. for GNU/Linux and WSL.

Installation

./install.sh

ctrlp-funky's People

Contributors

ajmorada avatar cenksoykan avatar curist avatar djcas9 avatar dusans avatar gavocanov avatar hfm avatar hlissner avatar jagtesh avatar jean avatar kirstein avatar komnomnomnom avatar lorenzo avatar metainfa avatar minhajuddin avatar mudox avatar nkakouros avatar phongnh avatar prabirshrestha avatar rendon avatar robmiller avatar senft avatar siadat avatar somini avatar svenwin avatar tacahiroy avatar timfeirg avatar tokorom avatar vitalk avatar zaynetro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ctrlp-funky's Issues

Breaking since last update

Afternoon. Since I updated to the version 3 days ago I'm getting this error:

Error detected while processing function ctrlp#funky#funky..ctrlp#init..ctrlp#setlines..ctrlp#funky#init..ctrlp#funky#candidates..ctrlp#funky#extract:
line   67:
E117: Unknown function: uniq
E15: Invalid expression: uniq(prior + sorted)
Press ENTER or type command to continue

Unable to find a function

I have a function called "CheckTransaction" in my C++ code and this plugin never shows that in the CtrlP window. It is able to detect all other functions flawlessly except this one.

Thanks for a wonderful plugin :)

cache

Would it be possible to implement a cache for ctrlp-funky?

If the file didn't change since the last usage of ctrlp-funky there is no need to run the search again :)

This is noticeable when using ctrlp-funky on larger source files ( > 1000 lines) (python in my case)

Can't jump to tag

commit 01f5824 broke it.
for filters using multiple conditions, like java and javascript

let s:filter = [{ 'pattern': regex,
                \ 'filter': ['\v(^\s*)|(\s*\{.*)', '', 'g']}
\ ]

error message

Error detected while processing function <SNR>161_AcceptSelection..ctrlp#funky#accept:
line    1:
E688: More targets than List items
line    2:
E121: Undefined variable: bufnr
E116: Invalid arguments for function str2nr(bufnr, 10))
E116: Invalid arguments for function bufname(str2nr(bufnr, 10))
E15: Invalid expression: bufname(str2nr(bufnr, 10))
line    5:
E121: Undefined variable: bufnr
E116: Invalid arguments for function str2nr(bufnr, 10))
E116: Invalid arguments for function s:filetypes(str2nr(bufnr, 10))
E15: Invalid expression: s:filetypes(str2nr(bufnr, 10))
line   13:
E121: Undefined variable: bufname
E116: Invalid arguments for function empty(bufname)
E15: Invalid expression: line_mode || empty(bufname)

function sorting (on most used)

I noticed that ctrlp sorts my files also on the ones that i previously selected. Currently the sorting in funky is standard sort?

Could we also get same feature where the sort would depend on how many times we jumped to that function.

c language function list is not correct

i like your plugin , but
i found this plug in for c language could not ignore comments ,
like
/****
ABC MMM
****/
it will show comment as a function ,
could it ignore comments of c language ?

Thanks a lot !

multiline python functions not working

The python regex doesn't work on python functions that spawn on multiple lines.

example:

def assign_foo(to_long_name_for_var1, to_long_name_for_var2,
to_long_name_for_var2):

:CtrlPFunky always selects changes top split

Steps to reproduce:

  1. open a file in vim
  2. :sp to do a horizontal split
  3. ctrl-w j to move to bottom split
  4. :CtrlPFunky and select a function

Expected: CtrlPFunky to show the function in the bottom split
What actually happens: CtrlPFunky shows the function in the top split

Is this expected behavior? It throws me off when it happens. Also a similar issue happens for vertical splits.

Search entire project directory

I frequently run vim from the root of a project and use CtrlP to navigate to files anywhere else in the project. It would be cool if there were a feature for funky that, when searching for an existing function definition, could also search the other files in the project directory. This would be very useful for immediately jumping to a function definition in another file in a project.

This would be another case where caching, as mentioned in #27, would come in quite handy. Create a cache of a directory/subdirectories, and simply maintain it for updated/new files.

Issue with vim-pasta

Here's what happens:

  1. Installed plugins: ctrlp, ctrl-funky, vim-pasta

  2. Open vim

  3. Use ctrlp to search for something with the letter "p" in it. Everything is good.

  4. Use ctrlp-funky to search for something with the letter "p" in it. The following error occurs:

Error detected while processing function <SNR>38_NormalPasta:
line    2:
E21: Cannot make changes, 'modifiable' is off
Press ENTER or type command to continue
  1. Repeat step 2 - suddenly we get the same error as step 3

Support for Perl Moose and Method::Signatures

Both of these are modern Perl things, eg.

method _format_response($response) {

enum 'Foo::Types' , [qw(
    CH CN CU CY
)];

subtype FooType,
    as Str,
    where {
        my $type = $_;
        grep {/^$type$/} qw( organic mechanical alien )
    },
    message { "[$_] is not a valid Foo type" };

coerce FooFields,
    from Undef,
    via { [] };

would you please add the navigation of the method usages?

I appreciate your script allows the jump to the methods definition. However, I feel it would be equally useful to allow the users to see the positions where the current method is called and make a jump. Just like the way cscope does. Would you add this feature?

Does ctrlp-funky support YAML-front-formatter ?

Hi,

I have this markdown file which contain YAML-front-formatter (http://jekyllrb.com/docs/frontmatter/) and I've written them like this:

---
title: title
date: 2014-05-28

---

# Hello
This is my blog!

When I call CtrlPFunky, the following error appears:

:CtrlPFunky
Error detected while processing function ctrlp#funky#funky..ctrlp#init..ctrlp#setline
s..ctrlp#funky#init..ctrlp#funky#extract:
line   23:
E688: More targets than List items        

add support for GNU makefile

hi

could you add support for GNU makefile ?

makefile doesn't have function definition ,
but it has lots of targets definition ,
could it be showed in ctrlp-funcky ?
it will be very useful .

Thanks

text coloring while searching

One difference i noticed between normal ctrlp and funky is that ctrlp does some text coloring while typing. This way u can see the matches it finds using fuzzy logic.

example: example

In the example u can see that "mo" has different colors.

Would this also be possible in funky?

Duplicate tag

It causes an error when generating help tags:
E154: Duplicate tag "timfeirg" in file /home/siegel/.vim/bundle/ctrlp-funky/doc/ctrlp-funky.txt

See line comment at line 415 of doc/ctrlp-funky.txt in 567811a

CSS support

SublimeText's fuzzy function definition matching would match selectors in CSS files.

Can similar functionality be added here?

c-v c-x to open the new window for a function

when i use ctrlp-funky to select a function,
then i use c-v / c-x to open it ,
it will use the exist window,
i want to open a new vertical or horizontal window,
the is not the same behavior as ctrlp behavior .

Error when selecting functions in split

When running ctrlp-funky with a split (vertical or horizontal) it's not possible to use ctrlp-funky to select functions in one of the splits. Have tested with C, Python and JavaScript code and all have the same issue.

Steps to reproduce

  1. Start vim and open a file
  2. Split the window (:sp or :vsp)
  3. Open another file in one of the viewports
  4. Use ctrlp-funky to go to a function (works in one viewport, fails in the other)

Example error

Error detected while processing function <SNR>33_AcceptSelection..ctrlp#funky#accept:
line 7:
E474: Invalid argument

.vimrc

set nocompatible
set background=dark
set nomodeline

filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()
call vundle#begin()
Plugin 'gmarik/Vundle.vim'

Bundle 'ctrlpvim/ctrlp.vim'
Bundle 'tacahiroy/ctrlp-funky'
call vundle#end()
filetype plugin indent on

let g:ctrlp_extensions = ['funky']

vim --version

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 19 2014 18:48:03)
Included patches: 1-410
Compiled by Arch Linux
Huge version with GTK2 GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
+balloon_eval    +float           +mouse_urxvt     -tag_any_white
+browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
+clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      +toolbar
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con_gui  +lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      +X11
+dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     +xim
+emacs_tags      +mouseshape      -sniff           +xsmp_interact
+eval            +mouse_dec       +startuptime     +xterm_clipboard
+ex_extra        +mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz  -D_FORTIFY_SOURCE=2  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE  -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype  -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE  -lm -lncurses -lelf -lnsl   -lacl -lattr -lgpm -ldl  -L/usr/lib -llua -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -L/usr/local/lib  -L/usr/lib/perl5/core_perl/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic   -lruby -lpthread -lgmp -ldl -lcrypt -lm  -L/usr/lib

No syntax highlighting on function list

I am using Vim/Cttrlp-funky on Ubuntu. Currently there is no syntax highlighting on function list as shown below. I noticed online that on Mac there is functions/methods highlighted. How to fix that ?

screenshot from 2014-01-25 14 12 21

An option to set the match window height

Hi, thanks for the great plugin!

Just a suggestion, it would be nice to be able to adjust the maximum number of matches displayed (currently it's set to 10). Ctrlp provides an option called ctrlp_max_height, however it doesn't affect the size of the ctrlp-funky output. Is it possible to currently change it somehow? Thanks!

error message thrown for ilist

Error detected while processing function ctrlp#funky#funky..ctrlp#init..ctrlp#setlines..ctrlp#funky#init..ctrlp#funky#extract:
line 39:
E121: Undefined variable: ilist

funky show error

I enable the ale check when start vim, but if open ctrlp-funky to find python function, the quickfix show the flake8 error, I don't want check them.
I try to disable ale when bufenter, and enable ale when bufleave
but i found BufLeave is be ignore in the source code.

image
Thank you.

can't select functions other the last one in ctrlp-window

hi

my vim version is 7.4
i find i can't select other functions in ctrlp window,
except the last function,
that is the select line will jump to the bottom line automatically,
i can't select other functions,
other ctrlp-plug in can work , but ctrlp-funky can't
my ctrlp version is the latest .

please have a look .

Thanks

Error E688 with the function <SNR>239_ToggleType…

Hello,

This error is often displayed when I open the Funky tab with CtrlP:

Erreur détectée en traitant function <SNR>239_ToggleType..ctrlp#setlines..ctrlp#funky#init..ctrlp#funky#extract:
ligne 26:
E688: Plus de destinations que d'éléments dans la Liste

It does not occur all the time, but I cannot figure out when. For instance, I got the error with PHP, Javascript, CoffeeScript and HTML files.

N.B. I use the spf13 vim distribution.

Weird behaviour after upgrade

Ever since I upgraded the other day I get two listings in the CtrlP window for each function and it's also finding function calls rather than function declarations (in JS).

Is there some new config I need or anything like that?

Thanks for the great plugin, makes my day bearable.

function show less than the file defined

hi

i have a java file ,
it show only 2 functions in ctrlp-funcky ,
but the file defined 4 functions ,
it can show by tagbar plugin .

please have a look .

Thanks

Undefined variable s:saved_cpo

Screen Shot 2013-02-25 at 9 01 08 AM

This one is quite strange. The error only occurs one time during the vim session and when running a CtrlP command like this :CtrlP app/controllers.

I won't see this error if I ran another CtrlP-command first or only provide one folder like :CtrlP app

I think it was introduced quite recently. Either in the commits from February or some of the late commits in January. Never experienced this issue about a month ago. And it is quite a common operation for me.

sort by MRU breaks navigation

I'm using 8e28397, if I do this:

let g:ctrlp_funky_sort_by_mru = 1

I'll get this error when I try to navigate to function:

Error detected while processing function <SNR>114_AcceptSelection..ctrlp#funky#accept:
line   13:
E121: Undefined variable: bufnr
E116: Invalid arguments for function 238

looks like #8 is reappearing

don't highlight the match strings

it don't highlight the match strings in ctrlp-funky ,
looks at ctrlpMRU ,
it can highlight match strings,
more convenient to use .

Split windows

Im having this issue that when having the same buffer split the usage of ctrlp-funky works only on one of them.

So if i focus split A and find a function its jumps to it in A. But if i focus the split B (same buffer) it jumps to the function inside split A, B stayes the same.

What am i doing wrong?

Moving to method sometimes done in wrong split

I have build my workflow around using ctrlp and ctrlp funky. The way I use it is to use <Ctrl-p> to open ctrlp. And then <Ctrl-b> and <Ctrl-f> to move around the plugins. (I can't reproduce this when opening ctrlp funky directly).

When using ctrlp funky with this workflow together with 2 splits I often end up in a situation where the file opened (using enter) is opened in the wrong split (the left or the upper one while the intended one is the other), ending up with the same file opened in two splits.

The solution I've came up with involves changes to ctrlp (mattiaslundberg/ctrlp.vim@860c7d3) and ctrlp funky (mattiaslundberg@17d1b6a). I'm aware that this isn't a proper solution, but it seems to work for my case. The problem (atleast in my understanding) seems to be related to that ctrlp never calls the function function! ctrlp#funky#funky(word, ...) when using the workflow described.

I'm not sure if this is something that can be solved in ctrlp or in ctrlp funky or if I'm even close to understanding this. Any assistance in how to proceed to get this figured out would be appreciated.

Thanks for a great plugin!

ctrlp-funky can't scan function signatures with the keyword "static"

Hi,

I have this php file which contain helper functions and I've written them like this:

public static function addTwoNumbers($a, $b) 
{
    return $a + $b;
}

Now, when I try to search function names using ctrlp-funky, they don't come up. I tried to look at the documentation and look for some sort of configuration option but nothing close came up.

Enable line numbers in ctrlp-funky

This awesome plugin really helped me with learning new API-s.
It would be really great if you could add line numbers so we can see how much methods there is in class.
Thanks.

Hide matches address labels

It would be nice if there was an option to now show the match address in the list (after the pound sign). As far as I understand that part is also used to jump to source code when selected. Would a solution to this by just offsetting this label by 200 spaces to the right be acceptable? The other possibility would be to create a syntax style for the label and toggle between normal/hidden style for it. Which one do you think would be better?

Potential conflict with airblade/vim-gitgutter

Ctrlp-funky is a lifesaver! Great plugin really help with large code files. However, recently I installed vim-gitgutter and ctrlp-funky has stopped working. Irrespective of the file type Ctrlp-funky shows -- No Entries --

If i comment out the vim-gitgutter, ctrlp-funky works fine

javascript es6 problems

Sorry for only text description, because I never upload image successfully.

function getSquare(x1,x2,y1,y2) {
....
}
class MainStore {
constructor() {
...
};
setPlace() {
...
}

It seems in such a js module , the function names will duplicate twice.
if the file only has one grammar, with or without function, then the list will be fine.

And the function list has a limit amount, is it possible to show all functions?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.