{
"Twig Include": {
"prefix": "tinclude",
"body": [
"{% include \"@${1:atoms/text/headings/_heading.twig}\" ${2:with {",
" ${3:heading_level}: '${4:3}',",
" ${5:heading_blockname}: ${6:component}__base_class,$0",
"\\} }%}"
]
}
}
{
"Twig Embed": {
"prefix": "tembed",
"body": [
"{% embed \"@${1:atoms/text/headings/_heading.twig}\" ${2:with {",
" ${3:something}: ${4:awesome},$0",
"\\} }%}",
" {% block ${5:super} %}",
" ${6:{{ cool \\}\\}}",
" {% endblock %}",
"{% endembed %}"
]
}
}
{
"Twig Extends": {
"prefix": "textends",
"body": [
"{% extends \"@${1:templates/_default.twig} %}",
" {% block ${2:page_content} %}",
" ${3:{{ content \\}\\}}",
" {% endblock %}"
]
}
}
{
"Twig Set": {
"prefix": "tset",
"body": [
"{% set ${1:something} ${2:= ${3:awesome} }%}",
"$0",
]
}
}
{
"Twig If": {
"prefix": "tif",
"body": [
"{% if ${1:something} ${2:== ${3:awesome} }%}",
" ${4:{{ do stuff \\}\\}}",
"{% endif %}",
]
}
}
{
"Twig for loop": {
"prefix": "tfor",
"body": [
"{% for ${1:item} in ${2:items} %}",
" ${3:{{ item.content \\}\\}}$0",
"{% endfor %}",
]
}
}
{
"Twig Block": {
"prefix": "tblock",
"body": [
"{% block ${1:block} %}",
" ${2:{{ content \\}\\}}",
"{% endblock %}"
]
}
}
{
"Element with BEM class naming": {
"prefix": "ebem",
"body": [
"<${1:div} {{ bem(${3:$2__base_class}${4:, [$5]${6:, $2__base_class}}) }}>",
" $0",
"</$1>",
]
}
}
{
//////////////////////////////
// VS Code Interface Tweaks //
//////////////////////////////
// Disable breadcrumbs
"breadcrumbs.enabled": false,
// Make the cursor solid at all times (disables blinking)
"editor.cursorBlinking": "solid",
// Disable the minimap
"editor.minimap.enabled": false,
// Show rulers at 80 and 100 character
"editor.rulers": [
80,
100
],
// Alsways show the folding controls
"editor.showFoldingControls": "always",
// Hides the Editor, Search, Extenstions, etc. bar.
// You can still get to them via hot-keys or the "View" menu
"workbench.activityBar.visible": false,
// My preferred theme
"workbench.colorTheme": "One Dark Pro",
// Hide the close button on tabs to condense them a bit
"workbench.editor.tabCloseButton": "off",
// Condense the tabs at the top just a bit
"workbench.editor.tabSizing": "shrink",
// Material theme icons
"workbench.iconTheme": "material-icon-theme",
// Enables horizontal scrolling in the sidebar
"workbench.list.horizontalScrolling": true,
// Add the path to the file in the window title
"window.title": "${activeEditorMedium}${separator}${rootName}",
// Starts up new windows with a new untitled file
"workbench.startupEditor": "newUntitledFile",
//////////////////////////
// Code Writing Helpers //
//////////////////////////
// Enable auto-closing of tags in all file types
"auto-close-tag.activationOnLanguage": [
"*"
],
// Set tabs to equal two spaces
"editor.tabSize": 2,
// Tell emmet to work on .js files (not just when specified as react)
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
// Tell emmet to use single quotes
"emmet.syntaxProfiles": {
"jsx": {
"attr_quotes": "single"
}
},
/////////////////////////////////
// Code Linting and Formatting //
/////////////////////////////////
// Style linting //
// Disable VS Code's validation of css, less, and scss because we're using Stylelint
// (This just prevents duplicate reports in the log)
"css.validate": false,
"less.validate": false,
"scss.validate": false,
// Tell Stylelint to autofix on Save
"stylelint.autoFixOnSave": true,
// JS linting
// Disable format of save for JS and JSX, we will do this via eslint
// "[javascript]": {
// "editor.formatOnSave": false,
// },
// "[javascriptreact]": {
// "editor.formatOnSave": false
// },
// Turn on Auto Fix for all providers (including eslint)
"editor.codeActionsOnSave": {
"source.fixAll": true
},
// General linting/formatting
// Format on Paste
"editor.formatOnPaste": true,
// Format on Save
"editor.formatOnSave": true,
// Format on Type
"editor.formatOnType": true,
// Insert a final newline
"files.insertFinalNewline": true,
// Remove additional newlines after the "final" one
"files.trimFinalNewlines": true,
// Trim any whitespace at the end of lines
"files.trimTrailingWhitespace": true,
//////////////////////
// User Preferences //
//////////////////////
// Custom dictionary
"cSpell.userWords": [
"endblock",
"endembed",
"nypl",
"stylelint"
],
// Don't confirm when deleting files in the explorer
"explorer.confirmDelete": false,
// Don't confirm when dragging and dropping files in the explorer
"explorer.confirmDragAndDrop": false,
// Associate extensions with languates
"files.associations": {
"*.theme": "php",
"*.module": "php",
"*.css": "postcss"
},
// Use iTerm when opening current project in terminal (Cmd + Shift + C)
"terminal.external.osxExec": "iTerm.app",
// The window zoom level
"window.zoomLevel": 0,
}