• Packages
  • Themes
  • Documentation
  • Blog
  • Discuss
Sign in

advanced-open-file

Open and create files and directories easily. Type in a path (with autocomplete) and view directory contents.
  • #open
  • #file
  • #create
  • #new
Osmose
0.16.8 292,007
551
  • Repo
  • Bugs
  • Versions
  • License
Flag as spam or malicious

Advanced Open File

TravisCI Build Status

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.

Screenshot of plugin

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.

Usage

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.

Keybindings

Available commands for binding:

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'

Settings

Event Service

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"
    }
  }
}

Main Module

{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}"

Contributing

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.

Developer Setup

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!

License

Licensed under the MIT License. See LICENSE for details.

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
with by