Code Monkey home page Code Monkey logo

atom-narrow's Introduction

narrow

Build Status

narrow something.
Code navigation tool inspired by unite.vim, emacs-helm.
More information on wiki

narrow

What's this?

  • Provide narrowing UI like emacs-helm and unite/denite.vim.
  • Not aiming to become "can open anything from narrow-able UI" package.
  • Primal focus is on code-navigation.
  • Provider provide items( e.g. by search files in project ), you can filter items by query to narrow down further.
  • As you move cursor on active-editor, current item on narrow-ui is automatically synced.
  • You no longer lost like "Where am I?" when you are working on multiple files.
  • Let narrow navigate to next/previous item to aid your concentration.
  • Edit with confidence for no-overlook by direct-edit( edit on ag search result on narrow-editor then apply changes to real-file ).
  • In mind
    • keyboard navigation.
    • vim-mode-plus integration( I'm also maintainer of vim-mode-plus ).
  • Also see UseCase on wiki and Q&A on this doc

Roles in play.

  • narrow-editor or narrow-ui: filter items by query and render items.
  • narrow-provider: Provide items to narrow.

overview

overview

control bar

control-bar

Bundled providers

You can check GIFs for all bundled provider here.
I use scan, search, git-diff-all, symbols in daily-basis, for other providers I don't use much.

  • scan: Scan current editor.
  • search: Search by ag( you need to install ag by yourself).
  • atom-scan: Similar to search but use Atom's atom.workspace.scan.
  • fold: Provide fold-starting rows as item.
  • git-diff-all: Show all modified state file across project.
  • symbols: Provide symbols for current file.
  • project-symbols: Provide project-wide symbols information by reading tags file.

Quick tour

To follow this quick-tour, you don't need custom keymap.

Step1. basic by using narrow:scan

  1. Open some text-editor, then via command-palette, invoke Narrow Scan.
  2. narrow-editor opened, Initial items are each lines on editor. As you type, you can narrow items.
  3. When you type apple as query. all apple matching items are listed.
  4. You can move normal up, down(or j, k in read-only mode) key to quick-preview items.
  5. enter to confirm. When confirmed, narrow-editor closed.

The read-only mode is enabled by default.

Step2. navigate from outside of narrow-editor.

  1. Open some text-editor, then via command-palette, invoke Narrow Scan.
  2. narrow-editor opened. As you type, you can narrow items.
  3. Click invoking editor. And see your clicked position is automatically reflected narrow-editor.
  4. ctrl-cmd-n to move to next-item, ctrl-cmd-p to move to previous-item.
  • If you are vim-mode-plus user, You can use tab and shift-tab.
  1. You can close narrow-editor by ctrl-g( no need to focus narrow-editor ).
  2. If you want to change narrow-query, you have to focus to narrow-editor
  • Use ctrl-cmd-f( narrow:focus ) to focus narrow-editor.
  • Use ctrl-cmd-i( narrow:focus-prompt ) to directly focus narrow-editor's query prompt row.
  • Both commands are available from outside/inside of narrow-editor.
  1. These navigation keymaps are available for all provider(e.g. search, fold etc).

Step3. direct-edit

Direct-edit is "edit on narrow-editor then save to real-file" feature.
Available for following providers.

  • scan
  • search
  • atom-scan

⚠️ This operation is dangerous, since you can update multiple files at once. ⚠️ You have to be careful enough to use this feature, don't use this without understanding what you are doing. ⚠️ I can say sorry, but I can not recover file for you.

  1. Open file from project, place cursor for variable name hello
  2. Then invoke Narrow Search By Current Word.
  3. All hello matching items are shows up on narrow-editor.
  4. If you want, you can further narrow by query.
  5. Then edit narrow-editor's text directly.
  • Place cursor on hello. Then ctrl-cmd-g(find-and-replace:select-all), then type world.
  1. Invoke Narrow Ui: Update Real File from command-palette.
  2. DONE, changes you made on narrow-editor items are applied to real-file(and saved).
  3. You can undo changes by re-edit items on narrow-editor and reapply changes by Narrow Ui: Update Real File.

Step4. [Experimental] search keyword by mouse

  1. Set Search.startByDoubleClick to true from settings-view.
  2. Double click keyword in editor.
  3. Each time you double click keyword, new narrow-editor open and old one is replaced.
  4. You can continue double click which ever narrow-editor or normal-editor.

Commands

Available in all text-editor

Other
  • narrow:focus: ( ctrl-cmd-f ) Focus to narrow-editor, if executed in narrow-editor, it re-focus to original editor.
  • narrow:focus-prompt: ( ctrl-cmd-i ) Focus to narrow-editor's query input prompt, if executed in narrow-editor, it re-focus to original editor.
  • narrow:refresh: Manually refresh items in narrow-editor.
  • narrow:close: ( ctrl-g ) Close currently opened narrow-editor one at a time.
  • narrow:next-item: ( ctrl-cmd-n ) Move cursor to position of next-item.
  • narrow:previous-item: ( ctrl-cmd-p ) Move cursor to position of previous-item.
  • narrow:reopen: ( no default keymap ) Reopen closed narrow editor up to 10 recent closed.
  • narrow:query-current-word: ( ctrl-cmd-e ) Replace active narrow-editor's query with cursor word.
  • narrow:previous-query-history: ( ctrl-cmd-[ ) Replace active narrow-editor's query with previous history entry.
  • narrow:next-query-history: ( ctrl-cmd-] ) Replace active narrow-editor's query with next history entry.
Invoke narrow provide

No keymaps are provided

  • narrow:scan
  • narrow:scan-by-current-word
  • narrow:fold
  • narrow:fold-by-current-word
  • narrow:search: ag search. need install by your self.
  • narrow:search-by-current-word
  • narrow:search-current-project
  • narrow:search-current-project-by-current-word
  • narrow:atom-scan
  • narrow:atom-scan-by-current-word
  • narrow:symbols
  • narrow:symbols-by-current-word
  • narrow:project-symbols:
  • narrow:project-symbols-by-current-word:
  • narrow:git-diff-all

Available in narrow-editor(narrow-ui)

The !vmp followed by keymap means "which keymap is not available for vim-mode-plus user".
If you want use these keymap with vim-mode-plus, set it by yourself.
See Wiki

  • core:confirm: ( enter ) Close narrow-editor
  • narrow-ui:confirm-keep-open: keep open narrow-editor
  • narrow-ui:open-here: Open item at same pane of UI's pane.
  • narrow-ui:preview-item: Preview currently selected item manually( you don't need in most case ).
  • narrow-ui:preview-next-item: ( tab ) Preview next-item without moving cursor from narrow-editor's query prompt.
  • narrow-ui:preview-previous-item: ( shift-tab ) Preview next-item without moving cursor from narrow-editor's query prompt.
  • narrow-ui:toggle-auto-preview: ( ctrl-r for non-vim-mode-plus user) Disable/enable auto-preview for this narrow-editor.
  • narrow-ui:move-to-prompt: ctrl-cmd-i
  • narrow-ui:stop-insert: escape
  • narrow-ui:update-real-file: Apply changes made in narrow-editor to real-file.( edit in narrow-editor then save it to real file. )
  • narrow-ui:protect: No keymap by default, Protect narrow-editor from being destroyed by narrow:close( ctrl-g ).
  • narrow-ui:exclude-file: backspace, Exclude items which matches filePath of currently selected item's.
  • narrow-ui:clear-excluded-files: ctrl-backspace, Clear excluded files list.
  • narrow-ui:select-files: cmd-backspace, interactively select which filePath's items to appear on narrow-editor.
  • narrow-ui:toggle-search-whole-word: alt-cmd-w
  • narrow-ui:toggle-search-ignore-case: alt-cmd-c
  • narrow-ui:toggle-search-use-regex: alt-cmd-/
  • narrow-ui:start-insert: I(!vmp), a(!vmp)
  • narrow-ui:move-to-next-file-item: n(!vmp)
  • narrow-ui:move-to-previous-file-item: p(!vmp)
  • narrow-ui:relocate: No keymap by default, Switch location where ui opened between center workspace and bottom dock.

Keymaps

No keymap to invoke narrow provider(e.g narrow:scan).
Start it from command-palette or set keymap in keymap.cson.

⚠️ default keymap is not yet settled, this will likely to change in future version.

My keymap(vim-mode-plus user) and config

config.cson
  narrow:
    SelectFiles:
      rememberQuery: true
    confirmOnUpdateRealFile: false
keymap.cson

Explanation of my keymap.

  • cmd-f: To focus to narrow-editor AND focus-back to original-editor
  • cmd-i: To focus to narrow-editor's prompt AND focus-back to original-editor
  • cmd-e:
    • When workspace has no narrow-edior on workspace: start narrow:search-by-current-word.
    • When workspace has at least one narrow-edior: query-current-word( by default keymap).
      • Replace active narrow-edior's query with cursor-word.
  • cmd-[: narrow:previous-query-history Recall previous history
  • cmd-]: narrow:next-query-history, Recall next history
  • ctrl-g: Close narrow-editor from wherever.
  • tab, shift-tab: to move to next/previous item.
  • ;: confirm current-item without closing narrow-editor, I can close narrow-editor by ctrl-g.
# From outside of narrow-editor
# -------------------------

# `cmd-e` start `search-by-current-word` only when workspace does NOT have `narrow-editor`.
# NOTE: When workspace.has-narrow, `cmd-e` is mapped to `query-current-word` by default.
'atom-workspace:not(.has-narrow) atom-text-editor.vim-mode-plus:not(.insert-mode)':
  'cmd-e': 'narrow:search-by-current-word'

'atom-text-editor.vim-mode-plus:not(.insert-mode)':
  'ctrl-z':      'narrow:reopen'
  'space f':     'narrow:fold'
  'cmd-o':       'narrow:symbols-by-current-word'
  'cmd-shift-o': 'narrow:project-symbols-by-current-word'
  'cmd-r':       'narrow:symbols' # Override default cmd-r
  'cmd-shift-r': 'narrow:project-symbols' # Override default cmd-shift-r
  'space l':     'narrow:scan'
  'cmd-l':       'narrow:scan-by-current-word'
  'space s':     'narrow:search'
  'space G':     'narrow:git-diff-all'

# When workspace has narrow-editor
'atom-workspace.has-narrow atom-text-editor.vim-mode-plus.normal-mode':
  'cmd-f': 'narrow:focus' # focus to narrow-editor
  'cmd-i': 'narrow:focus-prompt' # focus to prompt of narrow-editor

  # Following three command have ctrl- prefixed by default to avoid conflicts.
  # But I don' care conflict, prefer more accessible keymap.
  'cmd-[': 'narrow:previous-query-history'
  'cmd-]': 'narrow:next-query-history'
  'cmd-e': 'narrow:query-current-word'

# narrow-editor regardless of mode of vim
'atom-text-editor.narrow.narrow-editor[data-grammar="source narrow"]':
  'cmd-f': 'narrow:focus'
  'cmd-i': 'narrow:focus-prompt' # cmd-i to return to calling editor.

  # Danger: apply change on narrow-editor to real file by `cmd-s`.
  'cmd-s': 'narrow-ui:update-real-file'

  # Move ui in between bottom dock and center workspace.
  'cmd-t': 'narrow-ui:relocate'

'atom-workspace.has-narrow atom-text-editor.vim-mode-plus.normal-mode,
  atom-workspace.has-narrow atom-text-editor.vim-mode-plus.visual-mode':
    'cmd-e': 'narrow:query-current-word' # set current word as query of active ui.

'atom-text-editor.narrow.narrow-editor.vim-mode-plus.normal-mode':
  'g g': 'narrow-ui:move-to-prompt'
  's': 'narrow-ui:select-files'
  ';': 'narrow-ui:confirm-keep-open'
  'n': 'narrow-ui:move-to-next-file-item'
  'p': 'narrow-ui:move-to-previous-file-item'

Recommended configuration for other packages.

  • Suppress autocomplete-plus's popup on narrow-editor
  • Disable vim-mode-plus's highlight-search on narrow-editor
"*":
  "autocomplete-plus":
    suppressActivationForEditorClasses: [
      # snip
      "narrow"
    ]
  # snip
  "vim-mode-plus":
    highlightSearchExcludeScopes: [
      "narrow"
    ]

Notes for vim-mode-plus user

⚠️ Limitation: for compatibility with vim-mode-plus.

  • If you use atom v1.16.0 or older,
    • Don't enable vim-mode-plus.automaticallyEscapeInsertModeOnActivePaneItemChange
    • If you enabled, each query input on narrow-editor of search provider cause mode-change from insert-mode to normal-mode.
  • If you use atom v1.17.0 or older( currently in beta ).
    • This limitation is no longer exists.

Keymap

Learn keymap available as default.
e.g. You can move to next or previous item by tab, shift-tab(for this to work, you need vim-mode-plus v0.81.0 or later).

Start narrow from vim-mode-plus's search-input-form

If you are vim-mode-plus user. Following command are available from vim-mode-plus's search(/ or ?) mini-editor.

  • vim-mode-plus-user:narrow:scan
  • vim-mode-plus-user:narrow:search
  • vim-mode-plus-user:narrow:search-current-project
  • vim-mode-plus-user:narrow:atom-scan

How to edit item-area for direct-edit.

  • In narrow-editor, i, a in normal-mode move cursor to prompt line.
  • So when you want to edit items itself for direct-edit and update-real-file use other key to enter insert-mode.
  • I is intentionally mapped to vim-mode-plus:activate-insert-mode which is normally mapped to i.
    • Which might not be intuitive, but I want make item mutatation bit difficult. So user have to type I.
  • Other than I, you can start insert-mode by A, c etc..

Q&A

What providers are you seriously using?

In daily editing, I use.

scan, search, git-diff-all, symbols.

Why I'm not using others? reason is here.

  • fold: Since it similar to symbols.
  • atom-scan: it is provided for windows user who can't use search(need ag or rg).

Noticed I can close narrow-editor by normal cmd-w(core:close). Why I need narrow:close? What's the difference?

The biggest difference is narrow:close restore editor state(scrollTop, fold, active pane item) if user did only preview from startup.

  • narrow:close: Close narrow-editor and restore editor state when it appropriate. Also can close narrow-editor regardless of current active-editor.
  • core:close: Just destroy narrow-editor.

Use whichever you want accordingly. I normally use narrow:close and occasionally use core:close such like when I want to focus next-pane-item of narrow-editor(so don't want to restore focus to narrow initiated editor).

How can I exclude particular file from narrow:search

Use backspace on item
  • Use backspace to exclude particular file from result.
  • ctrl-backspace clear excluded file list and refresh
  • These keymaps are available in narrow-editor and you are in read-only-mode
Use select-files provider
  • You can launch select-files by cmd-backspace or clicking folder-icon on control-bar.
  1. search editor by narrow:search, you see lots of editor mached items
  2. But you want exclude items in markdown file?
  • launch select-files, all file paths are listed as item.
  • Then type md on query, you see markdown filepath that macheed md.
  • Then add !, now your query is md!, this is treated as all files not matching md.
  • enter to confirm.
  1. You see items with items in markdown files are excluded.
  2. You can re-fine files to exclude by re-launching select-files.
  • e.g. To exclude spec folder, you can add spec/! as query.
  • e.g. To include .js file only, you can set query to .js.

Want to skip to next-file, previous-file

  • Use n, p in read-only mode.

I want narrow:symbols always shows up at right-most pane and don't want to close.

  1. Open narrow:symbols( or maybe you want to use narrow:fold )
  2. Move this narrow-editor by drag and drop to the place where you want.
  3. From command-palette, execute Narrow Ui: Protect. Now narrow-editor protected.
  4. Protected narrow-editor is not closed by ctrl-g( narrow:close ), and not closed by confirm by enter.
  5. To close, use normal cmd-w or close button on tab.

atom-narrow's People

Contributors

gitter-badger avatar heftyfunseeker avatar jonboiser avatar slavaganzin avatar t9md avatar thancock20 avatar y-takey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

atom-narrow's Issues

[all provider] filter item by level

I added narrow-ui:fold:increase-fold-level, narrow-ui:fold:decrease-fold-level in #24.

But this concept should not necessarily limited to fold.
For narrow:line, each line have indent level.
For markdown text, number of preceding # can be considered as level.

So I'm thinking about cmd-], cmd-[ to map on narrow:ui to

  • cmd-[: narrow-ui:decrewase-level to show less items
  • cmd-]: narrow-ui:increase-level to show more items

Each provider can control what the level means on each provider by overriding getLevelForItem.
By default(without overriding), getLevelForItem should be determined by indent level of that row.

getLevelForItem: (item) ->
  row = point.row
  @editor.indentationForBufferRow(row)

Items are filtered by using that level number

Not sure if it's really useful, will see after evaluating!

hit escape to close narrow editor

caught myself reaching for escape a couple times to close the narrow editor, so this would be lovely:

'atom-text-editor.narrow[data-grammar="source narrow"]':
  'escape': 'core:close'

helm-swoop style search

Hi - just trying out your alpha version. This is something I would love to have, thanks for your work !

This is what you are trying to do, right ? https://github.com/ShingoFukuyama/helm-swoop
That would be awesome.

Narrow: Search and then j/k ... then Narrow UI: Reveal Item kind of works to get something like helm-swoop.

I tried it with auto-reveal. It would be nice if it selects the line too.

I don't want to file a specific bug because I'm sure you know what to work on next.

Just offering encouragement !

Looking forward to updates !

[bug] underline highlight remains after narrow-ui closed

Problem

I sometimes hit this bad situation, as far as I can say, it's when I use search provider and work around narrow-items on narrow-ui with autoPreview on.
So open multiple files for previewing, then some of opened editor have remained highlight.

Expected behavior

Must destroy hl decoration without any exception

Show rows at gutter instead of as-editor's normal-text.

  • Pros

    • Easier to correspond narrowEditor's text to underlying editor's text.
    • When introduce inline-edit feature(Update bounded-editor's text by editing narrowEditor.)
  • Cons

    • When copying, no longer copy rows(possibly, sometimes useful to share row info to other person).

think about default keymap

Currently feature/behavior is VERY fluctuating so current default keymap is not settled yet.

See also "Use case and flow of keystrokes" #75

Will put idea and WANT/DONT_WANT list on this issue to discuss about reasonable default-keymap.

  • #48 to map escape to close narrow-editor

Uncaught TypeError

  1. Do Narrow:fold on a file
  2. Select, closing narrow window
  3. Do other things
  4. Go back to the same pane that was narrowed
  5. Save
  6. This error thrown each time

Even if you shut the file and repoen it, the memory still has the narrow view cached.

ありがとうございました !

Atom Version: 1.7.3
System: Mac OS X 10.11.2
Thrown From: narrow package, v0.5.2

Stack Trace

Uncaught TypeError: Cannot read property 'getLastBufferRow' of undefined

At /Users/crucial/.atom/packages/narrow/lib/provider/fold.coffee:6

TypeError: Cannot read property 'getLastBufferRow' of undefined
    at /Users/crucial/.atom/packages/narrow/lib/provider/fold.coffee:6:10
    at getCodeFoldStartRowsAtIndentLevel (/Users/crucial/.atom/packages/narrow/lib/provider/fold.coffee:6:10)
    at Fold.module.exports.Fold.getItems (/Users/crucial/.atom/packages/narrow/lib/provider/fold.coffee:35:17)
    at UI.module.exports.UI.getItems (/Users/crucial/.atom/packages/narrow/lib/ui.coffee:55:31)
    at UI.module.exports.UI.refresh (/Users/crucial/.atom/packages/narrow/lib/ui.coffee:79:6)
    at /Users/crucial/.atom/packages/narrow/lib/provider/fold.coffee:23:11
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1378:25

Commands

     -0:25.9.0 docblockr:parse-enter (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:25.8.0 editor:newline (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:25.6.0 core:paste (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:24.1.0 core:backspace (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
  3x -0:21.6.0 blur (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:08.1.0 markdown-writer:insert-new-line (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:08.1.0 docblockr:parse-enter (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:08.1.0 editor:newline (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:07.9.0 markdown-writer:indent-list-line (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:07.9.0 snippets:next-tab-stop (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:07.9.0 snippets:expand (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:07.9.0 docblockr:parse-tab (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:07.9.0 editor:indent (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:03.0 editor:move-to-first-character-of-line (atom-text-editor.editor.vim-mode.insert-mode.is-focused.autocomplete-active)
     -0:02.5.0 core:backspace (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:02.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.vim-mode.insert-mode.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "cute-cursor",
      "language-go",
      "language-java",
      "term",
      "language-supercollider",
      "linter-rst",
      "rst-preview",
      "rst-preview",
      "ide-haskell",
      "remote-edit",
      "atomatigit",
      "minimap-highlight-selected",
      "atomic-emacs",
      "autoflow",
      "autosave",
      "background-tips",
      "easy-motion",
      "gist-it",
      "git-blame",
      "git-difftool",
      "term2",
      "web-view",
      "atom-terminal",
      "css-color-highlighting",
      "editor-stats",
      "selection-count",
      "fancy-new-file",
      "minimap-find-and-replace",
      "mobile-preview",
      "my-package",
      "org",
      "paredit",
      "autocomplete",
      "atom-color-highlight",
      "autocomplete-jedi",
      "bezier-curve-editor",
      "coffee-lint",
      "python-jedi",
      "next-occurrence",
      "linter-scss-lint",
      "linter-coffeelint",
      "grunt-runner",
      "typewriter-sounds",
      "ide-flow",
      "autocomplete-paths",
      "language-jsx",
      "atom-pair",
      "atom-runner",
      "auto-copyright",
      "cparts",
      "dash",
      "git-log",
      "jupyter-notebook",
      "language-ejs",
      "node-debugger",
      "processing",
      "zentabs",
      "language-ruby-on-rails",
      "linter-cpplint",
      "tree-view",
      "angularjs",
      "glist",
      "javascript-snippets",
      "language-docker",
      "language-swift",
      "linter-jsxhint",
      "markdown-pdf",
      "theme-switch",
      "todo-show",
      "typewriter",
      "language-javascript-jsx",
      "linter-jshint",
      "atom-ternjs",
      "symbols-view",
      "symbols-tree-view",
      "atom-lupa",
      "symbol-gen",
      "language-gfm"
    ],
    "followSymlinks": true,
    "ignoredNames": [
      "*.pyc",
      ".DS_Store",
      "tags"
    ],
    "packagesWithKeymapsDisabled": [
      "emmet"
    ],
    "themes": [
      "one-dark-ui",
      "fizzy"
    ]
  }
}

Installed Packages

# User
atom-beautify, v0.29.7
atom-commander, v0.7.0
atom-ctags, v4.5.2
atom-django, v0.3.2
autoclose-html, v0.23.0
autocomplete-python, v1.7.3
clipboard-plus, v0.5.1
color-picker, v2.1.1
cursor-history, v0.5.9
devdocs, v0.2.1
django-templates, v0.5.0
docblockr, v0.7.3
editorconfig, v1.4.1
emmet, v2.4.3
filesize, v0.4.2
fizzy, v0.16.0
fold-navigator, v0.0.512
html-entities, v0.4.0
imdone-atom, v1.3.29
jade-snippets, v0.5.0
language-clojure, v0.20.0
language-cmake, v0.1.4
language-crontab, v0.2.1
language-ini, v1.16.0
language-jade, v0.7.1
language-markdown, v0.13.0
language-matlab, v0.2.1
language-nginx, v0.6.1
language-restructuredtext, v0.13.0
linter, v1.11.4
linter-csslint, v1.3.2
linter-eslint, v7.2.2
linter-htmlhint, v1.1.4
linter-jade, v0.3.2
linter-jscs, v4.0.1
linter-pylama, v0.2.9
markdown-writer, v2.3.3
minimap, v4.23.5
narrow, v0.5.2
pain-split, v1.4.0
pdf-view, v0.50.0
pigments, v0.26.3
processing-language, v0.2.0
project-manager, v2.9.7
python-autopep8, v0.1.3
react, v0.15.0
regex-railroad-diagram, v0.16.0
set-syntax, v0.3.0
tab-control, v0.6.9
tabs-to-spaces, v1.0.2
tree-view-git-status, v0.2.3
vim-mode, v0.65.1
vim-mode-clipboard-plus, v0.2.0
vim-surround, v0.8.1

# Dev
No dev packages

Provide better safety after accidental cmd-a + delete

Again. great plugin! =)

I have the habit of accidentally using cmd-a + delete rather than cmd-delete. The former accidentally clears the narrow pane's content and goes into a weird state. I think I override this behavior myself but I was wondering if it's worth making narrow a bit safer regarding arbitrary modifications?

Or, better idea: editing narrow's buffer, and make the change reflect in the original editor! No need to jump to place, modify, then jump back! =D

"observeVimStates is not a function" error when starting up Atom

So like the title says, I get the observeVimStates is not a function error whenever I startup Atom. I thought it was a problem with vmp but noticed that the error only happens if I have narrow installed.

Here's the stack trace and related info copied from Atom:


Atom Version: 1.6.2
System: "Arch Linux"
Thrown From: vim-mode-plus package, v0.32.1

Stack Trace

Failed to activate the vim-mode-plus package

At observeVimStates is not a function

TypeError: observeVimStates is not a function
    at Object.module.exports.consumeVim (/home/jeremy/.atom/packages/narrow/lib/main.coffee:72:16)
    at Provider.module.exports.Provider.provide (/usr/share/atom/resources/app.asar/node_modules/service-hub/lib/provider.js:30:52)
    at ServiceHub.module.exports.ServiceHub.provide (/usr/share/atom/resources/app.asar/node_modules/service-hub/lib/service-hub.js:30:20)
    at Package.module.exports.Package.activateServices (/usr/share/atom/resources/app.asar/src/package.js:350:71)
    at Package.module.exports.Package.activateNow (/usr/share/atom/resources/app.asar/src/package.js:184:16)
    at /usr/share/atom/resources/app.asar/src/package.js:155:32
    at Package.module.exports.Package.measure (/usr/share/atom/resources/app.asar/src/package.js:92:15)
    at /usr/share/atom/resources/app.asar/src/package.js:148:26
    at Package.module.exports.Package.activate (/usr/share/atom/resources/app.asar/src/package.js:145:34)
    at PackageManager.module.exports.PackageManager.activatePackage (/usr/share/atom/resources/app.asar/src/package-manager.js:526:21)
    at /usr/share/atom/resources/app.asar/src/package-manager.js:507:29
    at Config.module.exports.Config.transactAsync (/usr/share/atom/resources/app.asar/src/config.js:337:18)
    at PackageManager.module.exports.PackageManager.activatePackages (/usr/share/atom/resources/app.asar/src/package-manager.js:502:19)
    at PackageManager.module.exports.PackageManager.activate (/usr/share/atom/resources/app.asar/src/package-manager.js:485:46)
    at AtomEnvironment.module.exports.AtomEnvironment.startEditorWindow (/usr/share/atom/resources/app.asar/src/atom-environment.js:688:21)
    at module.exports (/usr/share/atom/resources/app.asar/src/initialize-application-window.js:28:10)
    at setupWindow (file:///usr/share/atom/resources/app.asar/static/index.js:86:5)
    at window.onload (file:///usr/share/atom/resources/app.asar/static/index.js:41:9)

Config

{
  "core": {
    "autoHideMenuBar": true,
    "customFileTypes": {
      "source.ini": [
        ".buckconfig",
        ".flowconfig"
      ],
      "source.json": [
        ".arcconfig",
        "BUCK.autodeps"
      ],
      "source.python": [
        "BUCK"
      ]
    },
    "disabledPackages": [
      "tree-view"
    ],
    "projectHome": "/home/jeremy/Devel",
    "themes": [
      "atom-material-ui",
      "atom-material-syntax"
    ]
  },
  "vim-mode-plus": {}
}

Installed Packages

# User
Sublime-Style-Column-Selection, v1.5.1
atom-django, v0.3.2
atom-jade, v0.3.0
atom-material-syntax, v0.4.6
atom-material-ui, v1.2.13
auto-detect-indentation, v1.1.0
autocomplete-cmake, v0.3.1
autocomplete-emojis, v2.5.0
autocomplete-html-entities, v0.1.0
clip-history, v0.2.1
color-picker, v2.2.2
cursor-history, v0.5.9
docblockr, v0.7.3
editorconfig, v1.4.1
file-icons, v1.7.16
haskell-grammar, v0.4.0
highlight-line, v0.11.1
highlight-selected, v0.11.2
language-babel, v2.31.0
language-bazel, v0.3.1
language-cmake, v0.2.0
language-docker, v1.1.6
language-fish-shell, v1.0.4
language-groovy, v0.6.0
language-ini, v1.16.0
language-kotlin, v0.4.0
language-latex, v0.6.1
language-lua, v0.9.4
language-mips, v0.2.0
language-ocaml, v1.1.2
language-swift, v0.4.0
language-thrift, v1.0.2
latexer, v0.3.0
linter, v1.11.14
linter-chktex, v1.3.0
linter-csslint, v1.3.2
linter-docker, v0.1.2
linter-eslint, v7.2.3
linter-flake8, v1.13.2
linter-gcc, v0.6.14
linter-jade, v0.3.2
linter-javac, v1.9.4
linter-jsonlint, v1.3.0
linter-kotlin, v0.1.0
linter-lua, v1.0.2
linter-markdown, v1.5.2
linter-shellcheck, v1.2.0
linter-swiftc, v2.0.0
merge-conflicts, v1.4.4
minimap, v4.24.7
minimap-cursorline, v0.2.0
minimap-find-and-replace, v4.5.1
minimap-highlight-selected, v4.4.0
minimap-linter, v1.1.1
narrow, v0.5.2
nuclide, v0.136.0
pdf-view, v0.50.0
pigments, v0.31.1
quick-highlight, v0.5.0
release-notes, v0.53.0
sync-settings, v0.7.2
tool-bar, v1.0.0
trailing-spaces, v0.3.2
vim-mode-plus, v0.32.1
vim-mode-plus-move-selected-text, v0.6.0
vim-mode-plus-move-to-symbols, v0.1.5
vim-mode-plus-replace-with-execution, v0.1.2
vim-mode-plus-subword-movement, v0.2.2

# Dev
No dev packages

Uncaught Error: Pane has been destroyed

[Enter steps to reproduce below:]

  1. Narrow search, opens a narrow pane
  2. Narrow search, opened another narrow pane
  3. Close them one by one
  4. last one closed throws this error

Atom Version: 1.7.3
System: Mac OS X 10.11.2
Thrown From: narrow package, v0.1.1

Stack Trace

Uncaught Error: Pane has been destroyed

At /Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:804

Error: Pane has been destroyed
    at Pane.module.exports.Pane.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:804:15)
    at /Users/crucial/.atom/packages/narrow/lib/narrow.coffee:24:21
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at TextEditor.module.exports.TextEditor.destroyed (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:295:27)
    at TextEditor.module.exports.Model.destroy (/Applications/Atom.app/Contents/Resources/app.asar/src/model.js:31:58)
    at Pane.module.exports.Pane.destroyItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:639:18)
    at Pane.module.exports.Pane.destroyActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:617:12)
    at Workspace.module.exports.Workspace.destroyActivePaneItem (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:692:35)
    at Workspace.module.exports.Workspace.closeActivePaneItemOrEmptyPaneOrWindow (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:731:21)
    at atom-workspace.commandRegistry.add.core:close (/Applications/Atom.app/Contents/Resources/app.asar/src/register-default-commands.js:211:32)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:98:36)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

Commands

     -0:21.6.0 command-palette:toggle (atom-text-editor.editor.narrow.vim-mode.normal-mode.is-focused)
     -0:21.3.0 blur (atom-text-editor.editor.narrow.vim-mode.normal-mode.is-focused)
     -0:18.7.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:18.7.0 blur (atom-text-editor.editor.mini.is-focused)
     -0:18.7.0 narrow:search (atom-text-editor.editor.narrow.vim-mode.normal-mode)
     -0:18.7.0 blur (atom-text-editor.editor.narrow.vim-mode.normal-mode)
     -0:14.5.0 core:confirm (atom-text-editor.narrow-search-input.editor.mini.is-focused)
  4x -0:14.5.0 blur (atom-text-editor.narrow-search-input.editor.mini.is-focused)
  7x -0:11.7.0 core:move-down (atom-text-editor.editor.narrow.vim-mode.normal-mode.is-focused)
  3x -0:05.3.0 blur (atom-text-editor.editor.narrow.vim-mode.normal-mode.is-focused)
     -0:04.5.0 core:close (atom-text-editor.editor.narrow.vim-mode.normal-mode.is-focused)
  6x -0:04.5.0 blur (atom-text-editor.editor.narrow.vim-mode.normal-mode.is-focused)
     -0:03.6.0 core:close (atom-text-editor.editor.narrow.vim-mode.normal-mode.is-focused)
  5x -0:03.6.0 blur (atom-text-editor.editor.narrow.vim-mode.normal-mode.is-focused)
     -0:02.7.0 core:close (atom-text-editor.editor.narrow.vim-mode.normal-mode.is-focused)
     -0:02.7.0 blur (atom-text-editor.editor.narrow.vim-mode.normal-mode.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "cute-cursor",
      "language-go",
      "language-java",
      "term",
      "language-supercollider",
      "linter-rst",
      "rst-preview",
      "rst-preview",
      "ide-haskell",
      "remote-edit",
      "atomatigit",
      "minimap-highlight-selected",
      "atomic-emacs",
      "autoflow",
      "autosave",
      "background-tips",
      "easy-motion",
      "gist-it",
      "git-blame",
      "git-difftool",
      "term2",
      "web-view",
      "atom-terminal",
      "css-color-highlighting",
      "editor-stats",
      "selection-count",
      "fancy-new-file",
      "minimap-find-and-replace",
      "mobile-preview",
      "my-package",
      "org",
      "paredit",
      "autocomplete",
      "atom-color-highlight",
      "autocomplete-jedi",
      "bezier-curve-editor",
      "coffee-lint",
      "python-jedi",
      "next-occurrence",
      "linter-scss-lint",
      "linter-coffeelint",
      "grunt-runner",
      "typewriter-sounds",
      "ide-flow",
      "autocomplete-paths",
      "language-jsx",
      "atom-pair",
      "atom-runner",
      "auto-copyright",
      "cparts",
      "dash",
      "git-log",
      "jupyter-notebook",
      "language-ejs",
      "minimap",
      "node-debugger",
      "processing",
      "zentabs",
      "language-ruby-on-rails",
      "linter-cpplint",
      "tree-view",
      "angularjs",
      "glist",
      "javascript-snippets",
      "language-docker",
      "language-swift",
      "linter-jsxhint",
      "markdown-pdf",
      "react",
      "theme-switch",
      "todo-show",
      "typewriter",
      "language-javascript-jsx",
      "linter-jshint",
      "atom-ternjs",
      "symbols-view",
      "symbols-tree-view",
      "atom-lupa",
      "symbol-gen"
    ],
    "followSymlinks": true,
    "ignoredNames": [
      "*.pyc",
      ".DS_Store",
      "tags"
    ],
    "packagesWithKeymapsDisabled": [
      "emmet"
    ],
    "themes": [
      "one-light-ui",
      "solarized-dark-syntax"
    ]
  }
}

Installed Packages

# User
atom-commander, v0.7.0
atom-ctags, v4.5.2
atom-django, v0.3.2
autoclose-html, v0.23.0
autocomplete-python, v1.7.2
color-picker, v2.1.1
cursor-history, v0.5.9
devdocs, v0.2.1
django-templates, v0.5.0
docblockr, v0.7.3
editorconfig, v1.4.1
emmet, v2.4.3
es6-javascript, v0.7.0
filesize, v0.4.2
html-entities, v0.4.0
imdone-atom, v1.3.29
jade-snippets, v0.5.0
language-clojure, v0.20.0
language-cmake, v0.1.4
language-crontab, v0.2.1
language-ini, v1.16.0
language-jade, v0.7.1
language-matlab, v0.2.1
language-nginx, v0.6.1
language-restructuredtext, v0.13.0
linter, v1.11.4
linter-csslint, v1.3.2
linter-eslint, v7.2.2
linter-htmlhint, v1.1.4
linter-jade, v0.3.2
linter-jscs, v4.0.0
linter-pylama, v0.2.9
narrow, v0.1.1
pain-split, v1.4.0
pdf-view, v0.50.0
pigments, v0.26.2
postcss-sorting, v2.3.0
processing-language, v0.2.0
project-manager, v2.9.7
python-autopep8, v0.1.3
regex-railroad-diagram, v0.16.0
set-syntax, v0.3.0
tab-control, v0.6.9
tabs-to-spaces, v1.0.2
tree-view-git-status, v0.2.3
vim-mode, v0.65.0

# Dev
No dev packages

use scandal instead of ag

Currently narrow:search depending on ag external commands.
Evaluate if I can use scandal for as replacement.

Benefit

  • No dependency of external binary commands(maybe good for less not-working issue in windows?). #9
  • No special translation is required for regex in Js and regex for ag.
    • This make easier to support more narrow query varieties
      • Regex search
      • Regex escape search
      • Ignore case/word boundary search
      • Custom sugared query like !abc to reject abc item.

[all providers] move cursor on narrow buffer without focusing narrow buffer

e.g. ctrl-cmd-n move-down on narrow-buffer, ctrl-cmd-p move-up on narrow-buffer

Situation.

  1. I edited text-object.coffee, which file include multiple classes, each class have select: -> method.
  2. I wanted to add some code at last line of select() body.
  3. So invoke fold, then input select:, which shows only select: -> lines, these are the target I'll editing from now
  4. So I go to first select: then enter insert-mode and edit
  5. WAIT! I want to keep editing, don't want to change focus to narrow, but dont want to consult native cmd-f(find-and-replace) or cmd-r(symbols-view), just want to use narrow to move my cursor to next select body.

[BIG and might fail] support direct-edit

I'm not sure if it really useful or I can implement it in very intuitive way.
So let's try and evaluate it.

What's inline-edit?

  • User can directly edit narrowEditor.
  • When saved it reflect changes to corresponding buffer disk.
  • e.g. narrow:search then editor narrowEditor directly, save it, DONE.
  • Support delete whole line.

This enhancement require BIG change. So need to move forward step-by-step.

  • Show line number on gutter
    • By this enahancement I can easily map text on narrowEditor to line on actual-buffer without translation
    • If line numbers are exist, I need to trim that part to correspond to line on actual-buffer.
  • Show file header on block decoration
    • This is same reason. To make file header free from mutation.
    • I once evaluated and worked, but removed in favor of intuitiveness.
  • Why above steps is required? Because I don't want to open another editor to start inline-edit.
  • Separate query-input-area from items listing editor?
    • To support more rich indicator for case-sensitivity, regex/regex-escaped status etc..

After re-thinking, I'll take shortest-path, thus introduce direct-edit WITHOUT introducing big change to current narrowEditor.

  • Just refrect change in narrowEditor by translating line by triming row:column part.

Uncaught TypeError: Cannot read property 'setScrollTop' of null /usr/share/atom-beta/resources/app.asar/src/text-editor-element.js:335

Just hit enter in narrow pane

Hide Stack Trace
TypeError: Cannot read property 'setScrollTop' of null
at atom-text-editor.TextEditorElement.setScrollTop (/usr/share/atom-beta/resources/app.asar/src/text-editor-element.js:335:28)
at Search.restoreEditorState (/home/alexeynabrodov/.atom/packages/narrow/lib/utils.coffee:82:19)
at Search.module.exports.Base.destroy (/home/alexeynabrodov/.atom/packages/narrow/lib/provider/base.coffee:63:6)
at UI.module.exports.UI.destroy (/home/alexeynabrodov/.atom/packages/narrow/lib/ui.coffee:37:16)
at /home/alexeynabrodov/.atom/packages/narrow/lib/ui.coffee:26:36
at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom-beta/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/usr/share/atom-beta/resources/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
at TextEditor.module.exports.TextEditor.destroyed (/usr/share/atom-beta/resources/app.asar/src/text-editor.js:550:20)
at TextEditor.module.exports.Model.destroy (/usr/share/atom-beta/resources/app.asar/src/model.js:31:58)
at UI.module.exports.UI.confirm (/home/alexeynabrodov/.atom/packages/narrow/lib/ui.coffee:149:21)
at atom-text-editor.atom.commands.add.core:confirm (/home/alexeynabrodov/.atom/packages/narrow/lib/ui.coffee:42:27)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom-beta/resources/app.asar/src/command-registry.js:259:29)
at /usr/share/atom-beta/resources/app.asar/src/command-registry.js:3:59
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom-beta/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom-beta/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:390:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom-beta/resources/app.asar/src/window-event-handler.js:106:36)
at HTMLDocument. (/usr/share/atom-beta/resources/app.asar/src/window-event-handler.js:3:59)

config option for narrow query's case sensitivity

caseSensitivityForNarrowQuery config options

possible values are

  • smartcase( default )
  • sensitive
  • insensitive

Spec

  • Providers global(not per provider value at this point).
  • User can chain multiple query by separating query by white-space.
    • So, in smartcase, case sensitivity is handled by per word(separated by white-space)
    • Eg. For query "word Case", first word is ignoreCase, 2nd Case is NOT ignoreCase.

Improve direct-edit to allow 2nd edit.

After success of 1st single edit of direct-edit, re-editing then update-real-file do nothing.
Investigate and fix it.
Maybe because of listed item's state(text field) not reflecting update done by direct-edit.

error with narrow:lines

on atom 1.11.1

I do a "narrow:lines" it shows the candidates, I scroll to the one I want and hit ENTER, and this error pops up:

TypeError: Cannot read property 'dispose' of undefined
    at /usr/share/atom/resources/app.asar/node_modules/event-kit/lib/composite-disposable.js:25:28
    at Set.forEach (native)
    at CompositeDisposable.module.exports.CompositeDisposable.dispose (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/composite-disposable.js:24:26)
    at /usr/share/atom/resources/app.asar/src/workspace.js:267:36
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at TextEditor.module.exports.TextEditor.destroyed (/usr/share/atom/resources/app.asar/src/text-editor.js:529:27)
    at TextEditor.module.exports.Model.destroy (/usr/share/atom/resources/app.asar/src/model.js:31:58)
    at UI.module.exports.UI.confirm (/home/joe/.atom/packages/narrow/lib/ui.coffee:160:15)
    at atom-text-editor.atom.commands.add.core:confirm (/home/joe/.atom/packages/narrow/lib/ui.coffee:44:27)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:260:29)
    at /usr/share/atom/resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom/resources/app.asar/src/window-event-handler.js:114:36)
    at HTMLDocument.<anonymous> (/usr/share/atom/resources/app.asar/src/window-event-handler.js:3:61)

Setting to have narrow "toggle auto preview" on by default

I haven't found a case where I'd like auto preview to be off by default, actually. So I usually do narrow:search-current-project then toggle on auto preview myself.

The one case I can think of is when the file is too huge and you wouldn't want the toggle to be on; that's been rare for me though.

Deprecated selector in `narrow/styles/main.less`

In narrow/styles/main.less:

Starting from Atom v1.13.0, the contents of atom-text-editor elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host and ::shadow pseudo-selectors, and prepend all your syntax selectors with syntax--. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors:

  • atom-text-editor::shadow .narrow-ui-row => atom-text-editor.editor .narrow-ui-row

  • atom-text-editor .narrow-match .region, atom-text-editor::shadow .narrow-match .region => atom-text-editor .narrow-match .region, atom-text-editor.editor .narrow-match .region

  • atom-text-editor .narrow-flash .region, atom-text-editor::shadow .narrow-flash .region => atom-text-editor .narrow-flash .region, atom-text-editor.editor .narrow-flash .region

  • atom-text-editor .narrow-result .region, atom-text-editor::shadow .narrow-result .region => atom-text-editor .narrow-result .region, atom-text-editor.editor .narrow-result .region

  • atom-text-editor .line.narrow-result, atom-text-editor::shadow .line.narrow-result => atom-text-editor .line.narrow-result, atom-text-editor.editor .line.narrow-result

Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.

Use narrow editor(instead of current mini-input-form) to read search-term on search/atom-scan

Currently, atom-scan and search provider use mini input form to read user-input.
Which input is passed to ag or atom.workspace.scan.

But Is it necessary?
Let's evaluate use narrowEditor for this purpose.

What will change.

  • narrowEditor(ui)'s first query keyword is treated as search-term(passed to ag)
  • Benefit is: Whenever user re-search in different keyword, user can directly edit it.
  • narrowEditor will be opened BEFORE user specifying search-term.
    • Good for internal code consistency.
    • Good for easily restorable full-state of narrow-editor.

[help!] Narrow Search returns nothing and `ag` hangs

After I start a narrow-search or narrow-search-current-project, a empty pane named search is opened, then nothing. Check the system, the ag process is there and never exit itself. Do you have any suggestion to debug this issue? Thanks.

make ui::setItem async

show ui first and then incrementally add items onData arrives
This was original behavior I first implemented, but removed for simplify overhaul make easier

Discovered a great feature: recursive narrow

Not a bug report, just a comment/Idea.

I've run narrow: line on an existing narrow buffer. Works as intended =D. There's some potential here!

The use-case was to narrow down on foo and see if there's any bar on the same line. I search for foo first then open narrow: line on the narrow buffer to search for bar, then jump and jump back to the original code).

Maybe there can be first-class support of this, or maybe it doesn't need one for now.

Also, it'd be great to see the context around a line, e.g. some shortcut to expand around the line (and heck, edit in-place!)

[META] future of narrow

I was untouched after initial intensive development of this package.
Now I'll begin to use this package and want to re-think how I can improve this package.

Here is the recap of history and also planning features.

Terms & Roles

  • narrow-editor: The text-editor where you see candidates and narrow down by input.
  • candidates: Items shown on narrow-editor.
  • actions: Action to be taken when you enter. As like helm is doing, tab to select alternate action? (not implemented yet)
  • provider: Provide candidate via getCandidate(), and take action via confirm().
  • narrow-ui: Provide basic navigation on narrow-editor, > indicator, narrow-input area at top of narrow-editor, all handled by narrow-ui.

Things to consider

  • vim-mode-plus integration: As a maintainer and heavy user of vim-mode-plus, I always prioritize better integration with vim-mode-plus.

What I'm thinking or design decision

CAUTION: Atom already have command-palette.

I should always ask to myself that "Is that important? I really need this? Can't I use regular command-palette for that?"

FINISHED: narrow-editor has to be normal text-editor

I once tried block-decoration to show the matched file names but removed this feature.

231f733

Part of it was good, but blending non-text-editor block into regular text-editor tend to confuse user and could not stand the issue which prevent me to use normal-text-editor keybinding.

IDEA: Keep it stupidly simple

anything.el, helm.el, unite.vim was(is) big.
Rather than trying to match(or beat) it, I want make narrow stupidly simple than these counter part.

I don't want to maintain big code base which is complicated because of huge feature base.
I have no resources or skill to maintain such a big ones.
Want to make it easy to create provider.
When I'm not sure, let provider do everything, duplication of codes in each provider is not bad when compared to trying to do everything by core side and limit what provider can do.

IDEA: Extensibility

As like autocomplete-plus accept provider package which provide candidates to complete for specific language.
I want narrow accept 3rd party package which provides narrow candidate and also allow provider decide what-to-do when candidate confirmed.

Thus allow broad user to create narrow-xxx packages as separate package.
There is bunch of examples for emacs-helm, vim-ctrlP and vim-unite(or denite as successor).

Here is example packages I can imagine quickly.

  • narrow:outline: Improved version of narrow:fold, show header for markdown buffer.
  • narrow:shell-command: Execute shell command background or send command to tmux's window? not sure..
  • narrow:symbols: To collect candidate, use atom's syntax symbol. Variables, module import, function are displayed ordered.
  • narrow:book-marks: Just use atom's bookmarks.
  • narrow:projects: Add/remove project from specified directory? Simiplar to my atom-project package.
  • narrow:git-grep: Kind of narrow:search, use git grep to collect candidate.
  • narrow:recent-files: Open recently opened files.
  • narrow:themes: Change theme quickly.
  • narrow:diff: List the diff lines on buffer, across-buffer.

I don't want make all of these by myself(??), but I want to create easy-to-use interface and easy-to-understand fundamental for those packages.

Must to read

Rubichichi's introduction for helm: He is one of main anything.el and helm.el maintainer.
Unite.vim's help: Especially for how-to-create-unite plugins, I have created some of it in the past :)

more expressiveness of narrow query

For more powerful way to narrow items on the list.
This is for how query keyword is treated in narrowEditor.

  • Settled: Keyword is separated by #white-space.
    • Type of query(regex/simple-keyword) has to be treated per query-word.
  • Settled: simple-keyword: Internally filtered by _.escapeRegExp
    • When no special prefix is used as query.
    • Case sensitivity(sensitive/insensitive/smartcase) is handled per query-word.
    • What if I want to search space itself or space contained keyword as simple-keyword?
      • No I can't, but maybe it's OK. Use regex \s.
    • Wild card helper support?
      • When I want to search keyword starting pre- keyword.
      • I can use * as wildcard.
      • e.g. pre-* matches pre-a, pre-abc etc..
      • e.g. pre-*llo*suffix matches pre-hello-worldsuffix etc.
      • Single * matches non-whitespace char(>1 length). abc*e not matches abe.
      • What if I want to search * itself? Doesn't * helper disturbing?
        • Double **.
  • Idea: negate-simple-keyword
  • Idea: regex: by prefixing query with /, e.g. /abc\w+
    • When I want to search / char as simple-keyword, doubling /
      • So searching /etc/hosts as simple-keyword would be //etc/hosts(yes second / is not necessary).
  • Idea: negate-regex: by prefixing query with !/. e.g. !/abc\w+
    • When I want to search !/ char as simple-keyword, doubling //
      • So searching !/etc/hosts as simple-keyword would be !//etc/hosts(yes second / is not necessary).
  • Idea: Provide short cut to replace type of keywods?
    • narrow-ui:toggle-negate-query add/remove ! prefix of current-word.
    • narrow-ui:toggle-regex-query add/remove / prefix of current-word.
  • Idea: Syntax highlight(by grammar) to help understand meta char or regex/not-regex status by eye.
    • e.g. Single * is highlighted, but ** is not highlighted.

Narrow:* error for direction: here

v0.6.0

Direction: here
Default settings

Repro:

  • use narrow
  • hit down key

Error:

Uncaught TypeError: Cannot read property 'activate' of undefined
/Users/chenglou/.atom/packages/narrow/lib/ui.coffee:19

Respect current cursor position on open/focus to narrowEditor

  • When narrow provider is associated to single text-editor(e.g. lines, folds, symbols).
  • When these provider was opened(or focused) respect current cursor position of that text-editor.
  • Also automatically update current selection indicator (green > on gutter) also help UX especially for narrow:fold.

Uncaught TypeError: onDidAddVimState is not a function

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.7.3
System: Mac OS X 10.11.5
Thrown From: narrow package, v0.4.0

Stack Trace

Uncaught TypeError: onDidAddVimState is not a function

At /Users/bmartin/.atom/packages/narrow/lib/main.coffee:58

TypeError: onDidAddVimState is not a function
    at Object.module.exports.consumeVim (/Users/bmartin/.atom/packages/narrow/lib/main.coffee:58:16)
    at Provider.module.exports.Provider.provide (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/service-hub/lib/provider.js:30:52)
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/service-hub/lib/service-hub.js:55:26
    at doNTCallback0 (node.js:443:9)
    at process._tickCallback (node.js:372:13)

Commands

Config

{
  "core": {
    "disabledPackages": [
      "tabs",
      "atomatigit",
      "terminal-plus",
      "vim-mode",
      "vim-surround",
      "ex-mode"
    ],
    "ignoredNames": [
      ".git",
      ".svn",
      ".DS_Store"
    ],
    "themes": [
      "nucleus-dark-ui",
      "dark-base16-eighties"
    ]
  }
}

Installed Packages

# User
atom-handlebars, v1.3.0
atom-ternjs, v0.14.1
atom-typescript, v8.10.1
autoclose-html, v0.23.0
autocomplete-paths, v1.0.2
color-picker, v2.1.1
dark-base16-eighties, v0.0.0
emmet, v2.4.3
file-icons, v1.7.11
git-log, v0.4.1
ide-haskell-stack, v0.0.3
javascript-snippets, v1.2.1
language-diff, v0.4.0
language-elm, v1.3.4
language-haskell, v1.7.15
language-purescript, v0.7.0
linter, v1.11.4
linter-elm-make, v0.5.0
linter-eslint, v7.2.2
linter-tslint, v0.9.3
local-settings, v0.4.0
narrow, v0.4.0
nix, v2.1.0
nucleus-dark-ui, v0.7.22
project-manager, v2.9.7
react, v0.15.0
ruby-syntax-replacer, v0.5.1
save-session, v0.16.0
vim-mode-plus, v0.40.1

# Dev
No dev packages

[Breaking] Remove fuzzy-search feature

It's highlight is not correct and difficult to render correctly to translate fuzzy pattern into highlight regex.

Remove this confusing feature in the meantime.

narrow:search-word-under-cursor

Like project-find:search-under-cursor, this would open a narrow:search (ag) for the word under the cursor. I usually have this bound to ctrl-/

So the workflow would be ctrl-/ ... j j j ENTER

Which would be my new favorite way to navigate from my brain to the code I'm trying to find.

new update looks great !

narrow lines isn't quite working for me. It doesn't filter right now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.