zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.77k stars 1.16k forks source link

[feature request] ranger plugin #1397

Open sc0ttj opened 4 years ago

sc0ttj commented 4 years ago

A ranger plugin?

As the filemanager plugin doesn't want to open files in a new tab (only a new window split), how about a filemanager plugin which simply loads a split on the side, like the filemanager does, but runs a console that immediately runs ranger?

You can overwrite rangers default config options, and also tell it to ignore the global rc file when it loads, so the plugin would only need a custom ranger rc file included to have a nicely isolated env/config, tweaked it to the plugins/micros needs:

If some way of hijacking rangers file open method can be made to open a new micro tab for each file chosen, then that would be great!

A very simplistic one would be:

NOTE: updating "the ranger file open routine" probably means jus having a very simplified custom scope.sh or rifle.sh living inside the plugin, with the main ranger config, and for the config to be setup to use it.

Advanced idea:

Very fast file previews:

Every time a user highlights a file in ranger (but doesn't click on it), a tab titled "Preview" can be created, always as the last (or first?) tab, showing the highlighted file...

This would closely emulate Sublimes "click once to show preview of file" feature.

Tonus1 commented 4 years ago

I believe it could be a plug-in, since nnn does that as well and neither are default on every distribution...