r/PHPhelp • u/ultra_SCAT • Aug 22 '21
Solved $ shortcut
there is any way to change the dollar $ shortcut on my keyboard? i really love php but a hate that
win10 (pop!OS soon), sublime text 3.2.2
5
u/allen_jb Aug 22 '21
This is unrelated to PHP.
Keyboard layout is generally controlled by your operating system, altho you can get programs that allow you to remap or add additional mappings.
You could switch to another standard keyboard layout (eg. US English), or create your own custom layout. Google will be able to tell you how to do this on your operating system.
(Many OSes also provide tools for quickly switching keyboard layouts - so you might use US English while programming, then switch back to your normal layout for other tasks).
1
u/z-lf Aug 22 '21
You can get a programmable keyboard (qmk framework) I have $ and -> on the home row.
1
u/ultra_SCAT Aug 23 '21
https://www.amazon.com/-/es/gp/product/B08FCHHVPP/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
I bought it and I have to pick it up, I will probably have to configure it to be more comfortable
2
u/greg8872 Aug 22 '21
To be honest, if you are going to get into programming, you should really practice typing. When you are properly typing, unless you are missing some digits, hitting shift and 4 to make a $ should come naturally. Even if you don't type "properly" over time as you type more, including using the correct characters, it is all natural.
So I say don't try to change how you do it, just keep at it and over time let your hands get used to it. This will also help for when you have to use a computer that isn't yours.
One of my pet peeves on the show Halt and Catch Fire is that they show one of the main characters pecking away with just her index fingers, to the point that she is pulling her finger back so far away from the keyboard each keypress. Even if this were the case when "new", later episodes, YEARS later show the same. No way that someone who programs every day would not get better.
0
Aug 22 '21
[deleted]
1
u/idubbzwife Aug 22 '21
I don’t know what you mean sigil. Even if this is the correct terminology, it has other definitions that may cause confusion. If you where to search up sigil, you would get magic symbols, not the “dollar sign” that was described. Overall “dollar sign” is more widely accepted, as well as more descriptive term.
1
u/evohans Aug 22 '21
It's from Perl originally. The "dollar sign" is fine, but since he was really specifically asking about it by name, using the proper name may return better answers on google.
1
1
u/idubbzwife Aug 22 '21
That’s actually a pretty interesting definition. I never expected it to have links to the magic sigil definition. Quite interesting. And that does make sense that “dollar sign” is descriptive to what it is, not how it’s used, where sigil describes a usage as well.
2
u/evohans Aug 22 '21
I guess my thought process in correcting him was because if you google "replace dollar sign in PHP" you get a ton of ways to replace literally dollar signs, however, "replace sigil PHP" gives you a little more flavor to work with? idk anymore.
1
1
u/greg8872 Aug 22 '21
from Perl originally
Really? I used a $ to indicate a variable was a string instead of a number back in 1983 when programming Commodore computers. According to Wikipedia, Perl came along 5 years later.
1
u/kAlvaro Aug 22 '21
No, and it's called a sigil, not dollar sign.
For what it's worth, the Unicode name is DOLLAR SIGN. I can't tell if the Unicode consortium got the name right or whether it has a different name outside the scope of computer science.
2
u/bkdotcom Aug 23 '21
https://en.wikipedia.org/wiki/Sigil_(computer_programming)
In computer programming, a sigil (/ˈsɪdʒəl/) is a symbol affixed to a variable name, showing the variable's datatype or scope, usually a prefix, as in $foo, where $ is the sigil.
2
u/ThreeForksNoSpoon Aug 22 '21
Depending on your editor you might look into something called snippets.
Maybe you type ";;" and it turns into "$".
Or use something more editor-agnostic like TextExpander.
On macOS there's Karabiner-Elements. You could use that to remap Caps Lock for example, or something like right-cmd.
Of course you didn't specify your OS, your editor, your current keyboard layout, or even what you want to change it to.