Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peep-mode #46

Closed
mijoharas opened this issue Aug 27, 2014 · 7 comments
Closed

Peep-mode #46

mijoharas opened this issue Aug 27, 2014 · 7 comments

Comments

@mijoharas
Copy link

I would like to suggest a "Peep-mode" or some such thing similar to Sublime Text where you can get an instant preview of the file just by scrolling. See peep-dired for one such implementation. (N.B. for peep-dired the temporary buffers continue to hang around rather than being ephemeral like in Sublime Text.)

@jaypei
Copy link
Owner

jaypei commented Aug 28, 2014

Quick preview is cool. Is the peep-dired way can integrate into NeoTree?
I have no idea how to design it, can you give more tips?

@mijoharas
Copy link
Author

I'll have a look into it when I get a bit of time, I guess the first thing we need to decide is what we would want for the user interface (how it would work). Personally I like the sublime text UI (every file that you hover over is previewed in another buffer and is then closed unless you edit it) but it seems that the peep-dired people had some problems implementing that . Is that how you would imagine it working?

I suppose if we did go down that route we'd need to figure out how to close the buffers unless they are edited, looking here it seems that we can provide a query for whether the buffer is edited to the kill-buffer function so we only kill unedited ones. We could then have a variable containing the current previewed buffer and simply clear it upon every movement command in neotree.

Thinking about the problems that they have in the other issue it might make sense to defer our killing of the buffer so that it happens asynchronously but we'd have to check if that fixes the problem. (see here for a library that might help with that).

Let me know your thoughts.

@jaypei
Copy link
Owner

jaypei commented Aug 29, 2014

I was tried the "sublime text", it is really practical.
As you say, use a variable, point to the last preview buffer, I think it is a good idea.

We can design it like this

  1. Define a function neotree-preview and a variable neo-preview-last-buffer;
  2. When we invoked the neotree-preview, first, check the neo-preview-last-buffer, if it is available and not edited, then kill it. Second, open the file to a new buffer(use the same window) and set neo-preview-last-buffer.
  3. Define a option neo-open-file-mode, it may be neo-ofm-preview or neo-ofm-new-buffer. It determines the default behaviour of neotree-enter.

I don't know if I express myself clearly. if so, do you think it is reasonable?

@mijoharas
Copy link
Author

Sorry, only just saw this. Yeah, that seems like a good way to go about it. I'm going to be away from a computer for a couple of weeks but will have a look into this when I get back.

@arronmabrey
Copy link

Hey guys, has any progress been made in this area? I was just looking for something like this to use inside spacemacs. I have yet to do any elisp development, but I have worked with clojure lisp, I'd be happy to help just not too sure where to start.

@mijoharas
Copy link
Author

Hey, essentially, I have done absolutely nothing about this. In spacemacs you can use helm-find-files (SPC f f) and then when you hit tab it'll preview the result, which is what I've been using.

Bringing this feature to neotree is something that would be nice, I'm not sure if I've got the time though. @jaypei's suggestion sounds like a nice way to go about it in practice.

If I have the time to hack around on this I'll post here, otherwise, I'm afraid don't expect much. Happy to help if needed though.

@mijoharas
Copy link
Author

mijoharas commented Sep 4, 2017

Also, @arronmabrey as I'm looking at this, I see a quick-look functionality. If you hit ' (apostrophe) in spacemacs it will preview the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants