dukhi_insaan's blog

By dukhi_insaan, history, 3 years ago, In English

Hello Guys,

I am working on how can I speed up the way to write code. We all are used trigger based snippet pasting.

Example : dsu — > Enter

Code

In a same way we also use if-else conditions or sometimes we want to change our #define template during the contest,

If-Else
#define

Free Tools I found till now (Windows):

1.AutoText (https://www.jitbit.com/autotext/) //I know there is already function on Sublime for it but sometimes we code on online platforms (LeetCode) so it would be helpful there.

2.Magical and other Text Expander they are for only chrome not Machine

I am just asking for If anyone knows any software which can we make dynamic code snippets or somneone could make Sublime extention for it so it would be helpful for all of us.

What I want :

Trigger : ifel(something1,something2) — > Enter

If-Else
  • Vote: I like it
  • -10
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Try this snippet

if(($1) || ($2))
{
  if(($1) && ($2))
  {

  }
  else
  {
  	if($1)
  	{

  	}
  	else
  	{
  		
  	}
  }
}
else
{

}
  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    where and how can I use tht?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Wow Perfectly what am looking for,

    Thank You so much Master <3

    Problems am still facing :

    1. Works till $1 only.

    2. Available on sublime only not for Machine as software.

    Can you help me with these problems?

    For understanding of others how its working :

    snippet

    Add this snippet in your sublime and link with any trigger you want.

    It will automatically point Textfield cursor to every place where $1 was written.

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      After entering the text for $1 press tab and it should move the selection to $2

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it +3 Vote: I do not like it

        "Ek hi to Dil hai Ivan Ji kitni baar jeetoge" it means in english "There is only one heart. How many times will you win? " <3

        Thank you so much bro

»
3 years ago, # |
Rev. 2   Vote: I like it +11 Vote: I do not like it

you overcomplicated the code for ifel

you can just do this

Spoiler