micro-editor / micro-editor/micro
[RFE] Setting a file name for buffer that is read from stdin
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 29.6k
- Forks
- 1.4k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 10
Description
(I've asked this is the gitter chat already, but got no answer so far, hence creating this issue to gain some attention)
Is it possible to set a file name in the command line if the buffer is read from stdin? Consider I'm doing this:
$ git show v5.10:fs/eventpoll.c | micro -filetype c -readonly on +100
It works fine, but the file name is shown as "No name" which is not very convenient.
What I want probably is something like this:
$ git show v5.10:fs/eventpoll.c | micro -filename 'fs/eventpoll.c' -readonly on +100
or similar. If this feature already exists (but I couldn't find it in this case), please let me know how to do it, otherwise consider this to be an RFE.
Similar feature that works in neovim is achieved like this:
$ git show v5.10:fs/eventpoll.c | nvim -R -c "file fs/eventpoll.c" -c "set ft=c" +100
Thanks!
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 tracing micro's command-line argument parsing and the path that creates a buffer from stdin. Check how the existing -filetype and -readonly options are handled; done means a stdin buffer can receive a user-provided filename while preserving the existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100