+4
otakustay 6 years ago • updated by Stanislav Krasnoyarov 5 years ago 7
I don't see how to file all occurence in currently focused file, sublime seems to only provide find in <open buffer> and <open files>, but not a single focused file, is it a miss of functionality, or is there any keyword to specify search scope to current focused file?
I think you are looking for the normal "find" under Find -> Find or ctrl+f (in windows anyway).
The normal find function does not give a search result panel to see all occurence, what I actually need is a list of occurence with its context
Sorry, you didn't mention anything about the result panel so I didn't understand.

You do have the option of "in files".  It does have some limitations, you have to specify just the file name, if you give it the full path it doesn't seem to work.  Also it doesn't seem possible to auto populate the field, but getting the file name is easy enough by right clicking on the file.

One work around to all of this would be to drag the current file out, so it starts a new instance of sublime and then do a search on <open files>.  Not as friendly, but it will work.

I have been wanting to try out the plug in abilities, maybe I will see if I can add the functionality you want.
Another option that may suit you is using "Find All", then pressing ctrl+l (command+l on OS X) to expand the selections to the entire line, and then copy the selected text, and paste it into a new file: you'll then have a file containing all the lines which match your original search term.
I made a plug in that will auto populate the fields for you.  It will give you an option to "file in file" when you right click a file in the side bar or the file content.  I am not sure if I can publish it here, if you give me your email I can send it to you.
sorry for late reply, my email is otakustay@gmail.com, very much thanks for your plgin:)
also thanks for those provide nice alternatives for search in one file:)

Could you please drop a copy to the Stanislav.Krasnoyarov@gmail.com as well?