I open most of my files using ctrl-p and search. This results in having the same file open multiple times which after a while becomes a problem. Is there a way I can automatically close all duplicate views to the same file?
Close duplicate views in the same file
I cannot reproduce this problem. When I attempt to open a file with is already open by Ctrl+P
, it restaures the first opened view.
What Sublime Text build are you using?
You will need to use ctrl+P in a different view. Open 2 views (alt-shift-2 I think), open the file in one view, then focus on the other view and use ctrl-p for the same file. I am not sure if project setup is needed, I suspect not.
It is not 2 views, but groups of views. This is the standard Sublime Text behavior, but you can override it with a package.
- http://docs.sublimetext.info/en/latest/file_management/file_navigation.html#panes
- http://www.macdrifter.com/2012/07/sublime-text-working-with-multiple-panes.html
You can write a Sublime Text package to check whether there is a file currently open in some group of views. Then if it is, cancel the opening and focus on the view.
See:
I was hoping that there was a package already out there for this. Probably I have to write it on my own then
Cheers
By the way, this was hardly constructive. You just send me links to plugin development and did not tackle the issue at hand at all.
this may help to find the clones
then it should just be a matter of creating a command that will iterate through them and close all the clones (but leaving the first one open) and binding a key to that