Fork me on GitHub
#emacs
<
2018-08-30
>
andy.fingerhut03:08:01

I was hoping to find some way in Emacs to do a multi-file search over most, but not all, files in a "project", e.g. all files in a particular directory and its subdirectories, but with customizations I can make to the set of files, based on name patterns, suffixes, directories, etc.

andy.fingerhut03:08:39

e.g. Never search files ending in .txt or .docx for project A, but in project B, some other variant of that custom to project B.

andy.fingerhut03:08:00

I found and tried projectile, but haven't figured out how to get it to do that yet (if it can).

dpsutton03:08:14

the customizations you can make to the set of files. dynamically or in dir-locals?

dpsutton03:08:08

also this. i haven't tried it yet but looks good: https://github.com/Wilfred/deadgrep

andy.fingerhut03:08:10

At least for now, I think the set of files I want to include/exclude will be relatively slowly changing, so I don't mind editing some kind of project-specific config file to change them.

andy.fingerhut20:08:21

I have since tried installing the_silver_searcher (easy on both macOS via MacPorts, and Ubuntu via apt) then Emacs helm-ag package. the_silver_searcher / ag command by default pays attention to .gitignore and a few other similar files for other version control software besides git, and also its own per-directory .ignore files and user-wide $HOME/.agignore That is customizable enough for me.

andy.fingerhut03:08:24

thx for suggestions. Will check them out.

👍 4
tanzoniteblack14:08:31

@andy.fingerhut are you using projectile (https://projectile.readthedocs.io/en/latest/)? If so, you can in each project edit your .projectile to ignore specific files, or based off globs. And then projectile-grep (or projectile-ag) Example of a .projectile (which is put at the root folder of each of your projects):

-*.txt
-*.html

tanzoniteblack14:08:45

ah, I see now above you have tried projectile, but couldn't find the project config.

andy.fingerhut16:08:47

Thanks. Yeah, I saw some docs about creating a .projectile file, and I have added some lines to it like -*.txt but those files are still searched when I do projectile-grep

tanzoniteblack18:08:46

I think you might need -/*.txt

tanzoniteblack18:08:16

.projectile is a poorly documented feature...I keep meaning to send a PR for that, but hasn't happened yet

lukas.rychtecky14:08:20

Hi Emacs lovers, how do you live without Parinfer? I’ve been using VIm for several years right now. I’ve tried to switch to Spacemacs. So how do you format you brackets? Via SPC k?

pauld14:08:34

Yeah, I just got used to using the SPC k commands. Once you learn them, it works well. There were some things I missed from paredit but I forgot what after being with spacemacs for so long. Never used Parinfer.

pauld15:08:24

the brackets are a bit annoying, I don't know of any commands to switch them from () to {} for instance, but I haven't really looked.

pauld15:08:03

I usually jut put the opening bracket then slurp the code in - that works with {} brackets as well

pauld15:08:46

there is a #spacemacs channel

👍 4
dpsutton15:08:56

if you are using cider you have clojure-mode and you can use C-c C-r [ or { or ( to change the delimiters

👍 4
😍 4
dpsutton15:08:16

there are some really nice refactors in clojure mode that are pure textual. sexps for the win

dpsutton15:08:12

on a new file it can create the ns form for you, change threading forms, lots of good stuff

pauld15:08:26

do you know the name of the function for C-c C-r?

dpsutton15:08:50

clojure-convert-collection-to-*

pauld15:08:55

clojure-refactor-map?

dpsutton15:08:01

yes you will find it in there

pauld15:08:52

ah nice! , r c in spacemacs

🎉 4
lilactown15:08:04

I was searching for the same 😄

pauld15:08:27

I often want to use SPC k w to wrap something but don't want the default ().

pauld15:08:04

Funny I haven't explored all these clojure-mode bindings

pauld15:08:00

Wow, so much to explore under clj-refactor (, r menu in Spacemacs)!

pauld15:08:35

What is this amazing magic? If you are in spacemacs try

, r ?

pauld15:08:24

It give documentation on the clojure refactor commands along with gif animations showing usage

pauld15:08:51

use Q instead of q to close the doc window

mhcat15:08:25

This is kind of vague, but maybe someone has ideas: I've been noticing a lot of flicker in my emacs, mostly in the context of clojure buffers, which seems to be caused by eldoc-mode (that is, it stops when I turn off eldoc-mode). I feel like I've dealt with this before, but my memory is almost 50 and I'm terrible at making notes. Anyone recognize this symptom?

mhcat15:08:36

(The flickering, not the memory loss)

pauld18:08:57

ah nice elisp!

bja18:08:27

I don't remember why I didn't use a loop for that duplicated code. Something in there might be a macro and I didn't want to propagate macros, but that's a guess.