Fork me on GitHub

how do you all typically search for usage of a variable or any other text across all your project files? i used to just keep all my files in a flat directory so i could grep at the command line. as projects grow this is not practical, putting stuff into source directories makes more sense, but it breaks this habit


I use this to search for text in project. . it's very quick


I typically use the project search features of Projectile


It supports grep, ag and pt.


i was never able to really “get” into projectile for some reason


it seemed rather heavy but perhaps i will give it another try


Heavy it want sense? It just introduces a concept of a project defined by some project marker file and lots of operations you can do with that that project.


For me things like finding files in project, jumping between code and test and switching projects are invaluable.


so if my project is already in a git repo, projectile will just automatically search within just the fils of that repo with no other setup (other than installing projectile) >?


But, of course, I wrote this, so I guess I needed something like it.


Yes, exactly.


ok i’ll try it again


+1 for projectile, it's one of my favorite libraries


I'm using hydra, and I have an entire "hydra" dedicated to projectile related commands "browing project, finding files by name, grepping-aging through all in projectile, search/replace in project"


trying projectile, what is difference between C-c p f and C-c p g ? what does "at point" refer to when looking for a file?


what's a good way of asking "am I in clojure mode?" in elisp?


I searched for code that returns a list of major modes, but it seemed quite abysmal


i find it interesting that projectile-grep works even if projectile-mode is disabled


am finding it quite useful despite these curiousities


M-x describe-mode or something like that I guess


afaik you can be in only one major mode and many minor modes


> afaik you can be in only one major mode and many minor modes actually had forgotten about this 🙂 thanks for the hint


major-mode is what I was looking for


can anyone recommend a replacement for neo-tree? it's pretty good but a bit buggy, the "up a dir" feature doesn't work for me for some reason. I like having a tree of the project appear on the side with a keybinding


I use project-explorer with some additional setup and helper functions I'd say it basically works OOTB, but getting to a fully satisfactory state got me some pain (which I haven't extracted as a lib unfortunately)


@ajs I just use dired. It’s basic, but it gets the job done.


> i find it interesting that projectile-grep works even if projectile-mode is disabled


projectile-mode is just a container for the default keybindings, no Emacs command needs some mode to be enabled for it to be invoked.


> what’s a good way of asking “am I in clojure mode?” in elisp?


@vemv (derived-mode-p 'clojure-mode) is the best way to check.


Using major-mode and eq won’t work for derived modes, which generally are consistent with the parent mode.


> trying projectile, what is difference between C-c p f and C-c p g ? what does “at point” refer to when looking for a file?


@ajs It’s the text your cursor is on. Just standard Emacs terminology.


Thanks for the pointer! I was using a weaker check, something like (string-contains? (str major-mode) "clojure")


You’re welcome.


For the thing at point - the command has a better description that the manual.


If point is on a filename, Projectile first tries to search for that
file in project:

- If it finds just a file, it switches to that file instantly.  This works even
if the filename is incomplete, but there's only a single file in the current project
that matches the filename at point.  For example, if there's only a single file named
\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete),
`projectile-find-file-dwim' still switches to \"projectile/projectile.el\" immediately
 because this is the only filename that matches.

- If it finds a list of files, the list is displayed for selecting.  A list of
files is displayed when a filename appears more than one in the project or the
filename at point is a prefix of more than two files in a project.  For example,
if `projectile-find-file-dwim' is executed on a filepath like \"projectile/\", it lists
the content of that directory.  If it is executed on a partial filename like
 \"projectile/a\", a list of files with character 'a' in that directory is presented.


(that’s for C-c p g)


I try to use squiggly-clojure, it works for some errors (:def-in-def, ), but not work for :wrong-arity, something I missed?