micro-editor / micro-editor/micro
[feature request] ranger plugin
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 29.6k
- Forks
- 1.4k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 10
Description
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:
- single column
- file previews disabled
- etc
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:
- update the ranger file open routine to just print to STDOUT the selected file(s)/dir(s)
- a Lua or Go function listening to STDOUT of ranger process:
- on receiving STDOUT from ranger, do something with it:
- if file not yet opened in micro, open file in tab
- if file already open in micro, go to tab
- if dir, do nothing
- on receiving STDOUT from ranger, do something with it:
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...
-
In menu, if the user presses ESCAPE, the "Preview" tab disappears, main window returns to the previously viewed tab.
-
In menu, if they open a file, the Preview tab becomes the new file, or they are returned to the tab of an already opened file.
-
From menu, if the user enters the main micro editor without "opening" a file when the preview tab is showing (they mouse-click in main window, or use Ctrl-W, for example), the previewed file is opened properly (rename tab title from "Preview" to filename).
This would closely emulate Sublimes "click once to show preview of file" feature.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing filemanager plugin and how plugins launch splits and interact with micro. Define a smaller initial scope around launching ranger and handling selected files; done should specify whether files open in new or existing tabs, while previews and custom ranger configuration remain separate decisions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, lua
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100