60840A_Geanyusers.txt 10.11.2015 08:00:43 CET
Thats magic (see above two lines)
Question:- Does this only work with template files that are empty except for the two lines {untitled} {date} ?
I tried adding those two lines at top of my existing Perl template text.pl which is 240 lines long.
The new Perl file opens with the date already nicely filled in; it looks like this
untitled 10.11.2015 08:11:12 CET #!/usr/bin/perl ...snip...
But when I save it using same procedure as for the txt file, the top line "untitled" does not change at all.
Perhaps I'll need to learn some scripting [1] R [1]
Note that the mini script interface offers the option to save scripts and load them, and that's really powerful since the sky's the limit on what you can do to a file if you know how to script it. (:
On 11/09/2015 12:07 AM, Little Girl wrote:
Hey there,
rch wrote:
Little Girl wrote > It's not written very clearly (sorry, devs!). Here's > a more clear set of instructions that should get it > working for you:
Thats _very_ helpful.
I'm glad it was of use. (:
Could you translate another bit of «Dynamic wildcards» for me?
I can try!
At
http://www.geany.org/manual/current/index.html#template-wildcards how do I make a keyboard short cut that will paste Wildcard «filename» into my file ? Preferably the full path-and-file name.
And (better still) would it be possible to add the current date or datetime on the following line ?
Well, there's good news and bad news. You can add a placeholder (that gets replaced by the current file's name when you save the file) and the date (or date and time) using the instructions at that link only when creating a new file, because those instructions are for creating and using a template. In the event that you want to try that, here's my version of those instructions specifically for adding the file name and date (or date and time):
====================
- Open your ~/.config/geany/templates/files directory in a file
manager (you'll need to enable the display of hidden files to get to it). 2) Create a new text file in the directory with whatever name you'd like it to have (you could create myfirsttemplate.txt as an initial experiment). Note that Geany will automatically suggest the same extension for saving files created with that template. 3) Open the file you just created in Geany. 4) Type this into it: {untitled} {date} 5) Save the file. 6) Left-click File in the toolbar. 7) Left-click New (with Template) in the menu. 8) Left-click the name of your template. A new file will be created with untitled on the first line and the date on the second line. The cursor will be blinking at the beginning of the first line. 9) Use the arrow keys or the mouse to move the cursor below the two automatically inserted lines of text. 10) Press the Enter key *or* type something inside the file and press the Enter key. (Note: The Enter key is vital to Geany for some reason
- it will not replace the wildcard without a press of that key.)
- Left-click File in the toolbar.
- Left-click Save As in the menu.
- Type in a name for the file.
- Left-click the Save button or press the Enter key. The untitled
wildcard will be replaced with the file's name.
Alternative: If you'd rather have the date and time, replace {date} above with {datetime}. ====================
As for keyboard shortcuts, you can press Alt + E and then press E again and then use the arrow keys to select one of the date formats to insert the date into a message.
An alternative to that would be to press Alt + T and then press M to open the mini script interface. If you had already typed date into the text area, you could click the Execute button. Or you can type date into the text area and then click the Execute button, and then from then on you won't need to type it again. Note that the mini script interface offers the option to save scripts and load them, and that's really powerful since the sky's the limit on what you can do to a file if you know how to script it. (: