osmose / advanced-open-file Goto Github PK
View Code? Open in Web Editor NEWOpen files and folders in Atom easily.
Home Page: https://atom.io/packages/advanced-open-file
License: Other
Open files and folders in Atom easily.
Home Page: https://atom.io/packages/advanced-open-file
License: Other
In Helm it's possible to jump to the home or root directory by typing ~ and / after trailing slash. This is handy as it allows to quickly escape from deeply nested project structure to edit some config file. Is it possible to implement such functionality in AOF?
Hey I just updated to 0.10.0 and directories are only being shown for me using backslashes, forward slashes list nothing. So things like C:/
, /
, ~/
, :/
show nothing whilst C:\
, \
, ~\
, :\
do show the directory list, I'm using Atom 1.0.15 on W7x64.
Typing ~/.zshrc literally should work.
[Enter steps to reproduce below:]
Atom Version: 1.0.11
System: Microsoft Windows 10 Home
Thrown From: advanced-open-file package, v0.9.2
Uncaught TypeError: Cannot read property 'forEach' of undefined
At /C:/Users/AlexJ/.atom/packages/advanced-open-file/lib/advanced-open-file-view.coffee:297
TypeError: Cannot read property 'forEach' of undefined
at C:\Users\AlexJ\.atom\packages\advanced-open-file\lib\advanced-open-file-view.coffee:179:14
at FSReqWrap.oncomplete (fs.js:77:15)
-0:02.9.0 advanced-open-file:toggle (atom-text-editor.editor.is-focused)
{
"core": {},
"advanced-open-file": {
"createFileInstantly": true,
"defaultInputValue": "Project root"
}
}
# User
advanced-open-file, v0.9.2
atom-alignment, v0.12.1
change-case, v0.6.0
emmet, v2.3.12
jshint, v1.7.0
# Dev
No dev packages
New files created with advanced-open-file
are not indexed by the built-in Atom Fuzzy Finder. Not sure if this is an issue with Fuzzy Finder or with this, but it is something you may want to look into.
I hit , and I have no idea whether it completed something -- the only way to find out is to type a character after the completion, which then shows that portion of the text field.
I found this while verifying #18 on OS X. Let's say my username is xyz
, and my home directory is /Users/xyz
. If I type /Users/xyz/
(note the trailing slash), in the advanced open file dialog, the input field height shrinks to almost nothing:
This also happens immediately after expanding ~/
to /Users/xyz/
as well.
It re-expands to the original height if any change is made (e.g., appending Desktop/
.
What's odd is that this doesn't seem to happen for any other directory (e.g., /Users/
, /Users/xyz/Desktop/
, etc.).
It seems that advanced-open-file
polyfilling the global.Promise
object is breaking other packages, namely atom-typescript. See: TypeStrong/atom-typescript#709
At the moment the panel opens with the path of the currently open file.
More often than not I need to create a file in another directory, thus writing / tab completing the desired path would be quicker than having to remove the undesired parts of the automatically filled path before starting to write my desired path.
Could also be implemented as a setting allowing the current behaviour to remain available if the user prefers it.
A continuation of the request from PR #16.
@Krzysztof-Cieslak Did you want the event to be triggered only when a file is created, or when a file is opened? If the "Create files instantly" preference is disabled, then the file isn't created until it is saved, and we can't really emit an event in that case.
I'm not a huge fan of Coffeescript personally, and I'm also not a huge fan of how space-pen does things. I also keep finding features that made sense for advanced-new-file that don't for advanced-open-file.
I think I'd like to try porting/rewriting the package to ES6 using the 'use babel'
hook for running the code through Babel. I'm not sure what I'd replace space-pen with, but one possibility is React. There's an NPM package called react-for-atom that a bunch of Facebook's Nucleide libraries depend on which seems interesting. On the other hand, React might be a bit overkill compared to a simpler library like space-pen. We'll see!
Hi, the tab to autocomplete functionaility isn't working for me. I'm using Atom 1.0.9 and advanced-open-file 0.8.2 on W7 x64. Not sure why it's not working since I'm not getting any errors.
After some fiddling around I found out that it's related to #13 I'll see if the path handling fix also fixes this issue.
Would it be possible to implement an 'Add Project Folder...' option. Maybe as a toggle on the panel itself that can allow for opening a folder (or the parent folder if opening a file) as a project folder on the tree-view. Greyed out when navigating in an already open project folder.
Hi, If I'm on windows I have troubles listing the file content of the current directory. It looks like it's related to the windows style paths. For example:
C:\Projects\TestProject will list nothing, where \Projects\TestProject will show all directories..
When opening file you always see double dots moving you to up directory. If maintainer think this is a great capability, please change order so you need not to scroll one time to select file.
NOW
prompt: /path/to/project/package.json
list:
..
package.json
SHOULD BE
prompt: /path/to/project/package
list:
package.json
..
p.s. regexp matches appreciated to.
Entering /somepath/projectdirectory/newdirectory/ isn't currently supported but would be very nice to have.
Hey I just noticed a small difference between Unix and Windows paths for adding project folders so I made some screenshots because they show exactly what I mean.
So basically with a standard Windows path the plus doesn't show with a Unix path it does.
advanced-open-file 0.9.1
Atom 1.0.11
Windows 7 x64
We should have a section in the README that explains how to get set up for working on this package as a developer. Or maybe put it in a CONTRIBUTING doc?
Atom Version: 1.2.0-beta1
System: Ubuntu 15.10
Thrown From: advanced-open-file package, v0.12.2
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
At /home/user/.atom/packages/advanced-open-file/lib/models.js:200
TypeError: Cannot read property 'toLowerCase' of undefined
at Function.commonPrefix (/home/user/.atom/packages/advanced-open-file/lib/models.js:200:50)
at AdvancedOpenFileController.autocomplete (/home/user/.atom/packages/advanced-open-file/lib/controller.js:151:32)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom-beta/resources/app.asar/src/command-registry.js:260:29)
at /usr/share/atom-beta/resources/app.asar/src/command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom-beta/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:528:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom-beta/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:351:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (/usr/share/atom-beta/resources/app.asar/src/window-event-handler.js:99:36)
at HTMLDocument.<anonymous> (/usr/share/atom-beta/resources/app.asar/src/window-event-handler.js:3:61)
-0:37.4.0 vim-mode:move-to-next-word (atom-text-editor.editor.vim-mode.is-focused.operator-pending-mode)
-0:32.6.0 vim-mode:activate-normal-mode (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
4x -0:32.5.0 vim-mode:move-down (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
8x -0:31.6.0 vim-mode:move-left (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
-0:30.1.0 vim-mode:change (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
-0:30.1.0 vim-mode:move-to-next-word (atom-text-editor.editor.vim-mode.is-focused.operator-pending-mode)
-0:26.1.0 vim-mode:activate-normal-mode (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
-0:25.8.0 vim-mode:insert-after-end-of-line (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
-0:25.4.0 emmet:insert-formatted-line-break-only (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
-0:25.3.0 editor:newline (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
-0:23.7.0 vim-mode:activate-normal-mode (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
-0:19.3.0 vim-mode:move-to-start-of-file (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
-0:12.8.0 advanced-open-file:toggle (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
-0:12.7.0 blur (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
14x -0:11.6.0 core:backspace (atom-text-editor.path-input.editor.mini.is-focused)
5x -0:07.8.0 advanced-open-file:autocomplete (atom-text-editor.path-input.editor.mini.is-focused)
{
"core": {
"themes": [
"accents-ui",
"base16-tomorrow-dark-theme"
],
"disabledPackages": [
"web-browser",
"tool-bar-main",
"atom-jade",
"spell-check",
"seti-icons",
"atom-color-highlight",
"local-history",
"project-view",
"tool-bar",
"toolbar-basic",
"background-tips",
"image-view",
"language-csharp",
"linter-tidy",
"deprecation-cop",
"linter-python-pyflakes",
"opened-files",
"hyperclick",
"symbol-gen",
"symbols-view",
"symbols-tree-view",
"run-command",
"devdocs"
],
"excludeVcsIgnoredPaths": false,
"autoHideMenuBar": true
}
}
# User
MagicPython, v0.5.0
Zen, v0.16.3
accents-ui, v1.1.0
advanced-open-file, v0.12.2
api-docs, v0.0.3
atom-ctags, v4.4.0
atom-jinja2, v0.5.0
auto-reveal-in-sidebar, v0.8.0
autocomplete-paths, v1.0.2
autocomplete-python, v0.10.3
color-picker, v2.0.13
color-picker-service, v0.0.1
color-tabs, v0.1.8
color-tabs-regex, v0.2.2
emmet, v2.3.14
file-icons, v1.6.11
foldername-tabs, v0.1.5
git-hide, v0.1.2
github-notifications, v0.1.1
javascript-snippets, v1.0.0
language-babel, v2.3.0
language-diff, v0.3.1
language-javascript-better, v1.7.1
language-javascript-jsx, v0.3.7
language-lua, v0.9.4
language-nunjucks, v2.0.0
last-cursor-position, v0.9.0
linter, v1.10.0
linter-eslint, v4.0.0
linter-jscs, v3.2.0
linter-jshint, v1.2.1
linter-pep8, v1.0.1
linter-pylama, v0.2.0
minimap, v4.16.0
minimap-bookmarks, v0.1.0
minimap-git-diff, v4.1.8
minimap-highlight-selected, v4.3.1
minimap-pigments, v0.1.7
nerd-treeview, v0.3.1
pigments, v0.18.1
python-iresolve, v0.0.3
python-tools, v0.6.5
quick-highlight, v0.3.7
remember-file-positions, v0.2.0
swackets, v0.7.0
sync-settings, v0.6.0
tidy-tabs, v0.3.0
time-status, v1.1.0
underline-trailing-whitespace, v1.4.0
vim-mode, v0.63.0
wakatime, v5.0.0
# Dev
No dev packages
Something like "/path/[file.one,file.two]" would be helpful.
The fix in #3 broke our ability to enter directories named ~
. I mean you shouldn't do that but oops.
Currently, autocomplete is completely case-sensitive; it will ignore paths that don't match the case of anything in it. This is really awkward when, for example, you have three paths that all start with "Osmose" and you type in "os" as the fragment and attempt to autocomplete.
The intended behavior is that any text already in the path is treated as case-insensitive when matching, but any new letters it is filling in should be treated as case sensitive, so that autocompleting will not complete beyond the difference in case.
As mentioned in #22 (comment), if the list of files is long enough to be scrollable, and you use the keyboard to move past the end of the visible items, the list should scroll to keep the cursor highlight in view.
advanced-open-file:toggle
uses current path, which can be longer than textbox's length. In this case cursor is not visilble, you have to press some key (e.g. right arrow) to reveal it.
I propose to always scroll to the last character. This would not have negative effects in case of short path, but would be better user experience for paths longer than input box.
It would be nice to see what is being typed when the string is longer than the input box.
I can't see what's selected at this point.
When the directory has too many files, it tries to show all of them at the cost of the input box.
You currently have these options for fast directory switching:
/
) will switch to the filesystem root.~/
) will switch to the current user's home directory.What do you think about an option for switching to project root? (Sublime's advanced-new-file package uses a colon :
for switching to project root or top level folder in sidebar.)
Proposed add for Emacs ctrl-n and ctrl-p for selecting next/prev file in list.
Also, ctrl-i/ctrl-k are popular movement key combos.
Often, I'm in the situation where the directory listing looks like:
...
0092-name-lowering.txt
0093-global-value-numbering.txt
0094-loop-fission.txt
...
I have to switch to my terminal, and atom *global-value-numbering*
. We can leverage fuzzaldrin quite easily to ease the pain.
The alt-backspace doesn't delete the '/' along with the path component, effectively making the user do double the number of keystrokes to strip path components.
[Enter steps to reproduce below:]
Atom Version: 1.1.0
System: Mac OS X 10.10.5
Thrown From: advanced-open-file package, v0.12.0
Uncaught Error: EACCES: permission denied, open 'tools.txt'
At fs.js:549
Error: EACCES: permission denied, open 'tools.txt'
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.module.(anonymous function) [as openSync] (ATOM_SHELL_ASAR.js:137:20)
at openThenF (/Users/leonardschuetz/.atom/packages/advanced-open-file/node_modules/touch/touch.js:80:40)
at touch_ (/Users/leonardschuetz/.atom/packages/advanced-open-file/node_modules/touch/touch.js:73:10)
at optionsRef (/Users/leonardschuetz/.atom/packages/advanced-open-file/node_modules/touch/touch.js:45:28)
at touch (/Users/leonardschuetz/.atom/packages/advanced-open-file/node_modules/touch/touch.js:69:10)
at Function.touch.touchSync.touch.sync (/Users/leonardschuetz/.atom/packages/advanced-open-file/node_modules/touch/touch.js:6:10)
at Path.createFile (/Users/leonardschuetz/.atom/packages/advanced-open-file/lib/models.js:107:15)
at AdvancedOpenFileController.openPath (/Users/leonardschuetz/.atom/packages/advanced-open-file/lib/controller.js:107:22)
-0:04.1.0 advanced-open-file:toggle (atom-pane.pane.active)
-0:02.5.0 core:backspace (atom-text-editor.path-input.editor.mini.is-focused)
-0:00.7.0 core:confirm (atom-text-editor.path-input.editor.mini.is-focused)
{
"core": {
"disabledPackages": [
"spell-check",
"metrics"
],
"themes": [
"atom-material-ui",
"one-dark-vivid-syntax"
],
"projectHome": "/www/sites/leonardschuetz/wwwroot"
},
"advanced-open-file": {
"createFileInstantly": true
}
}
# User
advanced-open-file, v0.12.0
atom-material-ui, v0.7.1
autoclose-html, v0.19.0
autocomplete-php, v0.3.7
autocomplete-python, v0.10.3
bezier-curve-editor, v0.7.2
editor-stats, v0.17.0
emmet, v2.3.14
file-icons, v1.6.11
jshint, v1.8.3
json-colorer, v0.3.0
linter, v1.10.0
one-dark-vivid-syntax, v1.1.1
pigments, v0.18.1
# Dev
No dev packages
When I create a file using advanced open file, I cannot switch to this file using the CTRL+P menu -- the newly created file simply does not appear.
I'm completely new to Atom, so apologies if this is not actually an issue of this package.
I just switched over from advanced-new-file and was trying to create a new file. I hit tab to complete the folder path and it didn't fill in the trailing slash, so my list of suggestions didn't update. It doesn't seem to offer any functionality at that level either because I can't hit enter to open the directory. It's a little less productive to have to hit tab + / rather than just tab to select a directory and advance to the next level.
dev mode throws this error:
Cannot find module 'atom-space-pen-views'
I know the module is deprecated, but how is it working in normal mode?
Would be nice to replace the existing rename file functionality with this one. It would look identical to atom's built-in version except it would have folder dropdowns.
I'd like to be able to cancel the popup by hitting esc which doesn't seem to be possible currently.
Hi :),
how about merging advanced new file and advanced open file? I don't have much time to take care of advanced new file so I would be happy if you could maintain it.
To reproduce:
CTRL-a
or โ-a
on OS X)~/
I expected the path to be replaced with an absolute path to my home directory.
No replacement happened.
If you type ~/
again (i.e., ~/~/
), then the absolute path to the home directory is replaced.
Great library! I love this plugin. Definitely makes atom way more usable. ๐
I would love if there was a way to open up a directory via a keyboard shortcut instead of clicking the "+" icon. Is that a feature that is already built in and I just missed it?
1.0.8 added the ability to add a project folder that is within another project folder, which means our practice of hiding "Add as project folder" icons on certain folders is no longer necessary unless the folder is already a project folder. We should update to only hide the icon in that case.
Especially after typing ~/
, it hangs for a bit for me. It would be nice if we could do the IO of listing the entries in a directory incrementally.
Apparently there's this concept of services that Atom has for packages that interact with eachother: https://atom.io/docs/v1.0.19/behind-atom-interacting-with-other-packages-via-services
It seems like we should be using this mechanism for exposing our file creation/opening handlers instead of the current method of looking up the packaging and importing.
CC @Krzysztof-Cieslak since this'd affect your use of the handlers.
project/src/some-new-file.js
)Atom Version: 1.1.0
System: Mac OS X 10.11.1
Thrown From: advanced-open-file package, v0.12.0
Uncaught Error: EACCES: permission denied, mkdir '/src'
At /Users/kevinwhitaker/.atom/packages/advanced-open-file/lib/models.js:119
Error: EACCES: permission denied, mkdir '/src'
at Error (native)
at Object.fs.mkdirSync (fs.js:799:18)
at Function.sync (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/babel-core/node_modules/output-file-sync/node_modules/mkdirp/index.js:71:13)
at Path.createDirectories (/Users/kevinwhitaker/.atom/packages/advanced-open-file/lib/models.js:141:37)
at AdvancedOpenFileController.openPath (/Users/kevinwhitaker/.atom/packages/advanced-open-file/lib/controller.js:137:22)
at AdvancedOpenFileController.selectPath (/Users/kevinwhitaker/.atom/packages/advanced-open-file/lib/controller.js:103:22)
at AdvancedOpenFileController.confirm (/Users/kevinwhitaker/.atom/packages/advanced-open-file/lib/controller.js:211:22)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:243: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:528:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:351:22)
at HTMLDocument.module.exports.WindowEventHandler.handleDocumentKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:97:20)
-1:24.2.0 settings-view:open (atom-pane.pane.active)
5x -0:40.4.0 core:backspace (atom-text-editor.editor.mini.is-focused)
-0:23.3.0 core:select-all (atom-text-editor.editor.mini.is-focused)
-0:22 core:confirm (atom-text-editor.editor.mini.is-focused)
-0:06.5.0 advanced-open-file:toggle (atom-pane.pane.active)
-0:05.1.0 advanced-open-file:autocomplete (atom-text-editor.path-input.editor.mini.is-focused)
-0:01.6.0 core:confirm (atom-text-editor.path-input.editor.mini.is-focused)
-0:00.4.0 editor:consolidate-selections (atom-text-editor.path-input.editor.mini.is-focused)
-0:00.4.0 core:cancel (atom-text-editor.path-input.editor.mini.is-focused)
{
"core": {
"themes": [
"one-dark-ui",
"base16-tomorrow-dark-theme"
],
"disabledPackages": [
"open-last-project",
"autocomplete"
],
"destroyEmptyPanes": false
}
}
# User
advanced-open-file, v0.12.0
file-icons, v1.6.11
highlight-line, v0.11.0
javascript-snippets, v1.0.0
language-cjsx, v0.3.0
language-docker, v1.1.3
language-haml, v0.23.5
language-jade, v0.6.2
language-javascript-jsx, v0.3.7
linter, v1.10.0
linter-coffeelint, v1.1.2
linter-eslint, v4.0.0
react, v0.12.10
ruby-slim, v0.2.0
save-session, v0.15.7
# Dev
No dev packages
Using C-j to open a file with that name literally, like in Helm.
I am on atom 1.0.19 on os x Yosemite.
When I open the dialogue (cmd-alt-o) and enter ~/
there are no files listed. If I manually enter a path, (e.g. ~/.atom) no files are still listed. I have tried setting the default directory to all the different options (current working directory, no directory) and I get the same result. I can see the directory if I give the full path (e.g. /Users/hjp/.atom).
Please let me know if there is any additional information I can give to help.
Thanks for the hard work. It is a very cool package
My shell isn't doing anywhere near as badly, so it's not a general lag issue. Why is each directory change so painful?
When I open the advanced-open-file dialog, the path always starts with /Users/me/path/to/my/project/...
(.e.g. an absolute path). Can there be an option to only show a relative path (relative to project root)?
Thanks.
See https://github.com/Trudko/advanced-new-file/issues/48 for details.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.