SublimeText / AdvancedNewFile

File creation plugin for Sublime Text
MIT License
829 stars 93 forks source link

Feature request: Create new file by right clicking on *existing* file #127

Closed aliteralmind closed 9 years ago

aliteralmind commented 9 years ago

A nice alternative to

Right click on a directory in the sidebar-tree > ANF New file here

Would be to

Right click on a file in the sidebar-tree > ANF New file in same dir

Which would use the existing file's path, with the cursor placed at the end of the name, before the extension dot. I'm often creating files that have very similar names to their neighbors.

Preventing accidental overwrite with a yes-no prompt would work.

One of my most important plugins. Thanks again for it.

skuroda commented 9 years ago

Sorry for the delay in responding. I've implemented a version of this already. Will try to push the change soon.

skuroda commented 9 years ago

My sincerest apologies, I thought I had pushed this a long time ago, but instead had it sitting on a branch on my machine. Anyways, I have pushed an update for this. There is a new command AdvancedNewFileNewAtCommand that can be mapped to in the side bar menu. In addition there is a new setting cursor_before_extension which can be set to true, which should place the cursor prior to the extension. When a file exists, it simply tries to open that file, so there should be no risk of accidently overriding an existing file.

Again, my apologies. Thank you for using AdvancedNewFile.

aliteralmind commented 9 years ago

Excited to start using it! Thank you for doing this.