diff --git a/README.md b/README.md index 644fd21d..13e57fdc 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,58 @@ # Find and Replace package -[![OS X Build Status](https://travis-ci.org/atom/find-and-replace.svg?branch=master)](https://travis-ci.org/atom/find-and-replace) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/6w4baiiq5mw4nxky/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/find-and-replace/branch/master) [![Dependency Status](https://david-dm.org/atom/find-and-replace.svg)](https://david-dm.org/atom/find-and-replace) +[![macOS Build Status](https://travis-ci.org/atom/find-and-replace.svg?branch=master)](https://travis-ci.org/atom/find-and-replace) +[![Windows Build Status](https://ci.appveyor.com/api/projects/status/6w4baiiq5mw4nxky/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/find-and-replace/branch/master) +[![Dependency Status](https://david-dm.org/atom/find-and-replace.svg)](https://david-dm.org/atom/find-and-replace) Find and replace in the current buffer or across the entire project in Atom. -## Find in buffer +![Find in buffer](https://f.cloud.github.com/assets/69169/1625938/a859fa70-56d9-11e3-8b2a-ac37c5033159.png) -Using the shortcut cmd-f (Mac) or ctrl-f (Windows and Linux). -![screen shot 2013-11-26 at 12 25 22 pm](https://f.cloud.github.com/assets/69169/1625938/a859fa70-56d9-11e3-8b2a-ac37c5033159.png) +![Find in project](https://f.cloud.github.com/assets/69169/1625945/b216d7b8-56d9-11e3-8b14-6afc33467be9.png) -## Find in project +## Usage +You can open find and replace for each individual buffer by navigating to _Find > Find in Buffer_ or find and replace for an entire project by navigating to _Find > Find in Project_. To close, press _Find in Buffer_ or _Find in Project_ again, respectively. -Using the shortcut cmd-shift-f (Mac) or ctrl-shift-f (Windows and Linux). -![screen shot 2013-11-26 at 12 26 02 pm](https://f.cloud.github.com/assets/69169/1625945/b216d7b8-56d9-11e3-8b14-6afc33467be9.png) +Once opened, the first text box is used to find phrases that can also be replaced by content in the second text box. `Replace All` will replace all instances of the first text box's text. If using find in project, there is also an additional text box that allows you to specify which directories/files are to be searched. -## Provided Service +There are also multiple options available while using find and replace: +* `.*` - Use Regex +* `Aa` - Match case +* `"` - Only in selection (not available for find in project) +* `\b` - Whole word (not available for find in project) -If you need access the marker layer containing result markers for a given editor, use the `find-and-replace@0.0.1` service. The service exposes one method, `resultsMarkerLayerForTextEditor`, which takes a `TextEditor` and returns a `TextEditorMarkerLayer` that you can interact with. Keep in mind that any work you do in synchronous event handlers on this layer will impact the performance of find and replace. +Want to learn more? Check out the [Using Atom: Find and Replace](http://flight-manual.atom.io/using-atom/sections/find-and-replace) section in the Atom flight manual. + +## Commands and Keybindings +|Command|Description|Keybinding (Linux)|Keybinding (macOS)|Keybinding (Windows)| +|-------|-----------|------------------|-----------------|--------------------| +|`project-find:show`|Show the project find and replace dialog|ctrl-shift-f|cmd-shift-f|ctrl-shift-f| +|`project-find:confirm`|Find the next occurence of the phrase||cmd-enter|ctrl-enter| +|`project-find:toggle-regex-option`|Toggle the "regex" option||cmd-alt-/|ctrl-alt-/| +|`project-find:toggle-case-option`|Toggle the "match case" option||cmd-alt-c|ctrl-alt-c| +|`project-find:toggle-whole-word-option`|Toggle the "whold word" option||cmd-alt-w|ctrl-alt-w| +|`project-find:replace-all`|Replace all occurences of the phrase|ctrl-enter|cmd-enter|ctrl-enter| +|`find-and-replace:show`|Show the buffer find and replace dialog|ctrl-f|cmd-f|ctrl-f| +|`find-and-replace:show-replace`|Toggle the buffer find and replace dialog and focuses the replace text box|ctrl-alt-f|cmd-alt-f|ctrl-alt-f| +|`find-and-replace:confirm`|Find the next occurence of the phrase||cmd-enter|ctrl-enter| +|`find-and-replace:toggle-regex-option`|Toggle the "regex" option||cmd-alt-/|ctrl-alt-/| +|`find-and-replace:toggle-case-option`|Toggle the "match case" option||cmd-alt-c|ctrl-alt-c| +|`find-and-replace:toggle-selection-option`|Toggle the "obly in selection" option||cmd-alt-s|ctrl-alt-s| +|`find-and-replace:toggle-whole-word-option`|Toggle the "whold word" option||cmd-alt-w|ctrl-alt-s| +|`find-and-replace:find-all`|Find all occurences of the pharase|ctrl-enter|cmd-enter|ctrl-enter| +|`find-and-replace:find-next`|Find the next occurence of the phrase|f3|cmd-g|f3| +|`find-and-replace:find-previous`|Find the previous occurence of the phrase|shift-f3|cmd-shift-g|shift-f3| +|`find-and-replace:find-next-selected`|Find the next occurence of the phrase selected|ctrl-f3|cmd-f3|ctrl-f3| +|`find-and-replace:find-previous-selected`|Find the previous occurence of the phrase selected|ctrl-shift-f3|cmd-shift-f3|ctrl-shift-f3| +|`find-and-replace:select-all`|Select all occurences of the phrase|alt-f3|cmd-ctrl-g|alt-f3| +|`find-and-replace:select-next`|Select the next occurence of the phrase|ctrl-d|cmd-d|ctrl-d| +|`find-and-replace:select-undo`|Undo the last selection|ctrl-u|cmd-u|ctrl-u| +|`find-and-replace:select-skip`|Skip the current selection|ctrl-k ctrl-d|cmd-k cmd-u|ctrl-k ctrl-u| +|`find-and-replace:focus-next`|Focus the next text box in the find and replace dialog|tab|tab|tab| +|`find-and-replace:focus-previous`|Focus the previous text box in the find and replace dialog|shift-tab|shift-tab|shift-tab| +|`find-and-replace:replace-all`|Replace all occurences of the phrase|ctrl-enter|cmd-enter|ctrl-enter| + +## Contributing +Always feel free to help out! Whether it's [filing bugs and feature requests](https://github.com/atom/find-and-replace/issues/new) or working on some of the [open issues](https://github.com/atom/find-and-replace/issues), Atom's [contributing guide](https://github.com/atom/atom/blob/master/CONTRIBUTING.md) will help get you started while the [guide for contributing to packages](https://github.com/atom/atom/blob/master/docs/contributing-to-packages.md) has some extra information. + +## License +MIT License. See [the license](LICENSE.md) for more details. diff --git a/appveyor.yml b/appveyor.yml index 2b0fde43..6856fdcd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ -version: "{build}" - -platform: x64 +platform: + - x64 + - x86 branches: only: @@ -18,7 +18,7 @@ environment: - ATOM_CHANNEL: beta install: - - ps: Install-Product node 4 + - ps: Install-Product node 6 build_script: - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/atom/ci/master/build-package.ps1')) diff --git a/keymaps/find-and-replace.cson b/keymaps/find-and-replace.cson index 8242e5b7..d54b3da3 100644 --- a/keymaps/find-and-replace.cson +++ b/keymaps/find-and-replace.cson @@ -1,5 +1,5 @@ '.platform-darwin': - 'cmd-F': 'project-find:show' + 'cmd-shift-f': 'project-find:show' 'cmd-f': 'find-and-replace:show' 'cmd-alt-f': 'find-and-replace:show-replace' @@ -7,13 +7,13 @@ 'alt-a': 'project-find:show-in-current-directory' '.platform-win32, .platform-linux': - 'ctrl-F': 'project-find:show' + 'ctrl-shift-f': 'project-find:show' 'ctrl-f': 'find-and-replace:show' 'ctrl-alt-f': 'find-and-replace:show-replace' '.platform-darwin atom-text-editor': 'cmd-g': 'find-and-replace:find-next' - 'cmd-G': 'find-and-replace:find-previous' + 'cmd-shift-g': 'find-and-replace:find-previous' 'cmd-f3': 'find-and-replace:find-next-selected' 'cmd-shift-f3': 'find-and-replace:find-previous-selected' 'cmd-ctrl-g': 'find-and-replace:select-all'