Fallback to create new file in file picker #16132
|
How feasible would it be to make the file picker be able to create new files as a fallback? I'm finding file creation really annoying in helix. |
Replies: 1 comment
|
The current file picker cannot use an unmatched query as a new filename. It enumerates existing regular files and then fuzzy-filters that list (source), so the query is not treated as a path. The built-in create-or-open workflow is: or the short form: If the path exists, Helix opens it. If it does not, Helix creates an empty buffer associated with that path (implementation). The file is not created on disk until For a completely unnamed buffer, use Adding file creation to the browsing UI is feasible, but it is not merged behavior today. PR #15204 proposes create/rename/delete actions in the file explorer, while the separate editable-directory proposal in PR #15220 was steered toward the future plugin system by a maintainer. So for now I would use |
The current file picker cannot use an unmatched query as a new filename. It enumerates existing regular files and then fuzzy-filters that list (source), so the query is not treated as a path.
The built-in create-or-open workflow is:
or the short form:
If the path exists, Helix opens it. If it does not, Helix creates an empty buffer associated with that path (implementation). The file is not created on disk until
:write, so a typo can still be abandoned safely.:openalso has filename completion.For a completely unnamed buffer, use
:new, edit it, then:write path/to/file.rs. If the parent directories do not exist,:write!creates the necessary di…