Difference between revisions of "Sublime Text"

Jump to navigation Jump to search
228 bytes added ,  11:21, 20 June 2016
Updated keyboard inputs to use the key press template
imported>Kicoax
(Added Text Editors category)
imported>Kicoax
(Updated keyboard inputs to use the key press template)
Line 23: Line 23:


===Additional Steps===
===Additional Steps===
Due to the addition of several new auto-complete options for functions, you may find Sublime accepting "Enter" to auto-complete to be annoying. (As an example, try typing "endif" and hitting "Enter" to add a new line) To disable this and only allow "Tab" to auto-complete, do the following:
Due to the addition of several new auto-complete options for functions, you may find Sublime accepting "Enter" to auto-complete to be annoying. (As an example, try typing {{kbd|endif}} and hitting {{key press|Enter}} to add a new line) To disable this and only allow {{key press|Tab}} to auto-complete, do the following:
#Select Preferences -> Settings - User
#Select Preferences -> Settings - User
#Add the following to the file, between the <nowiki>{ and }</nowiki> characters. If there is already other settings in there, make sure they are all separated by commas.
#Add the following to the file, between the <nowiki>{ and }</nowiki> characters. If there is already other settings in there, make sure they are all separated by commas.
Line 29: Line 29:


==Build Types==
==Build Types==
The Sublime Papyrus plugin supports three different build types - debug, release, and release final. These are identical to the build types exposed in the Creation Kit. The normal build option, invoked with Ctrl+B, is a "debug" build. It will produce non-optimized code, with all debug commands intact.
The Sublime Papyrus plugin supports three different build types - debug, release, and release final. These are identical to the build types exposed in the Creation Kit. The normal build option, invoked with {{key press|Ctrl|B}}, is a "debug" build. It will produce non-optimized code, with all debug commands intact.


To access the other build types, open the Sublime command palette (Ctrl+Shift+P) and type in "Build". Then select either release (optimized + debug stripping) or release final (optimized + debug and beta stripping).
To access the other build types, open the Sublime command palette ({{key press|Ctrl|Shift|P}}) and type in "Build". Then select either release (optimized + debug stripping) or release final (optimized + debug and beta stripping).


You will generally want to do debug builds for testing and development, with final builds for release.
You will generally want to do debug builds for testing and development, with final builds for release.
Line 56: Line 56:


==Tips 'n' Tricks==
==Tips 'n' Tricks==
* Drag your scripts directory to the Sublime Text window to have it opened as your current project. Now hit Ctrl-P. You have access to all your scripts here, with it narrowing down the list as you type. It's even smart enough to translate "comph" into "CompanionsHousekeepingScript," so whatever kinds of nutty shorthand you can think of for your scripts will probably work.  
* Drag your scripts directory to the Sublime Text window to have it opened as your current project. Now hit {{key press|Ctrl|P}}. You have access to all your scripts here, with it narrowing down the list as you type. It's even smart enough to translate "comph" into "CompanionsHousekeepingScript," so whatever kinds of nutty shorthand you can think of for your scripts will probably work.  
* In a long file with lots of functions, hit Ctrl-R. You're now looking at a list of functions that you can navigate the same way.  
* In a long file with lots of functions, hit {{key press|Ctrl|R}}. You're now looking at a list of functions that you can navigate the same way.  
* Combine the two of them. Ctrl-P, type to find your file. Add an "@" at the end of it when you have the one you want, and you can go directly to the function in question. So "comph@reoprq" takes me right to the "ReOpenAllRadiantQuests" in CompanionsHousekeepingScript.psc. And since it works as you type, you don't even have to remember ''that'' much.  
* Combine the two of them. {{key press|Ctrl|P}}, type to find your file. Add an "@" at the end of it when you have the one you want, and you can go directly to the function in question. So {{kbd|comph@reoprq}} takes me right to the "ReOpenAllRadiantQuests" in CompanionsHousekeepingScript.psc. And since it works as you type, you don't even have to remember ''that'' much.  
* After you hit Ctrl+B to compile, if there are any errors, you can hit F4 to cycle through them.
* After you hit {{key press|Ctrl|B}} to compile, if there are any errors, you can hit {{key press|F4}} to cycle through them.
* Holding Ctrl and Shift lets you move lines up and down with the arrow keys.  
* Holding {{key press|Ctrl|Shift}} lets you move lines up and down with the arrow keys.  
* Ctrl-Shift-D duplicates a line.  
* {{key press|Ctrl|Shift|D}} duplicates a line.  
* Highlight a word, then press Ctrl-D to highlight every other instance of that word in succession -- makes renaming variables simple!  
* Highlight a word, then press {{key press|Ctrl|D}} to highlight every other instance of that word in succession -- makes renaming variables simple!  
* Drag with the middle mouse button for a vertical select.  
* Drag with the middle mouse button for a vertical select.  
* If you've set up Perforce, you can use the Perforce commands in the FalloutF4 right-click menu (they are also in the command palette). This lets you view old versions of the file you're looking at, perform diffs from the current version against those old versions, and compare what is currently on your disk to what is in the repository.
* If you've set up Perforce, you can use the Perforce commands in the FalloutF4 right-click menu (they are also in the command palette). This lets you view old versions of the file you're looking at, perform diffs from the current version against those old versions, and compare what is currently on your disk to what is in the repository.
* All Events that the compiler supports have been added as snippets, so if you type the name of the event and hit Tab, it will autocomplete to the full event (with parameters) so you don't have to check the wiki for syntax. Snippets are case-sensitive, and all event names are set as lower-case, so you'll need to type the name in lower-case to see it.
* All Events that the compiler supports have been added as snippets, so if you type the name of the event and hit {{key press|Tab}}, it will autocomplete to the full event (with parameters) so you don't have to check the wiki for syntax. Snippets are case-sensitive, and all event names are set as lower-case, so you'll need to type the name in lower-case to see it.
** For remote-registered events, use the name of the event followed by "-REM" to have the correct syntax filled out
** For remote-registered events, use the name of the event followed by "-REM" to have the correct syntax filled out
** For reference collection aliases, use the name of the event followed by "-RC" to have the sender parameter auto-added
** For reference collection aliases, use the name of the event followed by "-RC" to have the sender parameter auto-added
** Both of the above are combined into "-REM-RC" if you happen to need a remote event from a ref collection alias.
** Both of the above are combined into "-REM-RC" if you happen to need a remote event from a ref collection alias.
* All the functions on the wiki have been added as snippets. You can type part of the function name (in lower-case) and hit Tab to fill out the function with all the parameters. Hit tab to switch between each parameter.
* All the functions on the wiki have been added as snippets. You can type part of the function name (in lower-case) and hit {{key press|Tab}} to fill out the function with all the parameters. Hit {{key press|Tab}} to switch between each parameter.
* Place your cursor inside a function name and hit F1 to open the wiki documentation on that function. If there's more than one function with the name, it'll give you a choice as to which one you want to see.  
* Place your cursor inside a function name and hit {{key press|F1}} to open the wiki documentation on that function. If there's more than one function with the name, it'll give you a choice as to which one you want to see.  
** You can also do this by right-clicking and selecting PapyrusF4 -> Wiki Documentation.
** You can also do this by right-clicking and selecting PapyrusF4 -> Wiki Documentation.
** Because Sublime lets you do multiple selections, if you have more than one cursor sitting in a function name, it will attempt to look up documentation for all of them and open them in tabs.
** Because Sublime lets you do multiple selections, if you have more than one cursor sitting in a function name, it will attempt to look up documentation for all of them and open them in tabs.
Anonymous user

Navigation menu