sublimetext / advancednewfile Goto Github PK
View Code? Open in Web Editor NEWFile creation plugin for Sublime Text
License: MIT License
File creation plugin for Sublime Text
License: MIT License
My settings:
{
"default_root": "current",
"alias": {
"css": "files/stylesheets/",
"js": "files/javascripts/"
}
}
When I create a new file and type css:filename
, it tries to make the file at files/javascripts/files/stylesheets/filename
. Similar, with js:filename
I am getting files/javascripts/files/javascripts/filename
.
With absolute path, it works fine. However, that's not what you want in a project, right?
Not sure why it was changed but in the old version this plugin modified what "New File" does instead of adding another "Advanced New File" to the context menu. Although I could just get used to using the shortcut key if I want to use the mouse it's going to be irritating to click on the wrong one.
I use ST3 and most of menu actions are disabled (i suspect permissions problems, but even if i run sublime as a root, it doesn't help). Though, this plugin works well in ST2 with the same files which makes me think there is an issue for ST3 support.
Hello,
I'm trying to use this plugin with Sublime Text 3 and it's not working.
I don't have any option in the command palette for the plugin.
The console doesn't show any error.
I'm on Ubuntu 13.04 64bits.
I've also tryied to install it with a fresh installation but it's the same result.
Thanks !
The README.md has many interesting settings described. However, it does not say which file should contain them. Want to give us a hint?
I think this tool should be able to support curly braces, e.g. a/b/{c,d} to create a/b/c and a/b/d
If I enter a alias name, say "docs:", then press Ctrl + Space expecting to get autocompletion list with list of folders inside docs, but nothing is shown.
If there are several aliases with same prefix, say "docs" and "documentaiton" it will show this aliases instead of list of dirs inside current aliased directory.
I see that continue_previous_autocomplete method in PathAutocomplete returns true, so new list of suggestions is not build, no glue how to fix it myself, could you fix it or give me a direction?
Думаю, стоит менять описание при вызове разных команд. Точнее, когда создаёшь файл вместе с __init__.py
дописывать "(with __init__.py
)".
This awesome plugin isn't showing up in wBond's package control. It appears on the site, but not on the install screen.
I have used it in the pass previous versions of windows / linux (ubuntu), now when i right click to get more options don't get anything but the ones that sublime has already built in, is there anything i can do to provide more information for you to debug further let me know. Thanks.
Hello,
I use key ctrl+n for advanced_new_file command. It works fine. But when I turn on the use_cursor_text, I cannot open new file panel anymore. I tried ctrl+n, ctrl+alt+n, shift+ctrl+alt+n but none of it works.
I use Sublime Text 3 on Windows 7 x64
Would be nice if we could rename a file (move it), using the same autocomplete and mkdir-p style directory creation. Thanks!
Based on comment from here.
:./folder1/folder2/../file.ext
creates folder1 (in the current directory) containing bother folder2 and file.ext. and opens file.ext
Allow default file extension to be specified when creating files. Will apply if filename does not match the pattern *.*
Based on comment.
Inconsistent errors when specifying paths as follows:
/folder:folder2/file.ext
error: Cannot create '/folder:folder2'. See console for details
[AdvancedNewFile] ERROR Exception: Access is denied '/'
/folder:folder2/file.ext
error: Cannot create '/folder:folder2/file.ext'. See console for details
[AdvancedNewFile] ERROR Exception: The directory name is invalid '/folder:folder2'
This is a feature request.
Currently typing assets\css\
will create the folder structure assets\css but an error pops up saying "Cannot open view for blah\assets\css. It is a directory"
It'd be great if AdvancedNewFile was smart enough to know that this was intended and just create the directory structure without the error message.
Great plugin by the way!
Thanks.
If you open a project like subl --project foobar.sublime-project
opposed to opening a folder and then switch to the project, first time you try to create a new file status bar says: “Unable to fill status bar without view”.
Any ideas please?
I'm pretty new at this so bear with me. I'm trying to make sure I don't overlook the obvious before hitting send.
I installed AdvancedNewFile into Sublime Text 2 on a mac with Package Control after watching the tuts+ course. I did not need to enable it.
I want to get the alt+super+N combination to work and I haven't succeeded yet.
The shift+alt+super+N combination works out of the box.
I could not find AdvancedNewFile with shift+command+P.
So I added the .sublime-commands file mentioned in the README.
Then I could pull it up in the command palette with shift+super+P, "adv".
I installed FindKeyConflicts.
When I use shift+super+P to bring up the command palette,
then type "find" for FindKeyConflicts, and select Command Search,
AdvancedNewFile is there for three commands. The alt+super+N
key binding shows up in the result, and if I click on it it works.
I tried FindKeyConflicts All Key Maps to Buffer, and searched for "+n" and found no
conflicts for alt+super+N.
I tried the console too and found that no commands were registering when I hit alt+super+N. Other key combinations showed in the console.
I created a user key-bindings file, but that didn't work either.
Any advice on how to get the alt+super+N to work?
If you're not busy @skuroda,
You might want to considering having the prompt "Enter path for new file:" be populated with selected text or string text under the curser.
It might be useful to see how https://github.com/SublimeText/Open-Include handles this.
Edit: Changed Title to "use_cursor_text error"
Traceback (most recent call last):
File ".\sublime_plugin.py", line 339, in run_
File ".\AdvancedNewFile.py", line 55, in run
File ".\AdvancedNewFile.py", line 152, in show_filename_input
Boost.Python.ArgumentError: Python argument types in
Window.show_input_panel(Window, str, NoneType, instancemethod, instancemethod, instancemethod)
did not match C++ signature:
show_input_panel(class SP<struct edit_window::reference>, class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >, class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >, class boost::python::api::object, class boost::python::api::object, class boost::python::api::object)
Can you add an option that allows us to customize the permissions of any new directories created? Right now it defaults to 777 and I have to chmod all of them to 755.
On Windows 64bits:
super+alt+N -> test\folder\index.html
then crtl-S to save index.html path become double " C::\ " fail to save
As mentioned here, :
can be used to make a file in the same folder. But it is currently not possible to go up the tree. Or at least I'm unaware as to how this can be achieved.
And it would be nice to use something like the default .
to indicate the current folder and ..
to indicate the parent folder rather than :
.
Proposed workflow:
Type: 'sr'
[tab] src/
[tab] src/scala/
[tab] src/scala/domain (notice no trailing '/')
[tab] src/scala/shared (notice no trailing '/')
[forward-slash] src/scala/shared/
[tab] src/scala/shared/my/
[tab] src/scala/shared/my/stuff/
It is frequent to make test files there in the Desktop or paths easily referred from the Home ~ directory, but Advanced New File is not aware of the meaning of that ~ and builds a funny ~/Desktop/file for example inside your current path.
Hi,
in a project where you have you main codebase not directly under the project path you can find yourself typing the same path "prefix" over and over again.
It would be cool if we could setup a relative path option in project settings to mark as a default path being prefilled when openning the dialogue - it's much faster to just delete it in those 2% of cases where it should be somewhere else
Thanks
I have a directory structure as such
Browsing log
2013 > August > August 13, 2013.txt
When I type in Browsing
hit tab, Browsing Log/
pops up. But after that when I type in 2
or 20
or 201
or 2013
and hit tab Browsing Log/2
becomes P13/
. I don't have such a folder in my directory structure. This issue is there on Windows and Ubuntu, in ST2 and ST3 for me. Its only been a week since this issue popped up. I even reverted to sublime 'factory' settings twice but the issue still prevails.
I am come across a bit of an annoyance.
I often need to add a file in a directory called 'client'. My instinct is to type 'cl -> tab'.
Because I have a snippet using 'cl' as a tab trigger, that snippet is running in the new file dialogue, and given priority over matching folder.
I can see how snippets might be useful within the new file dialogue, but maybe priority should be given to folder matches?
When trying to use the key's ctrl+alt+n, it doesn't do anything?
After starting to type filename like: "D:\SomeFolder\somenewfile.txt" autocompletion for SomeFolder works fine.
Status bar shows message "Creating file at C:\SomeFolder". After hiting enter it creates a window for new file with name: "c:omeFolder\somenewfile.txt" (first letter from folder is absent). This file is not possible to save (wrong filename)
In console there is a warning: "advancedNewFile[Warning]: No alias found for 'd'"
I guess because of ":" D considered as a alias, not as a part of path.
Is there any workaround to fix it?
Well, this may not really be an issue but, just saying, I'm using a Windows pc and the default key binding is alt+n, but this alt is the right alt (left one triggers the menu bar of the actual window on Windows). So, the right alt is used to insert special characters (alt+a = á, alt+m = µ, alt+e = é, alt+o = ó ...) when your keyboard is configured as "United States International". So it happens that alt+n = ñ and as that keybinding is being used for advance new file, you can't input ñ.
Yes, I know I can change the key binding and all that, I'm just saying. Also, the default setting's file has this line:
{ "keys": ["ctrl+alt+n"], "command": "advanced_new_file"}
But just pressing alt+n triggers it. Why is that?
"Browser "chrome" not found! Is installed? Which location...?"
This is the message i get when i try to "Open in Browser" a flie.
Where can i find setup for browser command ?
Thank you in advance,
Ounos
I may be missing it (i've been searching for about 5 mins now) - is there a change log available?
The plugin does not honor the tab_size
preference when creating a new file. Instead always (read: frustratingly!) defaulting to 4 spaces.
There is a bug in AdvancedNewFile.py.
In line 319, replace "base" with "path".
I'm new to GitHub so I have not figured out how to send a diff file!
The plugin is fantastic, but the one feature I'd love to see is tab autocompletion.
Sublime's package manager seems to install the old version from https://github.com/xobb1t/Sublime-AdvancedNewFile, or at least one that doesn't work--pressing super+alt+N doesn't launch the new file panel.
However, downloading it from this repo works great.
I'm not sure where to report this issue (here? or with Wbond?) so the repo used within the package manager gets updated.
Hello,
I've downloaded your plugin called AdvancedNewFile and installed it into Sublime Text 2 on my Mac.
I want to add an alias so I can create a new file by doing:
xampp/hello.html
and it will create hello.html
in /Applications/XAMPP/htdocs/hello.html
How can I set this up in my User settings? Currently my user settings look like this:
{
"alias": {
"xampp": "../../../Applications/XAMPP/htdocs/"
}
}
and this doesn't work. Any Ideas?
In the Readme example, there is a colon missing after: "subl_packages".
{
"os_specific_alias": {
"subl_packages" {
"windows": "\AppData\Roaming\Sublime Text 2\Packages",/.config/sublime-text-2/Packages",
"linux": "
"osx": "~/Library/Application Support/Sublime Text 2/Packages"
}
}
}
Can you add a feature to prefill the initial value , with the same file name
appending ':' to denote the same folder?
I'm getting the following console error when I try and utilize the "cmd alt n" shortcut on my mac:
Traceback (most recent call last):
File "./sublime_plugin.py", line 350, in run_
File "./AdvancedNewFile.py", line 10, in run
File "./AdvancedNewFile.py", line 18, in get_root
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py", line 119, in dirname
i = p.rfind('/') + 1
AttributeError: 'NoneType' object has no attribute 'rfind'
Any idea as to what's going on here?
When I open some folder I can create new files with no problem, but when I start working on sublime project stroking ctrl+alt+n doesn't do anything.
In order for AdvancedNewFile to work, I had to restart Sublime.
Is this the expected behavior? If so, it should be documented on the Install
instructions.
"[AdvancedNewFile] ERROR Exception: Permission denied"
I have tried opening from the working folder from the terminal and from the finder. I have also tried sudo opening from the terminal. In all cases I am not able to create new folders or files with the shortcut command. I think the fix may be pretty simple but I am not seeing it. Any advice?
Hi,
I see Jeffrey Way right click on the folder at the sidebar, choose New File and the new file panel show up. But when I do that, Sublime Text 3 just create new blank file without asking for file name. Is there anyway to achieve that?
Good idea but plugin is useles for me becase of one thing: it always try to create files not where I expect them.
What I want is an option to create files in the same folder as active opened file in Sublime.
For the last month or so since the chance I've thought the plugin was broken, or was only supported on Sublime 3.
Now I've checked and I see there's a hotkey to still do it but I miss the ability to type it from the command palette.
What are the chances we can see this back? :)
Сабж :)
I wanted to say that this does ease some of the pain of creating new folders/files in Sublime Text 2. However, this doesn't do exactly what I was hoping for. What I'm looking for may have to be implemented by Jon himself. Not sure.
Reason why I'm posting this is just so it's out there somewhere, and this seems like a good enough place to put it.
My ideal workflow:
Some other advancements:
I might think of more things, but these additions would make it a world better for me. I might take a stab at it myself, if I can get the time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.