atom-isearch
atom-isearch copied to clipboard
Incremental search for Atom
Unpublished at 2016.8.3.
Since I'm no longer using this package.
No time to maintain the package which I don't actively use.
I still use incremental-search feature which is builtin in vim-mode-plus.
I just don't want to maintain very similar two features.
isearch
Incremental search.

Development State
~~Very Alpha~~. Beta
[CAUTION] before Alpha or Beta state removed, I may change frequently style and keymap.
Feature
- Incremental search(scroll to matching each key type).
- Intentionally use
onDidChangerather thanonDidStopChangingfor immediate UI feedback. - Display matching count and current index to input panel(change color in future release).
- Don't change cursor position unless you confirm(important for cursor-history like pakcage).
- Fill word under cursor to search input are with keymap.
- Highlight original cursor position while searching and flash current matching.
- Can use wildcard to reduce keytype, and can configure wildchar.
- Support SmartCase search(enabled by default) to conveniently switch case-sensitive search.
Commands
atom-text-editor
isearch:search-forward: Search forward.isearch:search-backward: Search backward.
atom-text-editor.isearch
Following commands are available only on atom-text-editor.isearch scope.
isearch:fill-cursor-word: Fill current word to search input field.isearch:cancel: Canceling search and close input panel.isearch:land-to-start: Land to start of match.isearch:land-to-end: Land to end of match.isearch:fill-history-prev: Fill next search history.isearch:fill-history-next: Fill previous search history.
How to use.
- Start search
isearch:search-forward. - Input searching text.
- Highlighted original cursor position, matchings, automatically scroll to first match.
core:confirmto land. orisearch:cancelto cancel.
Configuration
wild card search
Enable useWildChar, set your favorite char to wildchar.
e.g.
With setting space to wildChar(wildChar = ' ').
You can reach this is it with search text th t.
Keymap
No keymap by default.
e.g.
'atom-workspace':
'ctrl-s': 'isearch:search-forward'
'ctrl-cmd-r': 'isearch:search-backward'
'.platform-darwin atom-text-editor.isearch':
'ctrl-s': 'isearch:search-forward'
'ctrl-r': 'isearch:search-backward'
'ctrl-cmd-r': 'isearch:search-backward'
'ctrl-g': 'isearch:cancel'
'cmd-e': 'isearch:fill-cursor-word'
- Emacs user
'atom-text-editor':
'ctrl-s': 'isearch:search-forward'
'ctrl-r': 'isearch:search-backward'
'.platform-darwin atom-text-editor.isearch':
'ctrl-s': 'isearch:search-forward'
'ctrl-r': 'isearch:search-backward'
'ctrl-g': 'isearch:cancel'
My setting, very experimental.
I'm ok that I can't search [, ], ;.
'atom-text-editor.vim-mode.normal-mode':
's': 'isearch:search-forward'
'S': 'isearch:search-backward'
'.platform-darwin atom-text-editor.isearch[mini]':
']': 'isearch:search-forward'
'[': 'isearch:search-backward'
';': 'core:confirm'
'ctrl-g': 'isearch:cancel'
Similar projects
TODO
- [ ] Input UI improvement.
- [ ] Make style customizable.
- [ ] Label jump by integrating to smalls.
- [ ] Put multi cursor.
- [ ] Excursion mode to move around matchings by vim-like jkhl?
- [ ] Toggle Regexp, Ignore case, and refrect option state to botton.
- [ ] Performance improvement, delay decoration for entry out of screen?
- [ ] Change color with
match,nomatch,bottom,top? - [ ] Restore fold when canceled.
- [ ] Don't search when first char is wild card to avoid heavy computation?
- [ ] Throttle search to reduce heavy search depending on number of line on editor?
- [ ] Hovering indicator to display current position and total matches.
- [ ] Search wrap.
- [x] Cleanup code.
- [x] Support wild card search.
- [x] Ensure not leaking mark(need refactoring beforehand).
- [x] integrate vim-mode's
vim-mode:repeat-search. - [x] Support SmartCase search.
- [x] Search history.
- [x] Restore screenTop, screenLeft.