Suppose I have a constant template which is highly frequency typed ,
how could I generate a Shortcut Key which would type this template each time I hit that Shortcut Key ?
For eample -
I have the template -
<?php echo $myObj->getValue('arg1'); ?>
and I want each press on Shortcut Key Ctrl+c+f would paste the above template .
I do not know if this can have a direct shortcut, but you can insert such code with ctrl+j cursor and enter
For that you need to go to
File -> Settings -> Live Templates
Add another one for your needs. Bonus this way is, you can make a tab stop at the position of arg1 and quickly change that on every insert.
Related
Is there a shortcut for PhpStorm (or other JetBrains IDE, they're likely to be the same) that will automagically fill in default parameter values for method calls?
IE, I'm typing in:
$form->generateSelectBox("weekly_snapshot_id", "Weekly snapshot", ...loads of default values here..., "value I actually wanted to set");
and I'd actually just like to type:
$form->generateSelectBox("weekly_snapshot_id", "Weekly snapshot");
put the cursor inside the argument list and hit CTRL + WHATEVS and get ...loads of default values here... automagically completed for me.
Haven't found anything in the dox, google or previous questions that might do this, some tantalising hints about IntelliJ plugins that did this out there but nothing for PhpStorm specifically.
Screenshot as requested: (I select 'params' not cust_id)
You'll be able to do that via Ctrl+Space suggestion list starting PhpStorm version 2019.2: https://youtrack.jetbrains.com/issue/WI-45683
Is it possible to create PhpStorm shortcut through double keystrokes? For example by pressing f character twice.
create every arbitrary shortcut is possible via autoHotKey . for my case create a comma.ahk script with the code below:
:*:ff::
send, {end},{enter}
Return
then run the script. that enough to make you free from going to end of line ,press the comma key and at last going to a new line!
In my project file extension is .ttcn and all the function in that file start with testcase name_of_the_function.
Is there any Sublime plugin exist that can list all the function that is start with keyword testcase followed by test case name?
FYI, most of the common programming languages sublime list all the functions name with shortcut ctrl'r. Thanks in advance for any suggestion or recommendation !
You can use the Find in Files functionality (Find -> Find in Files...). In the Find: field, make sure the first button (Regex) is selected, as well as the last two (Context and Use Buffer), then enter ^testcase. Add the directory you'd like to search in the Where: field, and make sure the Replace: field is empty. Hit the Find button, and a new tab will open showing all lines that begin with testcase.
I downloaded this project:
http://vikku.info/programming/google-maps-v3/draggable-directions/saving-draggable-directions-saving-waypoints-google-directions-google-maps-v3.htm
To se how to save waypoints, I opened, the html, and tryied to save the waypoint, but it don't work, I dont know if i need to do something in SQL or not, I just tryied to make it works, please help me if you had sucess to make it works.
You have to:
create a DB with the name mapdir
create a table with the name mapdir inside this DB, the table should have only 1 field named value with the type text (there is a file mapdir.sql inside the ZIP-file, you may use it to create the table)
inside process.php you must edit line#5 and set the correct values for mysql_connect(servername,username,password)
You also should change process.php,Line#3 to
#$data = $_REQUEST['mapdata'];
....otherwise you later will not be able to load the waypoints when error_reporting is on.
But however, I wouldn't suggest to use this project like it is, there isn't any protection against SQL-injection.
In Vim 7, Ctrl-X Ctrl-O shows a list of possible values but I find this sequence of keys to be too long when I frequently use the autocomplete feature. For instance, in an HTML file, I'd like to see the list automatically popup after I type a < followed by one or two letters. In a CSS file, I'd like to see the list after I hit the ":" key. Is there a way to set this up?
To activate the omnicompletion on typing a ":" you can use
the following mapping.
imap : :<c-x><c-o>
The disadvantage is that each time you press ":" omnicompletion will
be activated, even when typing ":" in comments or in any other context
in which you do not want omnicompletion.
I have mapped ctrl-space to active omnicompletion:
imap <c-space> <c-x><c-o>
This gives me the choice to activate omni whenever I need it.
Another alternative that I found easier is just to press tab two times when you want autocomplete, and one time for regular tab.
Add the following line to your ~/.vimrc
imap <tab><tab> <c-x><c-o>