Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Chapter 2 cleanup #528

Merged
merged 9 commits into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified content/using-atom/images/find-replace-file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/using-atom/images/find-replace-project.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions content/using-atom/sections/atom-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Atom Packages

First we'll start with the Atom package system. As we mentioned previously, Atom itself is a very basic core of functionality that ships with a number of useful packages that add new features like the [Tree View](https://github.com/atom/tree-view) and the [Settings View](https://github.com/atom/settings-view).

In fact, there are more than 90 packages that comprise all of the functionality that is available in Atom by default. For example, the [Welcome screen](https://github.com/atom/welcome) that you see when you first start Atom, the [spell checker](https://github.com/atom/spell-check), the [themes](https://github.com/atom/one-dark-ui) and the [Fuzzy Finder](https://github.com/atom/fuzzy-finder) are all packages that are separately maintained and all use the same APIs that you have access to, as we'll see in great detail in [Hacking Atom](/hacking-atom/).
In fact, there are more than 80 packages that comprise all of the functionality that is available in Atom by default. For example, the [Welcome screen](https://github.com/atom/welcome) that you see when you first start Atom, the [spell checker](https://github.com/atom/spell-check), the [themes](https://github.com/atom/one-dark-ui) and the [Fuzzy Finder](https://github.com/atom/fuzzy-finder) are all packages that are separately maintained and all use the same APIs that you have access to, as we'll see in great detail in [Hacking Atom](/hacking-atom/).

This means that packages can be incredibly powerful and can change everything from the very look and feel of the entire interface to the basic operation of even core functionality.

Expand Down Expand Up @@ -89,6 +89,6 @@ $ apm view build-coffee
> ├── Atom Build provider for coffee, compiles CoffeeScript
> ├── 1152 downloads
> └── 2 stars
>
>
> Run `apm install build-coffee` to install this package.
```
4 changes: 2 additions & 2 deletions content/using-atom/sections/basic-customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ The scope name is shown in the settings view for each language. Click on "Packag

![Finding a language grammar](../../images/python-grammar.png "Finding a grammar's scope name")

Another way to find the scope for a specific language is to open a file of its kind and press <kbd class="platform-mac">Alt+Cmd+P</kbd><kbd class="platform-windows platform-linux">Alt+Ctrl+Shift+P</kbd> to show all scopes for the current position of the cursor. The scope mentioned top most is always the language for this kind of file, the scopes following are specific to the cursor position:
Another way to find the scope for a specific language is to open a file of its kind and <span class="platform-mac">press <kbd class="platform-mac">Alt+Cmd+P</kbd></span><span class="platform-windows platform-linux">choose "Editor: Log Cursor Scope" in the Command Palette</span> to show all scopes for the current position of the cursor. The scope mentioned top most is always the language for this kind of file, the scopes following are specific to the cursor position:

![Finding a language grammar with cursor scope](../../images/cursor-scope.png "Finding a language grammar with cursor scope")

Expand All @@ -242,7 +242,7 @@ The CSON configuration files for Atom are stored on disk on your machine. The lo

##### Custom home location with an environment variable

An environment variable can be used, though to make Atom use a different location. This can be useful for several reasons. One of these may be that multiple user accounts on a machine want to use the same Atom Home. The environment variable used to specify and alternate location is called `ATOM_HOME`. If this environment variable exists, the location specified will be used to load and store Atom settings.
An environment variable can be used to make Atom use a different location. This can be useful for several reasons. One of these may be that multiple user accounts on a machine want to use the same Atom Home. The environment variable used to specify an alternate location is called `ATOM_HOME`. If this environment variable exists, the location specified will be used to load and store Atom settings.

##### Taking your customization with you with Portable Mode

Expand Down
4 changes: 2 additions & 2 deletions content/using-atom/sections/find-and-replace.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you launch either of those commands, you'll be greeted with the Find and Repl

![Find and replace text in the current file](../../images/find-replace-file.png "Find and replace text in the current file")

To search within your current file you can press <kbd class="platform-mac">Cmd+F</kbd><kbd class="platform-windows platform-linux">Ctrl+F</kbd>, type in a search string and press <kbd class="platform-all">Enter</kbd> (or <kbd class="platform-mac">Cmd+G</kbd><kbd class="platform-windows platform-linux">F3</kbd> or the "Find Next" button) multiple times to cycle through all the matches in that file. The Find and Replace panel also contains buttons for toggling case sensitivity, performing regular expression matching and scoping the search to selections.
To search within your current file you can press <kbd class="platform-mac">Cmd+F</kbd><kbd class="platform-windows platform-linux">Ctrl+F</kbd>, type in a search string and press <kbd class="platform-all">Enter</kbd> (or <kbd class="platform-mac">Cmd+G</kbd><kbd class="platform-windows platform-linux">F3</kbd> or the "Find Next" button) multiple times to cycle through all the matches in that file. <kbd class="platform-all">Alt+Enter</kbd> will find all occurences of the search string. The Find and Replace panel also contains buttons for toggling case sensitivity, performing regular expression matching, scoping the search to selections, and performing whole word search.

If you type a string in the replacement text box, you can replace matches with a different string. For example, if you wanted to replace every instance of the string "Scott" with the string "Dragon", you would enter those values in the two text boxes and press the "Replace All" button to perform the replacements.

Expand All @@ -30,7 +30,7 @@ You can also find and replace throughout your entire project if you invoke the p

This is a great way to find out where in your project a function is called, an anchor is linked to or a specific misspelling is located. Click on the matching line to jump to that location in that file.

You can limit a search to a subset of the files in your project by entering a [glob pattern](https://en.wikipedia.org/wiki/Glob_%28programming%29) into the "File/Directory pattern" text box. For example, the pattern `src/*.js` would restrict the search to javascript files in the `src` directory. The "globstar" pattern (`**`) can be used to match arbitrarily many subdirectories. For example, `docs/**/*.md` will match `docs/a/foo.md`, `docs/a/b/foo.md`, etc. You can enter multiple glob patterns separated by commas, which is useful for searching in multiple file types or subdirectories.
You can limit a search to a subset of the files in your project by entering a [glob pattern](https://en.wikipedia.org/wiki/Glob_%28programming%29) into the "File/Directory pattern" text box. For example, the pattern `src/*.js` would restrict the search to JavaScript files in the `src` directory. The "globstar" pattern (`**`) can be used to match arbitrarily many subdirectories. For example, `docs/**/*.md` will match `docs/a/foo.md`, `docs/a/b/foo.md`, etc. You can enter multiple glob patterns separated by commas, which is useful for searching in multiple file types or subdirectories.

When you have multiple project folders open, this feature can also be used to search in only one of those folders. For example, if you had the folders `/path1/folder1` and `/path2/folder2` open, you could enter a pattern starting with `folder1` to search only in the first folder.

Expand Down
6 changes: 4 additions & 2 deletions content/using-atom/sections/snippets.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ The idea is that you can type something like `habtm` and then press the <kbd cla
Many Core and Community packages come bundled with their own snippets that are specific to it. For example, the `language-html` package that provides support for HTML syntax highlighting and grammar comes with dozens of snippets to create many of the various HTML tags you might want to use. If you create a new HTML file in Atom, you can type `html` and then press <kbd class="platform-all">Tab</kbd> and it will expand to:

```html
<html>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
Expand All @@ -19,7 +21,7 @@ Many Core and Community packages come bundled with their own snippets that are s
</html>
```

It will also position the cursor in the middle of the `title` tag so you can immediately start filling out the tag. Many snippets have multiple focus points that you can move through with the <kbd class="platform-all">Tab</kbd> key as well - for instance, in the case of this HTML snippet, once you've filled out the title tag you can press <kbd class="platform-all">Tab</kbd> and the cursor will move to the middle of the `body` tag.
It will also position the cursor in the `lang` attribute value so you can edit it if necessary. Many snippets have multiple focus points that you can move through with the <kbd class="platform-all">Tab</kbd> key as well - for instance, in the case of this HTML snippet, after the cursor is placed in the `lang` attribute value, you can continue pressing <kbd class="platform-all">Tab</kbd> and the cursor will move to the `dir` attribute value, then to the middle of the `title` tag, then finally to the middle of the `body` tag.

To see all the available snippets for the file type that you currently have open, choose "Snippets: Available" in the Command Palette.

Expand Down
4 changes: 2 additions & 2 deletions content/using-atom/sections/writing-in-atom.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Any misspelled words will be highlighted (by default with a dashed red line bene

To add more types of files to the list of what Atom will try to spell check, go to the Spell Check package settings in your Settings view and add any grammars you want to spell check.

The default grammars to spell check are `text.plain`, `source.gfm`, and `text.git-commit` but you can add something like `source.asciidoc` if you wish to check those types of files too.
The default grammars to spell check are `text.plain`, `source.gfm`, `text.git-commit`, `source.asciidoc`, `source.rst`, and `text.restructuredtext` but you can add other grammars if you wish to check those types of files too.

The spell checking is implemented in the [spell-check](https://github.com/atom/spell-check) package.

Expand All @@ -31,7 +31,7 @@ When writing prose in a markup language, it's often very useful to get an idea o

As you edit the text, the preview will also update automatically. This makes it fairly easy to check your syntax as you type.

You can also copy the rendered HTML from the preview pane into your system clipboard. There is no keybinding for it, but you can find it in the Command Palette by searching for "Markdown Preview Copy HTML".
You can also copy the rendered HTML from the preview pane into your system clipboard when the preview is focused and you press <kbd class="platform-mac">Cmd+C</kbd><kbd class="platform-windows">Ctrl+C</kbd><kbd class="platform-linux">Ctrl+Ins</kbd> or if you right-click in the preview pane and choose "Copy as HTML".

Markdown preview is implemented in the [markdown-preview](https://github.com/atom/markdown-preview) package.

Expand Down