Replies: 3 comments 1 reply
-
|
+1 My ideal for this feature would be that it allows you to edit (with a visible warning), but doesn't complain about the unsaved buffer. This would allow both saving (when desired) and minimal friction when using as a pager. edit: So I guess "read-only buffer" is a misnomer. Ephemeral buffer? Volatile buffer? Transient buffer? |
Beta Was this translation helpful? Give feedback.
-
|
I would also happily use helix in read-only mode as a pager. Its navigation commands would be great for this use-case. |
Beta Was this translation helpful? Give feedback.
-
|
I think vi and vim get the terminology wrong here. Using You can do all the editing you like, but when you go to close the buffer, you have to use either I feel like this would be trivial to implement in helix, given it already recognizes write-protected files when you open them. It would just be a per-buffer toggle.
That said, settings tend to be session-wide rather than buffer-specific, so maybe:
Regardless, I would love to see this as a drop-in replacement for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In #7128 the idea was brought up to have a read-only mode similar to vim. @the-mikedavis also mentioned Kakoune as an example that refuses to enter Insert mode, compared to vim that simply warns you you're trying to edit a read-only buffer. I can't find an existing discussion for this, so I wanted to start one here because I like to use vim often as a better pager e.g.,
curl https://domain.tld/json | jq | vim -R -.Personally, I like vim's behavior that is warns I'm editing a read-only buffer and then let whether there's even a file path attached to the buffer or the file is protected decide whether I can save it. This lends itself well to other use e.g., certain user-writable buffers like help content could automatically be marked read-only but we could forcibly overwrite them if we have suitable permissions. I.e., don't make helix the gatekeeper for whether we can do something - only let us know it may not work.
Beta Was this translation helpful? Give feedback.
All reactions