fman-users / fman

Issue tracker for fman, a cross-platform file manager
https://fman.io
240 stars 3 forks source link

Provide an internal viewer #417

Open tmssngr opened 6 years ago

tmssngr commented 6 years ago

At least for text files (support encoding selection and detect common encodings like UTF-8/16 with BOM, UTF-8 without BOM) and hex display, including search.

mherrmann commented 6 years ago

Quoting my comment on this in #385:

I agree at the moment fman is too minimalistic. But the Text Preview you mention in particular is something I'm very much against. It's a complex feature to implement. It will be impossible to make as good as dedicated Preview apps that already exist on the market. Also, where does it stop? Text preview first. But then images, video, ... sound? I think fman should integrate with existing solutions, not reinvent the wheel. The reasoning is the same as for a terminal embedded in fman (#39).

tmssngr commented 6 years ago

As a developer I only need a quick text viewer - basically, I'm searching a viable replacement for Altap Salamander.

mherrmann commented 6 years ago

Sublime Text is a quick text viewer :)

oskretc commented 6 years ago

I Use MS QuickLook bind to F3 and works great for me.

The only thing missing is the auto refresh when you select another file as in win explorer. @mherrmann any ideas how to implement that? e.g. In Win Explorer, click on a file, press space bar, Quick look opens but focus remains at WinExplorer , when you click another file Quick look will display it.

https://www.microsoft.com/en-us/p/quicklook/9nv4bs3l1h4s

mherrmann commented 6 years ago

I'm sorry I don't have an idea off the top of my head. It will depend on how scriptable Quick look is.

tmssngr commented 6 years ago

I use the viewer most often in combination with a file search by content. Alt+F7 to search, F3 in the search results (of course jumps to the found text), maybe further F3s in the viewer to find further matches, if irrelevant, ESC, cursor down to select the next found file, F3 to show the file, ESC, cursor down, F3 - ah, found, ESC, Enter to reveal the found file in the normal directory view.

A viewer should be light-weight and quick while invoking an editor can take more time to launch. Fman is about speed, so there should be a fast way to take a look into (text) files.

o314 commented 6 years ago

Very, very good reference here http://jupyterlab.readthedocs.io/en/stable/user/file_formats.html https://github.com/jupyterlab/jupyterlab/tree/master/packages

It is the new version of ipython / jupyter / jupyterlab. Open sourced and bsd licensed. Currently between beta 2 and beta 3

Will needs some work too, but can be a very good catch on the long term roadmap

Sorry if all my post seems to add some do this, do that mentions Michael. Very good work by the way. I am regular user of totalcommander. minimalism is a keypoint. But it lacks 2 or 3 things to make me switch for now: tabs, viewer, search

Open architecture is a good point. it will be pleasant to contribute some days

mherrmann commented 6 years ago

Sorry if all my post seems to add some do this, do that mentions Michael. Very good work by the way.

No problem. Thanks :-)

But it lacks 2 or 3 things to make me switch for now: tabs, viewer, search

Search will certainly come. Viewer is this present issue. As I wrote I'm opposed to it, but if it gets enough (=many) votes, I'll take a look. Regarding tabs: Can't you just use Ctrl+P to switch to another directory, then go back with Alt+Left? Lets you switch between directories as quickly as Tabs, but takes up less screen space. I mentioned this in the issue for tabs (#34) as well.

o314 commented 6 years ago

--moved to #34--

tmssngr commented 6 years ago

Are you sure to comment at the right issue? This is about an internal viewer, not about shortcuts or tabs.

o314 commented 6 years ago

i have hesitated to indicate it in my last post. feel free to move/copy my post if needed.

mherrmann commented 6 years ago

@o314 it's clearest if you delete your comment here and paste it in #34 instead. Thanks.

gingerbeardman commented 6 years ago

macOS: launching qlmanage is an inelegant way to do this, at least for me that new window does not have focus and I then need to cmd+tab to it. Plus, not all plain text types are known by Quick Look.

I'd expect a native window or panel? Would only need to support plain text or hex.

mherrmann commented 6 years ago

I agree that the qlmanage isn't ideal. It does have focus for me but the [DEBUG] in the window title is ugly. (I looked into changing it, but could not find a solution.) Regarding not all plain text types being supported by QL, I would argue that's a "problem of QL"; I think QL supports plugins and I would assume they can be used to get this to work. But as I said, I agree that the qlmanage solution is not ideal.

Would only need to support plain text or hex.

That's where it starts, yes ;-)

mherrmann commented 6 years ago

PS: For plain text and Hex, can't you just use Sublime (F4)?

gingerbeardman commented 6 years ago

Kind of. But it doesn't auto update and ideally it would only be a small panel so I can verify contents. See https://github.com/fman-users/fman/issues/417#issuecomment-394974074

Also once I'm in Sublime I'll end up trying to manage my files there.

gingerbeardman commented 6 years ago

NimbleCommander (repo) takes an interesting approach.

It has a toggle-able command Preview (Cmd+Y) which turns the opposite panel into the viewer. (it also has the option for a floating panel).

both are powered by Quick Look.

screen shot 2018-07-25 at 20 03 58

gingerbeardman commented 6 years ago

Just coming back to this, my point is: I agree the wheel shouldn't be reinvented. But opening an external app is not good enough, it needs to be integrated.

Maybe there is already a python library that is suitable and focused?

In macOS Terminal I could issue file --mime _filename_ - the results would begin with text/ for anything that could be displayed easily with cat _filename_ - for everything else (binary files) hexdump _filename_ would be able to cope

mherrmann commented 6 years ago

Maybe there is already a python library that is suitable and focused?

I admit I have not checked, but I highly doubt that there is a single Python library that does this and works across platforms.

My main gripe is with reinventing the wheel (cf. my comment at the top of this thread). I don't have the resources to implement a full-blown Preview. People say it can be simple and it only needs to support text. But I know that once I start down that route, other people will come along and say "it already does text, can't it do images as well?"

I am more open to integrating an existing solution into fman that takes care of the Preview-related logic. Including Quick Look inside fman similarly to Nimble Commander sounds like a good solution for this (if it is technically possible). Of course, that would only work for Mac.

tmssngr commented 6 years ago

People say it can be simple and it only needs to support text. But I know that once I start down that route, other people will come along and say "it already does text, can't it do images as well?"

And because of that you don't want to do it at all? Why you started fman? Because people will come along and say "it needs this and that feature, too".

mherrmann commented 6 years ago

I would rather direct everybody's efforts towards finding a solution that does not require reinventing the wheel. By saying "stop" from the very beginning, I am steering the discussion towards a solution that can do everything that's required, not a half-assed mixture of things. The integrated Quick Look mentioned above would be along those lines.

mherrmann commented 6 years ago

Also, it's not like I'm being lazy and will spend the time I don't spend implementing this feature on holidays. It's a question of prioritization. My belief is that my time is better spent on the many other fman features that are still open, than to implement a Preview functionality that will not work for most files, will not be pretty, or fast, etc.

Chaiavi commented 5 years ago

@mherrmann I really miss an integrated f3 (view) and f4 (edit)

But I totally see your point and as a developer myself I can see that it will take much more time than many other issues you can fix.

Till you have the time for it, can you implement something which will recognize files by their extension and then start a python (3rd party?) viewer / editor ? - something which will be also python and will work lightning fast ?

Does my above question make sense ?

mherrmann commented 5 years ago

@Chaiavi can the Preview plugin help you get the F3 functionality? And regarding F4, the first time you press it, fman asks you to select an editor. If you pick a fast editor such as Sublime Text, then you will have very quick editing functionality.

Chaiavi commented 5 years ago

@mherrmann

Thanks a lot.

I installed the preview plugin, then installed the quickView application someone here suggested and it is all I desired!

Also the f4 function is ok with me.

I am totally against reinventing the wheel when you have application which are fully dedicated to doing a specific feature - you can't compete with them...

IMHO the preview plugin should be incorporated into core and a suggestion in the site somewhere to install quick view will also help your users.

Anyway, thank you for the help, my case is settled using your recommendations.

mherrmann commented 5 years ago

@Chaiavi glad to hear you got it to work in a satisfactory manner. I'll consider your suggestions; Thanks.

Raikiri commented 5 years ago

I agree it's not worth the development time at this point to make an integrated viewer. First, because making a viewer as fast as lister (in total commander) is pretty hard due to complex buffering-while-scrolling hoop-jumps involved. Secondly, at least for now this can be perfectly replaced with a 3rd party viewer.