Closed Taitava closed 2 years ago
Hello @Taitava !!!
I just wanna add two things about opening files:
Have a great day!
I just wanna add two things about opening files:
- open in a new panel vertically
- open in a new pane horizontally
Once I get output channel options implemented, I can add an option for opening the file in a new pane (edit 2022-02-20: this option will not use the graphical UI settings, more below). At least a quick glance at the Obsidian API shows a possibility to open in a new pane. But can I control if the pane is vertical or horizontal - I don't know yet.
I don't know yet, when I get to implement the output channel options.
- when the file is already open but is not active, the SC could make the file active instead of open a second file
Good point!
Have a great day!
Have a nice day, too! 🙂
Once I get output channel options implemented, I can add an option for opening the file in a new pane. At least a quick glance at the Obsidian API shows a possibility to open in a new pane. But can I control if the pane is vertical or horizontal - I don't know yet.
Just to let you know -> the core search assistant plugin and QuickAdd have these options. Might be a good source of information:)
Hello @Taitava !!!!
One more source of information about open files in a new pane + split horizontally
https://gist.github.com/GitMurf/5ba341b8dba7ccd7e24129f4469ca920
https://www.loom.com/share/53b2c6b599ff4d6492b90833a1797d70
Have a great day!!!!!
Thanks! 🙂
One more source of information about open files in a new pane + split horizontally
https://gist.github.com/GitMurf/5ba341b8dba7ccd7e24129f4469ca920
Hmm, I guess app.workspace.getAdjacentLeafInDirection()
method is private API, as I cannot find it in Obsidian API's 0.13.21 public interface. If it's private, I could use it, but it's not safe, as any version update to Obsidian might change how it behaves, or remove the method completely and thus make SC crash when it tries to use it. So I'd rather postpone the ability to decide the direction of the new pane.
:new-pane
and :can-create-file
options in the output textI decided to make the new tab opening option to be presented in the output text instead of making it to be a graphical setting in a UI. This is because then the shell command (or an external program) itself can decide case-by-case if the file should be opened in a new pane or not.
The same applies for allowing or denying to create a new file. By default, the file will not be opened at all, if it does not exist, in order to avoid accidentally creating new files if there is a mistake in the file name. :can-create-file
option can be use to allow creating new files, if needed.
Example output from a shell command: MyNote.md:5:6:new-pane:can-create-file
. Open the file in a new pane and place caret on line 5, column 6. If the file does not exist, create it.
SomeFile.md:5:1:10:-1
selects text between the first character of line 5, and last character of line 10.SomeFile.md:5:1:10:-1:20:1:25:-1
creates two selections, with the first one being the same as above, and the second selection being from the beginning of line 20 till the end of line 25.Woooww !!!!!!!!
@Taitava
Can I combine new-pane with selections ?????
Can I combine new-pane with selections ?????
Yes 👍
Amazing @Taitava !!!!!!
Done and will be released in 0.11.0
. There will be a beta test.
:popover
(Hover Editor Plugin)Hello @Taitava !!!!
Just to let you know that we have a new plugin in beta that has a feature that I think will change the way that we use Obsidian forever.
https://github.com/nothingislost/obsidian-hover-editor
Basically, it will add a new type of way to open notes making them floating in the screen.
This way, we gonna have this options:
This way, I think would be great to have a new command aligned to this new view :)
I know in very early to write about this ... but since I'm testing this new plugin (and creating workflows around it) I decide to write this now to not forget in the future :)
Take a look at the plugin, I think you will gonna like it !!!
Have a great day!!!!!
Hi @FelipeRearden 🙂
I created a new discussion for this, as this particular issue is more about implementation of an already released feature, so discussions related to planning new features are not so related to this issue. 🙂 That being said, your suggestion is good and I'll comment more in the new discussion soon.
https://github.com/Taitava/obsidian-shellcommands/discussions/186
I've had this idea for some time, and in some inspiration peak I just coded it. Normally I'd open a discussion for this, but now I implemented it already. 🙂
touch "NewFile.md" && echo "NewFile.md"
will create an empty file and echo its name so SC can make Obsidian open it.:
. E.g.echo "SomeFile.md:5:6"
opens the file on line 5, column 6. Or you can omit the column:echo "SomeFile.md:5"
. This line/column option can be used e.g. when executing some external search command on a vault's files, and when a file matching the search is found, the file name is echoed with a position in the file near the content that was searched for.Still needed:
Does not let create new files at the moment (will be allowed later)(edit 2022-02-20: allowed now). File paths can be relative or absolute, but they need to be in the vault. File name may end with an extension (.md, .png or something else), but an extension is not needed. Only available forstdout
, becausestderr
might contain unexpected output that does not correspond to a file name.Later (make a new issue for these at the time this issue gets closed):
:new-pane-if-file-not-open
(or something like that) in addition to the current:new-pane
: when the file is already open but is not active, the SC could make the file active instead of open a second file