Advanced Open File is a package for helping Atom users to open files and folders easily. It can also create new files and folders if they don't exist.
Advanced Open File is fork of Advanced New File, itself a fork of Fancy New File. Thanks to both rev087 and Trudko for their work.
Hit Cmd-Alt-O
/Ctrl-Alt-O
to open the file list to the directory of the
current file. As you edit the path the file list will automatically show
matching files and directories. Hit Tab
to autocomplete the path.
Relative paths are considered relative to the current project's first root folder.
Hit Enter
to open the file at the given path. If the file doesn't exist, a tab
will be opened that will save to that file. Any directories in the path that
don't exist will be created immediately upon hitting Enter
.
You can also click on any entry in the file list to add it to the current path
(in the case of a directory) or to open it immediately (in the case of a file).
You can also use the Up
and Down
arrow keys to scroll through the list,
Page Up
and Page Down
to move to the top and bottom of the list, and Enter
to select the currently-highlighted item.
If a directory has a plus symbol on the right side of its entry, clicking the
symbol will add it as a project directory. You can also add a highlighted
directory as a project directory using Shift-Cmd-O
/Ctrl-Alt-O
.
Cmd-Z
/Ctrl-Z
will undo changes made to the current path, such as
autocompletion or directory shortcuts.
You can use the keybindings for splitting panes (Cmd-k <Arrow Key>
by default)
to open the selected path in a new split pane in the desired direction.
Available commands for binding:
advanced-open-file:toggle
core:confirm
advanced-open-file:confirm-selected-or-first
core:confirm
. If nothing is selected, select the
first item in the list.
core:cancel
pane:split-left
, pane:split-right
,
pane:split-up
, and pane:split-down
application:add-project-folder
advanced-open-file:autocomplete
advanced-open-file:undo
advanced-open-file:move-cursor-up
advanced-open-file:move-cursor-down
advanced-open-file:move-cursor-top
advanced-open-file:move-cursor-bottom
advanced-open-file:delete-path-component
alt-backspace
that erases the a
directory component in the miniEditor including the slash ('/').
The following extra keybindings are included by default:
Action | Extra Keys |
---|---|
advanced-open-file:move-cursor-up |
Ctrl-p , Ctrl-i |
advanced-open-file:move-cursor-down |
Ctrl-n , Ctrl-k |
advanced-open-file:delete-path-component |
Ctrl-l |
You can of course remap the keys however you wish. For example, add the
following to your keymap to map Ctrl-x Ctrl-f
to toggle the dialog and
Ctrl-j
to move the cursor down:
'atom-workspace':
'ctrl-x ctrl-f': 'advanced-open-file:toggle'
'.advanced-open-file atom-text-editor':
'ctrl-j': 'advanced-open-file:move-cursor-down'
When enabled, allows for quick directory switching when appending certain strings to a path that ends in a slash:
/
) will switch to the
filesystem root.
~/
) will switch to the
current user's home directory.
:/
) will switch to the
current project's root directory.
Other packages can subscribe to events to get notified when certain actions
happen in advanced-open-file. To do so, you'll need to consume the
advanced-open-file-events
service:
package.json
"consumedServices": {
"advanced-open-file-events": {
"versions": {
"0.1.0": "consumeEventService"
}
}
}
{Disposable} = require 'atom'
module.exports =
consumeEventService: (service) ->
openDisposable = service.onDidOpenPath (path) ->
console.log "Open: #{path}"
createDisposable = service.onDidCreatePath (path) ->
console.log "Create: #{path}"
return new Disposable ->
openDisposable.dispose()
createDisposable.dispose()
onDidOpenPath
Triggered when a file is opened via advanced-open-file.
service.onDidOpenPath (path) ->
console.log "Open: #{path}"
onDidCreatePath
Triggered when a file is created via advanced-open-file. Note that this is only triggered when the "Create files instantly" preference is enabled. It does not trigger when the preference is disabled and a new file is opened and then subsequently saved.
service.onDidCreatePath (path) ->
console.log "Create: #{path}"
First, if you're interested in contributing, thank you! It's awesome that you want to help!
The easiest way to contribute is to file an issue with the bug you've found or the new feature you want added. If you're interested in implementing the fix for your request yourself, or fixing an issue submitted by someone else, read on.
Setting up a development install is easy with apm:
$ apm develop advanced-open-file /path/to/checkout
The command above will use Git to clone Advanced Open File to the
/path/to/checkout
directory, download the dependencies, and create a symlink
in your .atom
profile for the package.
Now, if you launch Atom with the -d
flag, Atom will load the development
checkout of Advanced Open File (instead of the released version, if you have it
installed). Any changes you make to the code will be reflected if you use the
Window: Reload
command in the Command Palette to reload the editor.
That should be all you need to get started. Create a branch, write your changes, and submit the branch as a pull request, and you should hear back shortly!
Licensed under the MIT License. See LICENSE
for details.