Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Ability to create new files inside obsidian #7

Closed
elias-sundqvist opened this issue May 12, 2022 · 7 comments
Closed

Ability to create new files inside obsidian #7

elias-sundqvist opened this issue May 12, 2022 · 7 comments
Assignees
Labels
enhancement New feature or request WIP Currently working on this.

Comments

@elias-sundqvist
Copy link

elias-sundqvist commented May 12, 2022

Obsidian assumes that new notes are .md files.
It would be great to have a button in the obsidian file explorer/context menu to create new plaintext files.

@dbarenholz dbarenholz self-assigned this Aug 13, 2022
@dbarenholz dbarenholz added enhancement New feature or request WIP Currently working on this. labels Aug 13, 2022
@dbarenholz
Copy link
Owner

@elias-sundqvist Any ideas on how to best implement a method that is mobile-friendly that creates a new file? Button (and soon command) has already been made, but struggling with implementation.

@elias-sundqvist
Copy link
Author

Not sure if I understood your question, but you can create files in obsidian by doing await app.vault.create('path/to/file.ext', "")

@dbarenholz
Copy link
Owner

Not sure if I understood your question, but you can create files in obsidian by doing await app.vault.create('path/to/file.ext', "")

Implemented in 2 ways: right click on a folder allows you to create a new plaintext file in the selected folder, and there's also a command available that will make one and put it in the root directory of the vault! Will be in version 1.0.0 (which also uses CM6 in stead of CM5)

@elias-sundqvist
Copy link
Author

Great! Thanks :)

@holroy
Copy link

holroy commented Nov 17, 2022

How, if it does, will this cope with guys like me wanting to create a .js or .css or .py file?

@holroy
Copy link

holroy commented Nov 17, 2022

Any ideas on how to best implement a method that is mobile-friendly that creates a new file?

Would it be an option, to have a dedicated rename option from the default .md files, into whatever extension the plugin offers? Like a Plaintext: Change extension of file command?

This could then simply be a list to select your chosen extension. And since it's a command, it could be added to stuff like the keyboard hotbar, or accessed through the command palettet, and so on.

@dbarenholz
Copy link
Owner

@elias-sundqvist This is now updated - will make the release in a second (after going through the issues that I fixed)

@holroy Please create a separate issue for this so I can properly track it :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request WIP Currently working on this.
Projects
None yet
Development

No branches or pull requests

3 participants