replacing-pattern-collection package
This package helps using find-and-replace
.
If you often use same complex pattern in find-and-replace
, this package is helpful.
This package save patterns to file, and load patterns from file.
This package use the CSON npm package.
How to use
- Set
defaultFilePath
.
File -> Settings -> Packages -> replacing-pattern-collection ->defaultFilePath
or
Packages -> replacing-pattern-collection -> Settings ->defaultFilePath
- Toggle view. default key is
F6
- Control with UI.
User interface
- Read patterns from file.
- Write patterns to file.
- Open patterns file.
- File path will be used to Read/Write/Open.
If change this,defaultFilePath
is also changed. - Close this panel.
- Get patterns form
find-and-replace
panel.
Add new empty patterns whenfind-and-replace
panel is not opened. - Set patterns to
find-and-replace
panel. - Delete pattern.
- Flag of ProjectFind.
- Flag of UseRegex.
- Flag of MatchCase.
- Flag of Only In Selection.
- Flag of WholeWord.
- Set first pattern to this panel.
- Set previous patern to this panel.
- Current pattern / Set Nth pattern to this panel.
- Number of patterns.
- Set next pattern to this panel.
- Set last pattern to this panel.
- Discription of pattern.
- Pattern will be used to find.
- Pattern will be used to replace.
- Pattern will be used to filter file/directory.
Commands and Key binds
Keystroke | Command | Description | Selector |
---|---|---|---|
F6 | replacing-pattern-collection:toggle | Open/Close panel | atom-workspace |
escape | core:cancel | Close panel | atom-workspace |
tab | replacing-pattern-collection:focusNext | Focus next element | .replacing-pattern-collection.root |
shift-tab | replacing-pattern-collection:focusPrevious | Focus previous element | .replacing-pattern-collection.root |
pagedown | replacing-pattern-collection:next | Set next pattern to panel | .replacing-pattern-collection.root |
end | replacing-pattern-collection:last | Set last pattern to panel | .replacing-pattern-collection.root |
pageup | replacing-pattern-collection:previous | Set previous pattern to panel | .replacing-pattern-collection.root |
home | replacing-pattern-collection:first | Set first pattern to panel | .replacing-pattern-collection.root |
insert | replacing-pattern-collection:set | Set pattern to find-and-replace panel |
.replacing-pattern-collection.root |
About CSON file
If you want to edit CSON file, edit as below.
"replacing-pattern-collection":
options: [
{
description : 'remove empty line'
findPattern: "^(\\r\\n)"
replacePattern: ""
pathsPattern: ""
projectFind: false
useRegex: true
caseSensitive: false
wholeWord: false
inCurrentSelection: false
}
]
- description : String. description of pattern.
- findPattern : String. this will be used to find.
- replacePattern : String. this will be used to replace.
- pathsPattern : String. this will be used to filter file/directory.
- projectFind : Boolean. If you use projectFind, set this to true.
- useRegex : Boolean. If you use regex search , set this to true.
- caseSensitive : Boolean. If you use case sensitive search , set this to true.
- wholeWord : Boolean. If you use whole word search , set this to true.
- inCurrentSelection : Boolean. If you use search in current selection, set this to true.