narrow something.
Code navigation tool inspired by unite.vim, emacs-helm.
More information on wiki
search
files in project ), you can filter items by query to narrow down further.ag search result
on narrow-editor then apply changes to real-file ).narrow-editor
or narrow-ui
: filter items by query and render items.narrow-provider
: Provide items to narrow.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.To follow this quick-tour, you don't need custom keymap.
narrow:scan
Narrow Scan
.narrow-editor
opened, Initial items are each lines on editor. As you type, you can narrow items.apple
as query. all apple
matching items are listed.up
, down
(or j
, k
in read-only mode) key to quick-preview items.enter
to confirm. When confirmed, narrow-editor
closed.The read-only mode is enabled by default.
narrow-editor
.Narrow Scan
.narrow-editor
opened. As you type, you can narrow items.narrow-editor
.ctrl-cmd-n
to move to next-item
, ctrl-cmd-p
to move to previous-item
.tab
and shift-tab
.narrow-editor
by ctrl-g
( no need to focus narrow-editor
).narrow-editor
ctrl-cmd-f
( narrow:focus
) to focus narrow-editor
.ctrl-cmd-i
( narrow:focus-prompt
) to directly focus narrow-editor's query prompt row.search
, fold
etc).Direct-edit is "edit on narrow-editor
then save to real-file" feature.
Available for following providers.
scan
search
atom-scan
hello
Narrow Search By Current Word
.hello
matching items are shows up on narrow-editor.hello
. Then ctrl-cmd-g
(find-and-replace:select-all
), then type world
.Narrow Ui: Update Real File
from command-palette.Narrow Ui: Update Real File
.Search.startByDoubleClick
to true
from settings-view.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.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
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.No keymap to invoke narrow provider(e.g narrow:scan
).
Start it from command-palette or set keymap in keymap.cson
.
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-editorcmd-i
: To focus to narrow-editor's prompt AND focus-back to original-editorcmd-e
:
narrow-edior
on workspace: start narrow:search-by-current-word
.narrow-edior
: query-current-word
( by default keymap).
narrow-edior
's query with cursor-word.cmd-[
: narrow:previous-query-history
Recall previous historycmd-]
: narrow:next-query-history
, Recall next historyctrl-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'
"*":
"autocomplete-plus":
suppressActivationForEditorClasses: [
# snip
"narrow"
]
# snip
"vim-mode-plus":
highlightSearchExcludeScopes: [
"narrow"
]
vim-mode-plus.automaticallyEscapeInsertModeOnActivePaneItemChange
search
provider cause mode-change from insert-mode
to normal-mode
.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).
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
i
, a
in normal-mode
move cursor to prompt line.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
.
I
.I
, you can start insert-mode
by A
, c
etc..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
).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).
narrow:search
backspace
on itembackspace
to exclude particular file from result.ctrl-backspace
clear excluded file list and refreshnarrow-editor
and you are in read-only-mode
select-files
providerselect-files
by cmd-backspace
or clicking folder-icon
on control-bar.editor
by narrow:search
, you see lots of editor
mached itemsselect-files
, all file paths are listed as item.md
on query, you see markdown filepath that macheed md
.!
, now your query is md!
, this is treated as all files not matching md
.enter
to confirm.select-files
.spec
folder, you can add spec/!
as query..js
file only, you can set query to .js
.next-file
, previous-file
n
, p
in read-only
mode.narrow:symbols
always shows up at right-most pane and don't want to close.narrow:symbols
( or maybe you want to use narrow:fold
)narrow-editor
by drag and drop to the place where you want.Narrow Ui: Protect
. Now narrow-editor
protected.narrow-editor
is not closed by ctrl-g
( narrow:close
), and not closed by confirm by enter
.cmd-w
or close button on tab.Atom 编辑器开源,跨平台,在我的课程里用的就是这款编辑器。 https://atom.io/ 安装 在 Atom 的官方网站,你可以下载跟自己用的操作系统对应的 Atom 。也可以使用系统包管理工具去安装 Atom 。 Windows 用 chocolatery 安装 Atom: choco install atom macOS 用 Homebrew 安装 Atom: brew instal
使用Twitter的 Snowflake算法,有兴趣可以了解一下这个算法: https://github.com/twitter/snowflake php.ini的配置项: [ukey]ukey.datacenter = integerukey.worker = integerukey.twepoch = uint64 datacenter配置项是一个整数, 用于设置数据中心; worker
This module provides a class called werkzeug.contrib.atom.AtomFeed" title="werkzeug.contrib.atom.AtomFeed which can be used to generate feeds in the Atom syndication format (see RFC 4287). Example: de
基于VueJS的移动端组件库 环境支持 iOS 8+ Android 4.4.3+ 特性 CSS绘制内置图标 插槽形式得组件设计 简单、灵活、高效的组件 支持babel-plugin-import按需引入 安装 npm install atom-design --saveyarn add atom-design 使用 import Vue from 'vue'import atomD from '
Atom Shell 现已改名为 Electron atom-shell 是 GitHub 随 Atom 一起开源的跨操作系统(Windows,Linux,MacOS X)的利用 Web 技术(Node.js、JavaScript、HTML 5)开发桌面应用的框架。Atom即构建在 atom-shell 之上。 与 Node-Webkit 的区别 atom-shell 和Node-Webkit很像