Snippets are a quick and easy way to share bits of code, configuration files or log files in your workspace.
Note: You can't currently create or share snippets from the Slack mobile apps.
Add a new snippet
Follow the steps below to create a snippet and share it in a conversation if you like:
From your desktop, click on the plus icon next to the message field.
Select Create a text snippet from the menu.
Enter a title if you'd like to, then choose a file type from the drop-down menu for syntax highlighting in that language.
Type or paste your snippet in the Content field.
To share your snippet, tick the box next to Share this file, select a conversation and add a message if you like.
Click Create snippet.
Tip: If you've already started typing, you can press ⌘ShiftEnter (Mac) or CtrlShiftEnter (Windows/Linux) to open a pop-up window and convert your existing text to a snippet.
View snippets in your workspace
Hover over More.
Select Files, then click on All files.
Click File type to open the drop-down menu, then select Snippets.
Edit a snippet
You can edit any snippets that you've created. Only the person who created a snippet can edit it.
Hover over the snippet that you'd like to edit.
Click the pencil icon. This will open the snippet in your browser.
Edit the snippet, then click Save changes.
Share a snippet
Sharing a snippet in Slack lets others download it, view a raw version or leave comments. You can do this when you create the snippet, or any time after.