# Snippets

A snippet is a piece of code that you want to save for later use.

# Adding a Snippet

Follow one of the following steps:

  • Select "File" > "New Snippet" from the menu bar.
  • Click "+" button opposite the search in second column.
  • Press Cmd+N on macOS or Ctrl+N on Windows or Linux.

The snippet is created in the folder that is currently selected or in "Inbox" if not.

# Language Selection

In the bottom right corner of the editor press the current snippet language, by default it is "Plain text", then select the language you need from the drop-down list.

# Moving Snippet

Drag and drop the snippet to the desired folder.

# Deleting Snippet

Call the context menu by right-clicking on the snippet and selecting "Delete".

The snippet will be moved to "Trash". Later you can return the snippet back by dragging it back to the desired folder.

# Copying Snippet

Follow one of the following steps:

  • Select "Editor" > "Copy Snippet to Clipboard" from the menu bar.
  • Press Shift+Cmd+C on macOS or Shift+Ctrl+C on Windows or Linux.

# Formatting Snippet

Snippet formatting makes the snippet code formatted.

Follow one of the following steps:

  • Select "Editor" > "Format" from the menu bar.
  • Press Shift+Cmd+F on macOS or Shift+Ctrl+F on Windows or Linux.

# Available Languages:

  • Bash / Dockerfile / Gitignore / INI /Properties
  • CSS / Sass / SCSS / Less
  • GraphQL
  • HTML
  • Jade / Pug
  • Java
  • JavaScript / TypeScript
  • JSON / JSON5
  • Markdown
  • PHP
  • TOML
  • XML
  • YAML

# Real-time Render HTML & CSS

massCode v2.9 and above supports real-time render HTML & CSS.

Follow these steps:

  • Add new snippet or select already created.
  • Add second fragment.
  • Select for fragments HTML & CSS languages.
  • Select "Editor" > "Preview Code" from the menu bar or press Shift+Cmd+P on macOS or Shift+Ctrl+P on Windows or Linux.