Created
September 13, 2013 19:02
-
-
Save dylanmei/6554700 to your computer and use it in GitHub Desktop.
Windows Notepad replacement, in this case, sublime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Create an executable | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| namespace Sublime_ifeo | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Process.Start(@"C:\Program Files\Sublime Text 2\sublime_text.exe", | |
| string.Concat("\"", string.Join(" ", CleanArguments(args)), "\"")); | |
| } | |
| static string[] CleanArguments(string[] args) | |
| { | |
| var list = new List<string>(); | |
| for (var i = 0; i < args.Length; i++) | |
| { | |
| if (args[i] == "-z") i++; | |
| else list.Add(args[i]); | |
| } | |
| return list.ToArray(); | |
| } | |
| } | |
| } | |
| 2. Create Regkey HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe | |
| 3. Assign REG_SZ Key Debugger = "C:\src\Spikes\Sublime-ifeo\bin\Debug\Sublime-ifeo.exe" -z |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment