|
| 1 | +.. _atom_as_ide: |
| 2 | + |
| 3 | +########################################## |
| 4 | +Turning Atom Into a Lightweight Python IDE |
| 5 | +########################################## |
| 6 | + |
| 7 | +Atom is the self-proclaimed "hackable text editor for the 21st Century." It has a nice modern interface, and is highly customizable yet can also be used productively with minimal setup and configuration. |
| 8 | + |
| 9 | + |
| 10 | +Requirements |
| 11 | +============ |
| 12 | + |
| 13 | +Any IDE should ease your development experience by providing the following: |
| 14 | + |
| 15 | +* It should provide excellent, configurable syntax colorization. |
| 16 | +* It should allow for robust tab completion. |
| 17 | +* It should offer the ability to jump to the definition of symbols in other files. |
| 18 | +* It should perform automatic code linting to help avoid silly mistakes. |
| 19 | +* It should be able to interact with a Python interpreter such that when debugging, the editor will follow along with the debugger. |
| 20 | + |
| 21 | +Atom does all this and more, but some functionality requires you to select and install packages. |
| 22 | + |
| 23 | + |
| 24 | +Which Version? |
| 25 | +============== |
| 26 | + |
| 27 | +The latest version is the best version. Atom is regularly maintained, so the latest |
| 28 | +version will have the latest bug fixes and updates. |
| 29 | + |
| 30 | + |
| 31 | +Installation |
| 32 | +============ |
| 33 | + |
| 34 | +Go to the Atom website_. |
| 35 | + |
| 36 | +.. _website: https://atom.io/ |
| 37 | + |
| 38 | +On the main page, click the big red button to download the installer, then run the installer. |
| 39 | + |
| 40 | +If it is not offering the correct platform: on the main page, below the big red button, click Other Platforms and find the installer for your operating system. |
| 41 | + |
| 42 | +If you already have Atom installed, but want to check for a newer version, go to |
| 43 | +``Help`` -> ``Check for Update``. |
| 44 | + |
| 45 | + |
| 46 | +Basic Settings |
| 47 | +============== |
| 48 | + |
| 49 | +Atom can be used out of the box with no setup as a text editor. It automatically |
| 50 | +recognizes file types and helpfully highlights text accordingly. To use in this manner, |
| 51 | +write your Python files in Atom, then run them in your Python command prompt. |
| 52 | + |
| 53 | + |
| 54 | +Extending the Editor |
| 55 | +==================== |
| 56 | + |
| 57 | +When you first open Atom, a Welcome Guide appears. This provides some quick and helpful information on |
| 58 | +how to open projects, install packages, and customize your themes and styling. |
| 59 | + |
| 60 | +Atom has great documentation_ on how to hack and configure it. Read the Flight Manual_ for tons of information on |
| 61 | +everything you can do. You can also watch a Getting Started video_. |
| 62 | + |
| 63 | +.. _documentation: https://atom.io/docs |
| 64 | +.. _Manual: http://flight-manual.atom.io/ |
| 65 | +.. _video: https://www.youtube.com/watch?v=U5POoGSrtGg |
| 66 | + |
| 67 | +Atom has a configuration file which you can modify called config.cson. |
| 68 | +Access it via ``File`` -> ``Config...`` |
| 69 | + |
| 70 | +:: |
| 71 | + |
| 72 | + "*": |
| 73 | + core: |
| 74 | + themes: [ |
| 75 | + "atom-dark-ui" |
| 76 | + "solarized-light-syntax" |
| 77 | + ] |
| 78 | + editor: |
| 79 | + fontSize: 19 |
| 80 | + "exception-reporting": |
| 81 | + userId: "6e2a9c3f-7ddb-7deb-b5f7-b58f2f87ac0d" |
| 82 | + "tree-view": |
| 83 | + hideVcsIgnoredFiles: true |
| 84 | + |
| 85 | +Here you can quickly change the theme or font size. Some packages will require you to add configs |
| 86 | +or make adjustments here. Read the documentation carefully when installing packages. |
| 87 | + |
| 88 | +In general, you can extend Atom by installing packages, and then accessing their functionality from the Packages |
| 89 | +drop-down menu. Access the Install Packages page from the Welcome Guide page. If the Welcome Guide is not open, |
| 90 | +you can open it via ``Help`` -> ``Welcome Guide``. |
| 91 | + |
| 92 | +Keyboard shortcuts are specified in the packages menus if available. |
| 93 | + |
| 94 | +The Useful Packages presented below are only a few options of many. |
| 95 | + |
| 96 | + |
| 97 | +Useful Packages |
| 98 | +=============== |
| 99 | + |
| 100 | +Running Scripts |
| 101 | +--------------- |
| 102 | + |
| 103 | +To run scripts within Atom, you will need to install the Script_ package. The Script package supports a ton of languages, |
| 104 | +including Python! |
| 105 | + |
| 106 | +.. _Script: https://atom.io/packages/script |
| 107 | + |
| 108 | +Autocompletion |
| 109 | +-------------- |
| 110 | + |
| 111 | +By default, Atom knows which Python packages you have imported, variables you have created |
| 112 | +and so on. Autocomplete_ ships with Atom and requires no setup. |
| 113 | + |
| 114 | +.. _Autocomplete: http://flight-manual.atom.io/using-atom/sections/autocomplete/ |
| 115 | + |
| 116 | +Code Linting |
| 117 | +------------ |
| 118 | + |
| 119 | +To get code linting functionality in Atom, you will need to install a linting package |
| 120 | +of which there are many to choose from. linter-pylint_ works well, and requires minimal |
| 121 | +setup. |
| 122 | + |
| 123 | +.. _linter-pylint: https://atom.io/packages/linter-pylint |
| 124 | + |
| 125 | +White Space Management |
| 126 | +---------------------- |
| 127 | + |
| 128 | +Atom knows when you are writing Python and helps you out by dealing with spaces and tabs |
| 129 | +in the same way. When in a Python file, if you type 4 spaces, then hit delete, you are |
| 130 | +taken back a tab. |
| 131 | + |
| 132 | +The Whitespace_ package ships with Atom and requires no setup. Under the ``Packages`` -> ``Whitespace`` menu, |
| 133 | +you will find tools to turn all tabs into spaces, all spaces into tabs, among other whitespace-related options. |
| 134 | + |
| 135 | +.. _Whitespace: https://atom.io/packages/whitespace |
| 136 | + |
| 137 | +Debugging |
| 138 | +--------- |
| 139 | + |
| 140 | +To use a Python debugger in Atom, you will need to install the python-debugger_ package. Once installed, turn on the |
| 141 | +debugger by going to ``Packages`` -> ``python-debugger`` -> ``Toggle``. |
| 142 | + |
| 143 | +.. _python-debugger: https://atom.io/packages/python-debugger |
0 commit comments