I want to be able to open dir in sublime from terminal.

Whenever I do subl . it opens current dir in 2 sublime editors. Of course I need it to open only one.

My assumption is that I've messed with symlinks, but I might be wrong.

  • What is subl? How did you installed sublime? – Lucio Nov 28 '14 at 19:27
  • I've gone trough couple of aticles - one of them I believe is askubuntu.com/questions/172698/…, but along the way I might have done smtn like sudo ln -s /opt/Sublime\ Text\ 2/sublime_text /usr/bin/sublime or similar... I believe subl is a symlink for sublime - that I've install a long ago – AndreiMotinga Nov 28 '14 at 19:31

You didn't messed up with symlinks, sublime has installed correctly. That is actually the right behavior.

The reason why does it open two sublime instances (my bet):

  • There was a project already opened or
  • You didn't closed the previous files opened

In either case you may want to:

  • Close any project (Project -> Close Project) or
  • Close all the files (File -> Close All Files)

Adding a -a flag to the subl command causes files to "open in current window", which prevents subsequent windows opening.

alias subl='subl -a'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.