Opening just a file and not full directory


#1

It seems that when I choose ‘open’ and then select a file, it opens the whole file’s path in the tree view. Is there a way to just make it open the one file?


#2

You can hide the tree view pressing Cmd+\


#3

This is true but if that one file is located in a folder with many folders and other files, then there is a small loading time. Also, sublime does this properly and it shouldn’t be that hard just opening one file I would think.


#4

I like Atom, but… I’m used to open and edit a single file through the terminal like for example .zshrc with mate ~/.zshrc, vim ~/.zshrc or subl ~/.zshrc. Trying to open a single file with atom ~/.zshrc for example, took me a very long time. The Atom editor loaded my entire home directory in the tree-view. It would be nice to know how to open a single file in Atom, like in vim, sublime or textmate.


#5

I agree with @rjanse . Is there a workaround for this?


#6

Still no answers? :frowning:


#7

Bumping this. I keep a .scratchpad file in my home dir and it takes a while to open it while loading the side bar.


#8

There is a bug tracking this issue and the related work that needs to be done to fix it:


#9

The GitHub issue #1722 isn’t quite the same thing. That’s about opening a file from the command line in the current window. What the people in this thread are talking about is an option to open a single file and not have the directory sidebar load at the same time. Editing config files in your home directory is a great example of this. When I run atom ~/.zshrc I don’t want Atom to open a new project window and load my entire home directory. I just want a simple single-pane editing window. Does anyone know if this is possible now?


#11

Yes, this is still annoying :slight_smile: as atom has a hard time keeping track of my home folder and everything that is under it. Surprised that this has only generated one comment since December '16. Maybe there is a work around we are not thinking of…


#12

Please explain what you mean by saying that it has a hard time.

Maybe there is a work around we are not thinking of…

If you’re trying to work around Atom loading the directory, you can’t without modifying Atom’s code. You could symlink to .zshrc from a directory that you want to keep open. I have all of my dotfiles in a .dotfiles dir so that I can easily port them across systems, and then they get symlinked to their proper locations.


#13

Hey there,

My home folder is (a fairly typical?) 100GB and 125,000 files. Anecdotally, I get high system load when that folder is open for a while. I have it open now and nothing is happening, of course :slight_smile: Maybe it is / was a combo of plugins / or an issue with an older version.

Yeah - the symlinking is a nice work around. I am doing that for some stuff and i could get in the habit of doing it for everything but ~ is my default for placing random files that I want to look at.(stuff i have scped,) etc.

Looking at it another way…

In most cases, opening the containing folder is handy. In others it isn’t. Yes it would be nice to have an option but I can easily live without it as long as it doesn’t eat system resources. So I’ll keep an eye on things and let you know if any when i can reliably reproduce…

PS. I’m on Ubuntu 16.04.


#14

Makes sense. That sort of folder will always cause Atom trouble, but the risk of high memory or CPU load increases with how long Atom’s been open. I would guess that certain tasks, like opening and closing directories, might increase the amount of information that Atom tries to remember. Git repos in child directories could also be an issue.

This is the guy I modeled my Linux setup off of, and here’s mine. What I changed was to allow me to sync the config files in my .atom folder.


#15

Thanks for the info and thoughts - useful stuff.