close
Skip to content

Initialize callback for custom ignore func#58

Closed
ludovicchabant wants to merge 3 commits into
ctrlpvim:masterfrom
ludovicchabant:custom_ignore_func
Closed

Initialize callback for custom ignore func#58
ludovicchabant wants to merge 3 commits into
ctrlpvim:masterfrom
ludovicchabant:custom_ignore_func

Conversation

@ludovicchabant
Copy link
Copy Markdown
Member

This adds an "init" callback for custom ignore functions. This callback will be called once as CtrlP is about to show the list of all possible filenames, and that's where you can do something expensive, like loading a custom list of patterns to filter against.

That's what I do in my "autoignore" extension over here. In the init function I read a .ctrlpignore file at the root of the project, which contains the patterns to ignore.

This is a lot more efficient than figuring ways to do it only on the first file or something.

@ludovicchabant
Copy link
Copy Markdown
Member Author

Mmmh I'm not sure why the 2nd commit is included here (I'm a Git n00b)... but at least only the one modified file is taken into account.
Ah! Tried rebasing stuff, seems to have worked.

@ludovicchabant ludovicchabant changed the title Custom ignore func Initialize callback for custom ignore func Nov 21, 2014
emilyst and others added 2 commits January 24, 2015 14:39
Buffer tags supported includes traits, methods, types, classes, objects, packages. In order to use this with Exuberant Ctags, the following needs to be added to ~/.ctags:

--langdef=Scala
--langmap=Scala:.scala
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private|protected)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\4/c,classes/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private|protected)?[ \t]*object[ \t]+([a-zA-Z0-9_]+)/\4/c,objects/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private|protected)?[ \t]*case class[ \t]+([a-zA-Z0-9_]+)/\4/c,case classes/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private|protected)?[ \t]*case object[ \t]+([a-zA-Z0-9_]+)/\4/c,case objects/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private|protected)?[ \t]*trait[ \t]+([a-zA-Z0-9_]+)/\4/t,traits/
--regex-scala=/^[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*def[ \t]+([a-zA-Z0-9_]+)/\3/m,methods/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*val[ \t]+([a-zA-Z0-9_]+)/\3/l,constants/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*var[ \t]+([a-zA-Z0-9_]+)/\3/l,variables/
--regex-scala=/^[ \t]*package[ \t]+([a-zA-Z0-9_.]+)/\1/p,packages/
I really wanted this and was just about to write a CtrlPWorkDirMRU  plugin before I stumbled upon the undocumented bang switch of CtrlPBookmarkDirAdd!
@ludovicchabant ludovicchabant deleted the custom_ignore_func branch January 24, 2015 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants