What is the best approach to creating a PhpStorm file template for a hidden file that pre-populates the file name (.htaccess) and does not include an extension?
The workflow currently is as follows:
Create file from template
Type in .editorconfig filename and hit 'ok'. Generated filename is .editorconfig..
Rename .editorconfig. to .editorconfig.
Is it possible to optimize this workflow to:
Create file from template
'editorconfig' filename prepopulated; simply hit 'ok'
AFAIK you cannot create File Template using File & Code Templates functionality for extensionless files (e.g. .editorconfig or .haccess) using standard GUI as it requires file extension part.
Few options:
1. Write custom plugin that would offer such functionality -- that's what .ignore plugin does.
2. Create File Template using .editorconfig extension (IDE will ask what File Type to use to associate *.editorfocnfig files with; I would choose "Ini").
Then create new file File | New | Your New FileTemplate and give it some name (e.g. a) -- in the end you will have a.editorconfig file.
Now just rename it to .editorconfig only.
You seem to be doing already that (slightly different version of it).
3. Do not use any File Templates. Just create brand new empty file (File | New | File) -- here you have to specify full file name including extension .. so .editorconfig can be entered here.
Once done -- just use Live Template functionality and quickly paste needed content.
You just need to create such Live Template in advance and give it some easy to use and remember abbreviation (if you wish to enter such text by typing abbreviation[TAB] (e.g. ec[TAB] where [TAB] is the expand key).
Live Templates official manual/how-to: https://confluence.jetbrains.com/display/PhpStorm/Live+Templates+%28Snippets%29+in+PhpStorm
Official Help pages: https://www.jetbrains.com/help/phpstorm/2016.3/live-templates.html?search=live%20template
Related
I use the Django authentication system, and for this I created a template, named this file login.html and in the registration directory. I already had a file with this name (login.html), and then I created this file and deleted the previous file, now pycharm does not accept the new file as html, and because of this I can not put Django template in this file and Leave a link.
And you know you can't rename the file, because then the Django template authentication system can't find it. And now I do not know what to do.
What can I do to make pycharm accept this as html?
Make sure login.html has HTML file type and not e.g. Text one in Settings | Editor | File Types.
You Can simply rename this html file from login.html for example to login_users.html
I have a folder with bla.html file and some assets (*.png and *.json) it it.
I want doxygen to copy it into HTML documentation root.
How to make it do such thing in doxygen configuration file (not using external script)?
Upon request:
How about (from the documentation / Doxyfile):
HTML_EXTRA_FILES The HTML_EXTRA_FILES tag can be used to specify one
or more extra images or other source files which should be copied to
the HTML output directory. Note that these files will be copied to the
base HTML output directory. Use the $relpath^ marker in the
HTML_HEADER and/or HTML_FOOTER files to load these files. In the
HTML_STYLESHEET file, use the file name only. Also note that the files
will be copied as-is; there are no commands or markers available. This
tag requires that the tag GENERATE_HTML is set to YES.
The full doxygen documentation can be found at : http://doxygen.nl/manual/index.html and the referred part at: http://doxygen.nl/manual/config.html#cfg_html_extra_files
How can I reformat Source Code for files without file extension in WebStorm 2016.1.3 ?
Example: I've a automated_generated_json_file_without_extension in one line and the name of the files are always different. I don't want to configure all these file names in "File Types" Dialog and register new patterns.
In Sublime you can change the file type at the right bottom corner, is there a similar function in WebStorm?
Unfortunately you cannot change file type of the file on the fly in WebStorm.
Possible workarounds:
Have a set of files (e.g. test.json, test.js etc) somewhere in a project where you can copy-paste this file content, reformat it there and copy it back.
Use "Scratch files" functionality (Tools | New Scratch File...) and then the same copy-paste content to reformat.
I'm looking for a code editor that saves folded/collapsed code. I want to be able to open the file on a 2nd computer and have the same folded/collapsed code structure. I understand that HTML/CSS cannot have this preference built in. If the editor needs to save the file in some propriety file type, I'm fine with that. I just need to be able to export it as plain HTML/CSS files once it's ready for publishing.
(Windows 7)
UltraEdit supports code folding for text files of any type and it supports also saving/restoring of folds on close/open.
In menu Advanced there is the menu item Configuration. In the settings tree navigate to Editor Display - Code Folding and enable at least the settings Save folded lines and Enable show/hide lines and code folding.
By default UltraEdit remembers which file are open with which lines hidden/folded on exit in file uedit32.ini stored on Windows computers by default in directory %APPDATA%\IDMComp\UltraEdit\. But this file contains also all other user configurations like the 2 settings I wrote above.
Therefore it is better to use a project or at least a workspace for editing the HTML/CSS files for your website(s). A project/workspace can be created in menu Project with New Project/Workspace. Using a project/workspace results in remembering which files are open on closing the project in a separate project related workspace file instead of uedit32.ini. The workspace file remembers not only the open files on closing the project, it remebers also which lines are folded, where the caret is positioned in each file, which file was the active file on close, and some other information to restore the workspace on next opening of the project/workspace.
But before creating the project/workspace, you need to enable the setting Save project information for use on multiple systems at Advanced - Configuration - File Handling - Advanced. As you can read on help page opened by clicking on button Help of this configuration dialog, this setting results in storing the workspace file of a project in same directory as the project file.
The location of the project file is defined by you on creating the project/workspace and is quite often in root directory or a subdirectory of a local copy of a website. With *.prj (the project file) and *.pui (the project user interface file = workspace file) somewhere in directory tree of the website, you have those 2 files also shared between multiple systems together with the HTML and CSS files.
See the user forum topics Create project from an existing directory tree? and Why save files to a Project? in the user-to-user forums of UltraEdit and take also a look on Tutorials/Power Tips page of IDM Computer Solutions, Inc.
SynWrite (Windows) supports it. Make some folding, then save a session file (*.syn). This file contains folded states and more. Anytime later, just open session file (menu File - Sessions) and folding (and more) restored.
You have a CSSMENU editor where you can create menu bars. This editor saves a file in such a way that it can be moved to any other pc as you mentioned . Html file will be saved and the related Css files are stored in another folder where you can move those files as your wish. No need of changing any code.
PHP Storm: File templates
I would like to add custom file template with generated filename. I do not want to prompt filename by hand, I want it generated with variable values.
E.g. ${YEAR}${MONTH}${DAY}_${MyCustomVar}.sql
It there a way to do that?
Would you like to create files with 'fixed' names generated using temploate variables? It's not currently possible - you can file a request for this feature to youtrack (http://youtrack.jetbrains.com/issues/IDEA)
Related ticket: http://youtrack.jetbrains.com/issue/IDEABKL-6428