“Sublime Text”,然后出现一个新的 Sublime Text 窗口。 如果 Sublime 已经打开,默认-6ren">
gpt4 book ai didi

sublimetext - 快捷方式/"Open with"Sublime Text,在新的 Sublime 窗口中

转载 作者:行者123 更新时间:2023-12-04 11:22:04 29 4
gpt4 key购买 nike

我正在寻找一种方法来右键单击 Windows 10 中的文件,选择“打开方式”->“Sublime Text”,然后出现一个新的 Sublime Text 窗口。

如果 Sublime 已经打开,默认操作是在新选项卡中打开文件。这通常不是我想要的,特别是因为我通常在不同的桌面上打开 Sublime。

我试过用 -n 做一个快捷方式。添加了标志,仅在使用快捷方式时正确地为我提供了一个新窗口。但是,当我使用该快捷方式“打开方式”时,它会在现有窗口中打开文件。

我还尝试了“打开方式”一个包含 subl -n 的批处理文件。 , ``但是,唉。

最佳答案

如果您更喜欢脚本来执行此操作,请考虑在批处理脚本中使用以下内容:

@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe

rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f

rem add it for current folder
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime" /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%v\"" /f

pause
将其放入一个 .bat 文件(我的称为 SetSublimeMenuShortcuts.bat),然后以管理员用户身份在 Powershell 中运行,使用 .\SetSublimeMenuShortcuts.bat 调用它。如果您看到以下内容,则应正确设置:
The operation completed successfully.
The operation completed successfully.
The operation completed successfully.
The operation completed successfully.
The operation completed successfully.
The operation completed successfully.
Press any key to continue . . .

关于sublimetext - 快捷方式/"Open with"Sublime Text,在新的 Sublime 窗口中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33797650/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com