Difference between revisions of "Atom"
imported>Kicoax (Moved the linter instruction) |
imported>Qazaaq (Added categories) |
||
(30 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Atom is a completely free, open-source, highly-extensible text editor based on Chromium and Node.js. | '''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 9: | Line 11: | ||
#Go to [https://atom.io/ the Atom website], download the setup file, and run it. | #Go to [https://atom.io/ the Atom website], download the setup file, and run it. | ||
===Install | ===Install packages=== | ||
* Fallout 4 [https://atom.io/packages/language-papyrus language-papyrus] | |||
* F4SE [https://github.com/Neanka/atom-language-papyrus language-papyrus] | |||
#In Atom, open the settings tab (File -> Settings, or Ctrl | |||
Syntax highlighting and snippets are provided by the one of the language 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 {{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 25: | ||
If your Papyrus Compiler isn't in the default location (<code>C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\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\Fallout 4\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 26: | Line 31: | ||
==Usage== | ==Usage== | ||
The | ===Snippets=== | ||
The available snippets are nearly identical to the [[Sublime Text#Existing_Snippets|Sublime Text plugin's snippets]]. | |||
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=== | |||
There are two methods to configure compilation of your scripts; using a [[Papyrus Projects|Papyrus project file]], or manually configuring the build-papyrus settings. | |||
Using a project file is highly recommended, as it can handle compiling entire folders at the same time, and will always compile all of your scripts when building. | |||
Manual configuration will only compile the file you currently have open. | |||
In either case, you can use {{key press|Ctrl|Alt|B}} or {{key press|F9}} to trigger the build. | |||
You can choose if you want to compile for default, release (strip out debugOnly), or final release (strip out debugOnly and betaOnly) by selecting the build target. | |||
To select the active build target, press {{key press|Ctrl|Alt|T}} or {{key press|F7}}. | |||
If you are keeping your scripts inside the game folder, the project/configuration file should be placed in <code>Fallout 4\Data\Scripts\Source</code>. | |||
Otherwise, the file should be placed in your mod's folder. | |||
These are also the folders you should have open in Atom. | |||
You should only have one project/configuration file in any folder, as build-papyrus only uses the first one it locates. | |||
Upon adding or removing a project/configuration file, make sure you run the <code>Build: Refresh Targets</code> command in the palette ({{key press|Ctrl|Shift|P}}). | |||
More information is available in the [https://github.com/Gawdl3y/atom-build-papyrus/blob/master/README.md build-papyrus readme file]. | |||
====Project file==== | |||
Make sure your Papyrus project file is in the base folder that you have open in Atom. No additional configuration is necessary. | |||
====Manual configuration==== | |||
Place the below text into a file called <code>.build-papyrus.yml</code> in the base folder you have open in Atom: | |||
<source lang="yaml"> | |||
game: fallout4 | |||
output: C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\ | |||
imports: | |||
- C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\User | |||
- C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC03 | |||
- C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC02 | |||
- C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC01 | |||
- C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\Base | |||
</source> | |||
If your mod's scripts are outside of the game's scripts directory, make sure you add it to the <code>imports</code> setting, and change the <code>output</code> directory. | |||
If you do not have the DLC, simply remove them from the <code>imports</code> setting. | |||
==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 43: | Line 97: | ||
*[https://atom.io/packages/clipboard-plus clipboard-plus] - Keeps your clipboard history | *[https://atom.io/packages/clipboard-plus clipboard-plus] - Keeps your clipboard history | ||
==See Also== | |||
*[[:Category:Text Editors|Other Text Editors]] | |||
[[Category:Text Editors]] | |||
[[Category:Scripting]] | [[Category:Scripting]] | ||
[[Category: | [[Category:Tooling]] |
Latest revision as of 04:28, 3 December 2018
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 can be downloaded from the 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 has an extremely flexible package system that allows customization of virtually everything about the editor.
See Wikipedia's page for more information.
Installation[edit | edit source]
Install Atom[edit | edit source]
- Go to the Atom website, download the setup file, and run it.
Install packages[edit | edit source]
- Fallout 4 language-papyrus
- F4SE language-papyrus
Syntax highlighting and snippets are provided by the one of the language packages. Compilation is provided by the build and build-papyrus packages.
- In Atom, open the settings tab (File -> Settings, or Ctrl+,)
- Select the Install tab on the side
- Search for
language-papyrus
, then click install on the package when the results appear - Repeat the previous step for
build
andbuild-papyrus
- To see compiler errors inline with your code, also install the
linter
package
If your Papyrus Compiler isn't in the default location (C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler.exe
), then you must set it in the build-papyrus package settings:
- In Atom, open the settings tab (File -> Settings, or Ctrl+,)
- Select the Packages tab on the side
- Search for
build-papyrus
or find it in the list, and click on Settings - Change the compiler path setting to your appropriate path
Usage[edit | edit source]
Snippets[edit | edit source]
The available snippets are nearly identical to the Sublime Text plugin's snippets. 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 Tab ↹ or clicking on it. Immediately after autocompletion, you may be able to cycle through pieces of it by pressing Tab ↹ again, depending on the snippet.
Compilation[edit | edit source]
There are two methods to configure compilation of your scripts; using a Papyrus project file, or manually configuring the build-papyrus settings. Using a project file is highly recommended, as it can handle compiling entire folders at the same time, and will always compile all of your scripts when building. Manual configuration will only compile the file you currently have open. In either case, you can use Ctrl+Alt+B or F9 to trigger the build.
You can choose if you want to compile for default, release (strip out debugOnly), or final release (strip out debugOnly and betaOnly) by selecting the build target. To select the active build target, press Ctrl+Alt+T or F7.
If you are keeping your scripts inside the game folder, the project/configuration file should be placed in Fallout 4\Data\Scripts\Source
.
Otherwise, the file should be placed in your mod's folder.
These are also the folders you should have open in Atom.
You should only have one project/configuration file in any folder, as build-papyrus only uses the first one it locates.
Upon adding or removing a project/configuration file, make sure you run the Build: Refresh Targets
command in the palette (Ctrl+⇧ Shift+P).
More information is available in the build-papyrus readme file.
Project file[edit | edit source]
Make sure your Papyrus project file is in the base folder that you have open in Atom. No additional configuration is necessary.
Manual configuration[edit | edit source]
Place the below text into a file called .build-papyrus.yml
in the base folder you have open in Atom:
game: fallout4
output: C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\
imports:
- C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\User
- C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC03
- C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC02
- C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\DLC01
- C:\Program Files (x86)\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\Base
If your mod's scripts are outside of the game's scripts directory, make sure you add it to the imports
setting, and change the output
directory.
If you do not have the DLC, simply remove them from the imports
setting.
Tips and tricks[edit | edit source]
- The command palette (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 brt will find
Build: Refresh Targets
, for example. - Pressing 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 Ctrl+Alt+G or F4. You can also jump straight to the first error with Ctrl+Alt+H or ⇧ 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 Ctrl allows you to move lines up and down with the arrow keys.
- Ctrl+⇧ Shift+D duplicates a line.
- Highlight a word, then 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 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 -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
- 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 and hit Tab ↹ to fill out the function with all the parameters. Hit Tab ↹ to switch between each parameter.
Recommended packages[edit | edit source]
To further enhance your experience with Atom, there are thousands of packages for Atom available. You can browse them within the editor itself, or on the official packages site. Here are a few worth taking a look at:
- minimap - Adds a minimap preview of your source code like Sublime Text does
- minimap-find-and-replace - Highlights all found text on the minimap when finding/replacing code
- minimap-selection - Highlights your text selection on the minimap
- highlight-selected - Highlights all occurrences of your text selection
- minimap-highlight-selected - Highlights all occurrences of your text selection on the minimap
- project-manager - Lets you save your Atom workspace as a project, and easily reopen them
- clipboard-plus - Keeps your clipboard history