Create a snippet
Snippets are a quick, easy way to share bits of code, configuration files, or log files with your workspace.
Note: You can't currently create or share snippets in our mobile apps.
Add a new snippet
Follow the steps below to create a snippet from the desktop app and share it in a channel or direct message (DM):
- Click the lightning bolt icon to the left of the message field to open the shortcuts menu.
- Below Slack, click Create code or text snippet.
- Enter a title if you'd like, then choose a file type from the drop-down menu.
- When you're finished, click Create Snippet to post your 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.
Share a snippet
Sharing a snippet in Slack lets your members download it, view a raw version, or leave comments. You can do this when you create the snippet, or any time after.
- Hover over a snippet, then click Share file.
- Below Share with, choose a channel or DM from the drop-down menu.
- Click Share to post your snippet.
Edit a snippet
Find your snippets
- Click Files in the left sidebar. If you don't see this option, click More to find it.
- Select Filter in the top-right corner of the screen.
- Click All file types to open the drop-down menu, then select Snippets.
Note: You can only edit snippets that you have created.
Edit your snippet
- Hover over the snippet you'd like to edit.
- Click the pencil icon. This will open the snippet in your browser.
- Edit the snippet, then click Save Changes.
Note: Unlike posts, you cannot have multiple editors for one snippet.