Skip to content

VS Code snippets specially made with workflow at 42 in mind

Notifications You must be signed in to change notification settings

DimitriDaSilva/42_snippets_vscode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42_snippets_vscode

If you use VS Code at 42, this will probably interest you! 🔥
I had a bit of fun creating custom snippets to improve my workflow at 42 🤓 and wanted to share them with the 42 community! 🤗

Setting up the snippets

You'll simply need to copy the snippet files in your computer. Yes, that's about it. 👌

Depending on your OS, your user snippets are located here:

  • Windows: %APPDATA%\Code\User\snippets
  • Mac: $HOME/Library/Application Support/Code/User/snippets
  • Linux: $HOME/.config/Code/User/snippets

WARNING ⚠️: if you already have custom snippets for .c files or for .h files, executing the commands below will overwrite them. So you'll have to copy them manually.

To quickly copy these sweet snippets, execute the upload command for your OS:

  • Mac: sh upload_mac.sh
  • Linux: sh upload_linux.sh

Snippets for .c files

42_new_comment

What it does: creates a Norminette-approved boilerplate to comment a function. No more excuses not to comment your code 👀
Prefixes to use it: new_comment or nc

image

main

What it does: creates a boilerplate main to help you during your intense debugging section 🐛
Prefixes to use it: main or int main

image

printf_w_var_name

What it does: creates a printf statement with the variable name you have on your clipboard. You just have to input its type and you are all set to find your bug 🐛
Prefixes to use it: printf_w_var_name

image

printf_w_func_name

What it does: creates a printf statement with the name of your file (e.g. in ft_itoa.c see below)
Prefixes to use it: printf_w_func_name

image

printf_wo_func_name

What it does: creates a simple boiler-plate printf statement
Prefixes to use it: printf_wo_func_name image

includes_custom

What it does: adds an include with the same header file name as your current file (e.g. in ft_test.c: #include "ft_test.h")
Prefixes to use it: include_custom or ic

includes_libft

What it does: simply adds #include "libft.h
Prefixes to use it: include_libft or il

Snippets for .h files

42_new_header_file

What it does: creates the boiler-plate ifndef define endif based on the name of your file
Prefixes to use it: new_header_file or nhf

image

Resources

If you want to tweak these snippets to your liking or even create brand new ones, here are ressources to help you!

Have fun with it!

About

VS Code snippets specially made with workflow at 42 in mind

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages