forked from shangerxin/BookNotes
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAtom Fight Manual;Note=Erxin.txt
410 lines (281 loc) · 11.6 KB
/
Atom Fight Manual;Note=Erxin.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
Atom Fight Manual;Note=Erxin
# Getting Start
- reference, http://fight-manual.atom.io/getting-started
- every atom window is essentially a locally rendered web page
- all the apis avaliable to node.js are also avaliable to code running in each window's javascript context
# Installing Atom
- https://atom.io
- portable mode
+ download atom-widow.zip
+ extract to removeable device
+ launch atom.exe
+ it will create a .atom folder in %userprofile%
+ move that .atom folder to alongside your atom folder on youre movable storeage device , now whenever you launch atom.exe from your removeable storage device it will operate in portable mode and store all its setttings and pcakge in the .atom folder on the device
+ limitations
* no explorer integration command line path
* the .atom folder must be alongside the folder containing atom.exe
* the .atom folder must be writable
* the ATOM_HOME environment variable must no be set
- building atom from source
+ check the build instructions
https://github.com/atom/atom/tree/master/docs/build-instructions
- proxy and firewall settins
+ disable strict ssl by running
$ apm config set strict-ssl false
+ using a proxy
$ apm config set https-proxy YOUR-PROXY-ADDRESS
# Atom Basic
- terminology
command palette, the command palette, if you press ctrl+shift+p in an edit pane, the command palette will pop up
this panel is used to search and execute commands for the ide
the shortcut also will be displayed
- check the keybindings tab in the settings view
- settings and preferences in the setting view
+ open theme setting
settings->view:open in the command palette
use ctrl+,
File>Settings menu item
+ changing the theme, click the theme tab, the theme could be download from the https://atom.io
+ soft wrap, use the settings view to specify your whitespace and wrapping peferences
soft tabs
soft wrap
- opening, modifying and saving files
File>Open from the menu bar
$ atom --help
- save file, ctrl+s, save as ctrl+shift+s
- open directive
file>open folder
add more than one directory into a project by
File>Add Project Folder
hide show tree view with ctrl+\
- opening a file in a project
ctrl+t or ctrl+p
search throw the file currently opened, ctrl+b
limit this fuzzy search with ctrl+shift+b
the fuzzy finder uses the core.ignoredNames, fuzz-finder.ignoredNames and core.excludedVSIgnoredPaths
# Using Atom
- atom packages
+ open settings view ctrl+,
+ the packages are published to http://atom.io/packages
+ package settings
installed package will list the installed packages
update the installed package from the update tab
+ atom themes
+ command line, install package from command line by apm command
$ apm install package name
get help
$ apm help install
$ apm search package-name
- moving in atom
ctrl+left move to the begin of word
ctrl+right move to the end of word
home
end
ctrl+home
ctrl+end
go to line, ctrl+g
use row:column to jump example 30:40
+ navigating by symbols
ctrl+r to method definition
generate tag file by using the ctags utility, after tags generated we could serach symbols across project by ctrl+shift+r, use alt+ctrl+down or alt+ctrl+up to return to the declaration
you can customize tags files by .ctags %userprofile%\.ctags
+ bookmarks
alt+ctrl+f2
f2 to jump to next bookmark
shift f2 to jump back
filter bookmark by ctrl+f2
- atom selections and editing and deleting text
+ selections mirror many of the movement commands but add shift key
shift up, select up
ctrl+l select the entire line
ctrl a select the content
+ basic manipulation
ctrl+j, join the next line to the end of the current line
ctrl+up/down, move the current line up or down
ctrl+shift+d, duplicate the current line
ctrl+k, ctrl+u upper case the current word
ctrl+k, ctrl+l lower case the current word
atom also has built in to reflow a paragraph to hard-wrap at a given maximum line length, you can format the current selection to have lines no longers than 80 number editor.preferedLineLength
+ deleting and cutting
ctrl+sfhit+k delete current line
ctrl+backspace
ctrl+delete delete to the end of word
+ multiple cursor selection
ctrl+ click
alt+ctrl+up/down
ctrl+d select the next word in the document that is the same as the current selected word
alt+f3, select all words in the document that are the same as the current selected word
+ whitespace
atom/whitespace package
on the setting page whitesapce
+ bracketes,
ctrl+m, jump to the bracket matching the one adjacent to the cursor
alt+ctrl+m, select all the text inside the current brackets
alt+ctrl+. close the current xml/html tag
the bracket functionality is implemented in the bracket-matcher package
+ encoding
ctrl+shift+u to change file encoding
- find and replace
ctrl+f
ctrl+shift+f
- snippets
alt+shift+s to list the exsting snippets
+ create your own snippets
%userprofile%\.atom directory called snippets.cson which contain all your custom snippets
open snippets file by File>Snippets
format:
'.source.js':
'console.log':
'prefix': 'log'
'body': 'console.log(${1:"crash"});$2'
each $ started position will be a tab stop position
the prefix is used to trigger the snippets insert the body, the example snippets will insert
console.log("crash");
+ use snippet multi-line which use coffeeScript multi-line syntax
'.source.js':
'if, else if, else':
'prefix': 'ieie'
'body': """
if (${1:true}) {
$2
} else if (${3:false}) {
$4
} else {
$5
}
"""
+ multiple snippets per source we could add scope for each snippets
http://flight-manual.atom.io/using-atom/sections/basic-customization/#configuring-with-cson
for more detail
- autocomplete
use tab or enter to insert optional text hints, the feature is implemented in the autocomplete-plus package
- folding
alt+ctrl+[ and alt+ctrl+ ] to folder a block of code
folder a specific intend level by ctrl+k, ctrl+0-9
fold arbitrary sections by alt+ctrl+f
- panes
ctrl+k up/down/left/right to split the pane, swith between ctrl+k ctrl+up/down/left/right
close all panes by ctrl+w
- pending pane items
+ in previous calls preview tabs
+ single click the tree view it will open a new tab with an italic title which indicate the file is "pending", when a file is pending it is replaced by the next pending file that is opened
+ you can confirm pending file by
double click the tab of the file
double click the file in tree view
editing the content of the file
saving the file
+ diable the pending feature by "Allow Pending Pane Items" in the Core Settings section of the Settings View
- grammar
+ display the grammar selector to manually select grammar
ctrl+shift+l
- version control in atom
atom come with basic git and github integration
+ checkout head
alt+ctrl+z
$ git checkout HEAD -- <path>
$ git reset HEAD -- <path>
+ git status list
$ ctrl+t
ctrl+shift+b to display a list of untracked files
+ set atom as git commit editor by
$ git config --global core.editor "atom --wait"
+ line diff
alt+g, alt+g up to move up and down
+ open on github
alt+g o open file
alt+g b open blame view
alt+g h open history
alt+g c copy url of the current file on github to the clipboard
alt+g r branch compare on github
- writing in atom
+ spell checking
correct miss spell words ctrl+shift+;
the default grammmars to spell check are text.plain, source.gfm and text.git-commit, we could add source.assciidoc to check thoses files too
+ previews
ctrl+shift+M to preview markdown in atom
list all avaliable snippets for the type of file you're currently in hitting by alt+shift+s
- basic customization
+ configuring with cson
style sheet
init script are writtin in CSON short for coffeescript object notation
CONS's key can only be repeated once, the last one will take effect if defined mutliple same keys
+ style tweaks
create a styles.less in your %userprofile%\.atom directory
.status-bar {
color: white;
background-color: black;
}
+ open developer tools by alt+ctrl+i, which will bring up chrome developer tool panel
+ styling the editor, atom-text-editor::shaow
atom-text-editor::shadow .cursor {
border-color: pink;
}
+ customizing keybindings
'atom-text-editor':
'enter': 'editor:newline'
'atom-text-editor[mini] input':
'enter': 'core:confirm'
the keymap defines the meaning of enter in two different context, in a normal editor press enter will triggers the editor:newline command
if it is trigger in a select list's mini-editor then it triggers the core:confirm command
by default keymap.cson is loaded when atom is started
+ global configuration settings, from config.cson file in %userprofile%\.atom directory
'*':
'core':
'excludeVcsIgnoredPaths': true
'editor':
'fontSize': 18
open the file from File>Config menu
+ configuration key reference
core
editor
fuzzyFinder
whitespace
wrap-guide
+ language specific configuration settings
editor.tabLength
editor.softWrap
...
+ language specific settings in your config file
config.cson, ctrl+shift+p and open config and press enter
+ finding a language's scope name, click on packages in the navigation on the left search for lanauge of your choice select it and you should see the scope name under the lanauge name heading
These scopes can be especially useful to style the editor, since they can also be used as class names in your stylesheet.
+ customizing language recognition
config.cson, if you wantted to add the foo extension to the coffeescript langauge
*'
core:
customFileTypes:
'source.coffee': [
'foo'
]
+ controlling the stored to simplify your workflow
cson configuration files are stored on disk on your machine, default in the user home directory called .atom
+ custom home location by set the environment variable ATOM_HOME
+ taking your customization with you with portable mode
Atom is in Portable Mode when there is a directory named .atom sibling to the directory in which the atom executable file lives.
by using a command line
$ atom --portable
# hacking atom
- tools of the trade
- the init file
- package: word count
- package: modifying text
- creating a theme
- publishing
- iconography
- debugging
- writing speces
- cross-platform compatibility
- converting from textmate
# Behind atom
- configuration api
- keymaps in depth
- scoped settings, scopes and scope descriptors
- serialization in atom
- developing node modules
- interacting with other packages
- via services
- maintaining your packages
# Appendix
- Updating your package
- updating UI theme or package selectors
- update syntax theme