Otros consejos

Editar el 21 de noviembre de 2014

Tim Lewis señaló en el comentario que hay una versión más genérica en http://www.binaryfortress.com/notepadreplacer/ , que funciona mejor.

Respuesta original

Prueba esto: https://github.com/grumpydev/sublime-notepad-replacement

Aquí hay algunas formas de asociar el texto sublime portátil.El siguiente texto debe guardarse como un archivo con una extensión .reg y luego en ese archivo, haga clic con el botón derecho> Fusionar.

Esto agregará una entrada de menú de clic derecho sublime a todos los archivos:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell]
@="Sublime"

[HKEY_CLASSES_ROOT\*\shell\Sublime]
@="&Sublime"

[HKEY_CLASSES_ROOT\*\shell\Sublime\command]
@="\"D:\\PortableApps\\SublimeText\\sublime_text.exe\" \"%1\""

Esto tendrá texto sublime reemplazar todas las llamadas a notepad.exe:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Notepad.exe]
"Debugger"="\"D:\\PortableApps\\SublimeText\\sublime_text.exe\" -z"

Esto creará una clase de sublimefile que luego puede asociarse con cualquier extensión.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\SublimeFile\shell]
@="edit"

[HKEY_CLASSES_ROOT\SublimeFile\DefaultIcon]
@="\"D:\\PortableApps\\SublimeText\\sublime_text.exe\",0"

[HKEY_CLASSES_ROOT\SublimeFile\shell\edit\command]
@="\"D:\\PortableApps\\SublimeText\\sublime_text.exe\" \"%1\""

Esto asociará luego la extensión .ext con sublimefile:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.ext]
@="SublimeFile"

1: También puede configurar sus asociaciones en Panel de control :

Panel de control> por defectoProgramas > asocian un archivo o protocolo con un programa específico:

ingrese la descripción de la imagen aquí

2: o, llámalo desde el código a través de iatroplicationassociationregontistrationui :: lapsoadvancedassociationui ;)

HRESULT LaunchAdvancedAssociationUI(
   [in]  LPCWSTR pszAppRegName
);

Puede simplemente ejecutar la herramienta del limpiador de registro de CCleaner y luego elegir y agregar el programa predeterminado como de costumbre.Funcionó para mí al actualizar de ST2 a ST3.

Abra el menú contextual en el archivo con la extensión deseada en el Explorer, seleccionar Abrir con-> Usted Editor (puede ser que debe buscar su binario antes de que aparezca en la lista de programas disponibles) y configure la casilla de verificación "SIEMPRE Use el seleccionadoprograma para abrir este tipo de archivo ".

I tried all options to make sublime text 3 as the default program for my .php, .css and/or .js files I don't exactly know why it all failed, I think it is related to windows 10 current version bug

But the good news is there is some working way for me, also for those who love CMD

  1. open CMD as administrator
  2. run this line: FTYPE sublime="C:\Program Files\Sublime Text 3\sublime_text.exe" "%1"
  3. for .php files use this command: ASSOC .php=sublime for js use this: ASSOC .js=sublime and so on...

Try this,

@echo off

SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe

rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2"         /t REG_SZ /v "" /d "Open with Sublime Text 2"   /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2"         /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f

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

pause

I tested this for SublimeText 3(Portable) also and working fine. Create a .bat file with the above code and run it as administrator.

Reference : https://gist.github.com/mrchief/5628677

I was facing the same problem. the only solution was correct it manually --> open regedit and navigate to Computer\HKEY_CLASSES_ROOT\Applications\, find the sublime_text.exe entry, and delete it. You should now be able to set Sublime Text 3 as the default editor for anything you want.

i found this solution in this post:https://forum.sublimetext.com/t/cant-make-default-editor-in-windows/10747/14

If you are using the portable version, you can't set Sublime as the default program for any files because Windows won't acknowledge it as a program that can open things.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top