Jump to content

I just rebound scroll lock to 

System.out.println(

and I think it's pretty nice to not have to type that out. Anybody got other convenient macros for coding to share?

Pro Tip: don't use flash when taking pictures of your build; use a longer exposure instead. Prop up your camera with something (preferably a tripod) if necessary.

if you use retarded/autistic/etc to mean stupid please gtfo

Link to comment
https://linustechtips.com/topic/471440-programming-macros/
Share on other sites

Link to post
Share on other sites

Kind of depends on what you're doing really. Just set a macro for what you write most :)

Case: NZXT Phantom PSU: EVGA G2 650w Motherboard: Asus Z97-Pro (Wifi-AC) CPU: 4690K @4.2ghz/1.2V Cooler: Noctua NH-D15 Ram: Kingston HyperX FURY 16GB 1866mhz GPU: Gigabyte G1 GTX970 Storage: (2x) WD Caviar Blue 1TB, Crucial MX100 256GB SSD, Samsung 840 SSD Wifi: TP Link WDN4800

 

Donkeys are love, Donkeys are life.                    "No answer means no problem!" - Luke 2015

 

Link to comment
https://linustechtips.com/topic/471440-programming-macros/#findComment-6321288
Share on other sites

Link to post
Share on other sites

Aren't you missing a ")"?

 

I might just not be awake enough to program.

yea he is, as well as a semicolon, but i'm assuminh OP just writes that later

Case: NZXT Phantom PSU: EVGA G2 650w Motherboard: Asus Z97-Pro (Wifi-AC) CPU: 4690K @4.2ghz/1.2V Cooler: Noctua NH-D15 Ram: Kingston HyperX FURY 16GB 1866mhz GPU: Gigabyte G1 GTX970 Storage: (2x) WD Caviar Blue 1TB, Crucial MX100 256GB SSD, Samsung 840 SSD Wifi: TP Link WDN4800

 

Donkeys are love, Donkeys are life.                    "No answer means no problem!" - Luke 2015

 

Link to comment
https://linustechtips.com/topic/471440-programming-macros/#findComment-6321291
Share on other sites

Link to post
Share on other sites

Aren't you missing a ")"?

 

I might just not be awake enough to program.

I use Sublime Text, which automatically puts close brackets & parentheses, so after typing this the parentheses are closed and my cursor is between them, ready to insert strings.

Pro Tip: don't use flash when taking pictures of your build; use a longer exposure instead. Prop up your camera with something (preferably a tripod) if necessary.

if you use retarded/autistic/etc to mean stupid please gtfo

Link to comment
https://linustechtips.com/topic/471440-programming-macros/#findComment-6321344
Share on other sites

Link to post
Share on other sites

Are you not using an IDE? I know that in eclipse, you can type "sysout" then hit CTRL + SPACE and it will output System.out.println(); and place your cursor in the parenthesis. Same goes for "main" + CTRL + SPACE. It will give you a main method.

 

Just letting you know for this particular example. It'd be nice to hear if there are some useful macros.

 

edit:

 

In Sublime if you type "pl" and hit enter, it will give you System.out.println();

 

Sublime Text 3 has this feature for Java and other popular languages by default, and there are also plugins for more functionality as well.

CPU: i7-4790K --- HEATSINK: NZXT Kraken X61 --- MOBO: Asus Z97-A --- GPU: GTX 970 Strix --- RAM: 16GB ADATA XPG --- SSD: 512GB MX100 | 256GB BX200 HDD: 1TB WD Black --- PSU: EVGA SuperNova G2 --- CASE: NZXT H440 --- DISPLAY3 x Dell U2414H --- KEYBOARD: Pok3r (Clears) --- MOUSE: Logitech G Pro --- OS: Windows 10

Link to comment
https://linustechtips.com/topic/471440-programming-macros/#findComment-6321351
Share on other sites

Link to post
Share on other sites

In Sublime if you type "pl" and hit enter, it will give you System.out.println();

sublime y u so good

 

1 button is still better than 3 tho

Pro Tip: don't use flash when taking pictures of your build; use a longer exposure instead. Prop up your camera with something (preferably a tripod) if necessary.

if you use retarded/autistic/etc to mean stupid please gtfo

Link to comment
https://linustechtips.com/topic/471440-programming-macros/#findComment-6321355
Share on other sites

Link to post
Share on other sites

Since you're using Sublime I would suggest look into snippets! They're like key macros in terms of functionality but the total number you can have isn't limited to the number of key combinations you can make with your keyboard (so you can use a 60% or 40% like a real programmer :P). Once setup snippets allows you to type a string, say "fun()," and then you either get a list of options to complete to or it'll autocomplete to something more valuable like "function() { }" with your cursor inside the parenthesis. You can also setup snippets which automatically inject the output from a command into a portion, it's a really wonderful and powerful tool. This video's directed towards Vim but everything covered can be done in Sublime text.

 

http://vimcasts.org/episodes/meet-ultisnips/

"Unix was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." - Doug Gwyn

Link to comment
https://linustechtips.com/topic/471440-programming-macros/#findComment-6336831
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×