Closed freckletonj closed 7 years ago
I can preview a file just fine in helm-projectile-find-file
with persistent action (C-j
). Are you saying you can't?
@xiongtx Sorry, I could have been more clear.
If I hit C-j
, it loads that file. But then it is loaded permanently into a buffer until I kill
it.
If I need to check through a dozen files, having a dozen new buffers after I find my one I wanted is rather noisy.
Is there a way, like in helm-ag
, or even vanilla helm
, where I can preview files in a temporary buffer that disappears after I'm done searching through them?
I think there's an argument to be made that the persistent (default) action of a *-find-file
command should be to actually find the file.
For something like helm-ag
, the intent is to search for something, and therefore the default action should be to preview, not find.
I agree that the default should be to find a file when you use *-find-file
. Maybe I still haven't been clear.
What I'm saying, and what I think would be great is, if helm-projectile
worked like helm
does, where you can preview a file you're trying to find, but then if you don't want that file you're previewing, it doesn't remain open in a buffer.
For example, if I run helm-find-files
, as I'm looking at a list of files, if I think one is the one I'm looking for, but i'm not sure, then I can hit C-z
on it and it will (persistent
ly) preview that file, but if I hit C-z
again, that preview buffer gets kill
ed.
In helm-ag
, it works similarly. If I see a file I'm interested in, I hit C-z
on it, and it opens in a temporary buffer. In order for this to work, I set:
(custom-set-variables
'(helm-ag-use-temp-buffer t))
I can't hit C-z
again to close it, like with helm-find-files
, but when I C-g
away, or <enter>
on a file I want, that temporary buffer disappears, as well as any clutter I accrued.
So, if I want to preview 10 files, but only keep one of them, I can do this with helm-find-files
, and helm-ag
.
I really like helm-projectile
, and the feature that would make it awesome would be if it could preview similarly to those examples, without cluttering my buffer list.
This feature doesn't need to be default, I would just like it if my buffer list stayed clean after previewing a few files with helm-projectile
.
I hope I'm making more sense now :)
That explains it, thanks.
I think it's a good idea, and the helm-ag--open-file-with-temp-buffer
function you linked to does what we want. I don't see the point of setting a variable to control this behavior (it's yet another knob to turn), so I've left that part out.
cc @bbatsov
I would love to be able to preview the file under point, like I can in helm, and other helm extensions. How do I accomplish this?
Helm-ag has a useful function: https://github.com/syohex/emacs-helm-ag/blob/master/helm-ag.el#L319
Any thoughts?