Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add snippets for .bat (cmd) files #598

Open
EmilyGraceSeville7cf opened this issue Jun 9, 2022 · 0 comments
Open

Add snippets for .bat (cmd) files #598

EmilyGraceSeville7cf opened this issue Jun 9, 2022 · 0 comments

Comments

@EmilyGraceSeville7cf
Copy link

EmilyGraceSeville7cf commented Jun 9, 2022

I suggest add the following snippets (I use Visual Studio Code syntax, but it must be translated to Visual Studio one).

All snippets describe commands without any additional flags.

Conditions

  • trigger: if ([if])
    if ${operand1} ${operator|==,equ,neq,lss,leq,gtr,geq|} ${operand2} ${command}$0
    
  • trigger: ifc ([if] [c]omplex)
    if ${operand1} ${operator|==,equ,neq,lss,leq,gtr,geq|} ${operand2} (
      ${command}$0
    )
    
  • trigger: ife ([if] [e]lse)
    if ${operand1} ${operator|==,equ,neq,lss,leq,gtr,geq|} ${operand2} ${command1} else ${command2}$0
    
  • trigger: ifec ([if] [e]lse [c]omplex)
    if ${operand1} ${operator|==,equ,neq,lss,leq,gtr,geq|} ${operand2} (
      ${command1}$0
    ) else (
      ${command2}
    )
    

Loops

  • trigger: fo ([fo]r)
    for %%${item} in (${files}) do ${command}$0
    
  • trigger: foc ([fo]r [c]omplex)
    for %%${item} in (${files}) do (
      ${command}$0
    )
    

"Functions"

  • trigger: fu ([fu]nction)
    :${name}
      ${command}$0
    exit /b 0
    
@EmilyGraceSeville7cf EmilyGraceSeville7cf changed the title Snippets for .bat (cmd) files Add snippets for .bat (cmd) files Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant