Difference between revisions of "Atom Setup"
Jump to navigation
Jump to search
Updated from Fallout 4 version
imported>Gawdl3y (Added snippets info and separated usage into snippets and compilation) |
imported>Gawdl3y (Updated from Fallout 4 version) |
||
Line 1: | Line 1: | ||
Atom is a completely free, open-source, highly-extensible text editor based on Chromium and Node.js. | [[Category:Scripting]] | ||
[[Category:Text Editors]] | |||
'''Atom''' is a completely free, open-source, highly-extensible text editor based on Chromium and Node.js. | |||
It was created and is being actively developed by the GitHub team. | It was created and is being actively developed by the GitHub team. | ||
It can be downloaded from the [https://atom.io/ official Atom site]. | It can be downloaded from the [https://atom.io/ official Atom site]. | ||
Atom's interface and functionality is very similar to Sublime Text, so it's a fairly painless transition if you have experience with it. | Atom's interface and functionality is very similar to Sublime Text, so it's a fairly painless transition if you have experience with it. | ||
Atom has an extremely flexible package system that allows customization of virtually everything about the editor. | Atom has an extremely flexible package system that allows customization of virtually everything about the editor. | ||
{{See Wikipedia|Atom (text editor)}} | |||
==Installation== | ==Installation== | ||
Line 12: | Line 16: | ||
Syntax highlighting and snippets are provided by the [https://atom.io/packages/language-papyrus language-papyrus] package. | Syntax highlighting and snippets are provided by the [https://atom.io/packages/language-papyrus language-papyrus] package. | ||
Compilation is provided by the [https://atom.io/packages/build build] and [https://atom.io/packages/build-papyrus build-papyrus] packages. | Compilation is provided by the [https://atom.io/packages/build build] and [https://atom.io/packages/build-papyrus build-papyrus] packages. | ||
#In Atom, open the settings tab (File -> Settings, or Ctrl | #In Atom, open the settings tab (File -> Settings, or {{key press|Ctrl|,}}) | ||
#Select the Install tab on the side | #Select the Install tab on the side | ||
#Search for <code>language-papyrus</code>, then click install on the package when the results appear | #Search for <code>language-papyrus</code>, then click install on the package when the results appear | ||
Line 20: | Line 24: | ||
If your Papyrus Compiler isn't in the default location (<code>C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Papyrus Compiler\PapyrusCompiler.exe</code>), then you must set it in the build-papyrus package settings: | If your Papyrus Compiler isn't in the default location (<code>C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Papyrus Compiler\PapyrusCompiler.exe</code>), then you must set it in the build-papyrus package settings: | ||
#In Atom, open the settings tab (File -> Settings, or Ctrl | #In Atom, open the settings tab (File -> Settings, or {{key press|Ctrl|,}}) | ||
#Select the Packages tab on the side | #Select the Packages tab on the side | ||
#Search for <code>build-papyrus</code> or find it in the list, and click on Settings | #Search for <code>build-papyrus</code> or find it in the list, and click on Settings | ||
Line 27: | Line 31: | ||
==Usage== | ==Usage== | ||
===Snippets=== | ===Snippets=== | ||
The language-papyrus package includes hundreds of snippets you can use for vanilla Skyrim functions and events, as well as various library mods. To use a snippet, just begin typing a function/event | The language-papyrus package includes hundreds of snippets you can use for vanilla Skyrim functions and events, as well as various library mods. | ||
To use a snippet, just begin typing the name of a function/event/other snippet, and a list of matched snippets will appear. | |||
You can choose which one to use with the arrow keys or mouse, and complete it by pressing {{key press|Tab}} or clicking on it. | |||
Immediately after autocompletion, you may be able to cycle through pieces of it by pressing {{key press|Tab}} again, depending on the snippet. | |||
===Compilation=== | ===Compilation=== | ||
Line 39: | Line 46: | ||
output: C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\ | output: C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\ | ||
optimize: true</pre> | optimize: true</pre> | ||
After placing the .build-papyrus.yml file there, any of the scripts you open in Atom will be able to be compiled simply by pressing | After placing the .build-papyrus.yml file there, any of the scripts you open in Atom will be able to be compiled simply by pressing {{key press|Ctrl|Alt|B}} or {{key press|F9}}.<br /> | ||
If there are errors during compilation, clicking a filename in the build output window will take you directly to the spot in your code in which the error occurred. | If there are errors during compilation, clicking a filename in the build output window will take you directly to the spot in your code in which the error occurred. {{key press|Ctrl|Alt|G}} will also jump between any errors. | ||
====Mod Organizer==== | ====Mod Organizer==== | ||
Line 59: | Line 66: | ||
- C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\Hearthfire | - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\Hearthfire | ||
- C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source</pre> | - C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Data\Scripts\Source</pre> | ||
==Tips and tricks== | |||
*The command palette ({{key press|Ctrl|Shift|P}}) lists every single command available in Atom, with a fuzzy finder. If you ever forget a hotkey, you can search for the command with its full/partial name or whatever shorthand you come up with. Searching {{kbd|brt}} will find <code>Build: Refresh Targets</code>, for example. | |||
*Pressing {{key press|Ctrl|P}} will open a fuzzy finder for all files in the folder you have open. It will list files that match your search in real-time. You can type file names in just about any shorthand you can think of, and it will find them correctly. "comph" will match a file named "CompanionsHousekeepingScript.psc", for example. | |||
*After compiling, if there are any errors, you can cycle through them with {{key press|Ctrl|Alt|G}} or {{key press|F4}}. You can also jump straight to the first error with {{key press|Ctrl|Alt|H}} or {{key press|Shift|F4}}. Additionally, you can click on the errors at the bottom of the window to jump to them. The linter package will also list the errors in a much prettier, more usable way. | |||
*Holding {{key press|Ctrl}} allows you to move lines up and down with the arrow keys. | |||
*{{key press|Ctrl|Shift|D}} duplicates a line. | |||
*Highlight a word, then press {{key press|Ctrl|D}} repeatedly to highlight each occurrence of it in succession. This makes renaming variables and functions quite simple! | |||
*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. | |||
**For remote-registered events, use the name of the event followed by {{kbd|-rem}} to have the correct syntax filled out. | |||
**For reference collection aliases, use the name of the event followed by {{kbd|-rc}} to have the sender parameter auto-added | |||
**Both of the above are combined into {{kbd|-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 and hit {{key press|Tab}} to fill out the function with all the parameters. Hit {{key press|Tab}} to switch between each parameter. | |||
==Recommended packages== | ==Recommended packages== | ||
Line 74: | Line 94: | ||
{{Languages}} | {{Languages}} | ||