Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revise keyboard shortcut page #4630

Merged
merged 19 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,41 +1,25 @@
---
title: "Tips and tricks"
id: dbt-cloud-tips
description: "Check out any dbt Cloud and IDE-related tips."
sidebar_label: "Tips and tricks"
title: "dbt tips and tricks"
description: "Check out any dbt-related tips and tricks to help you work faster and be more productive."
sidebar_label: "dbt tips and tricks"
pagination_next: null
---

# dbt Cloud tips

The Cloud IDE provides keyboard shortcuts, features, and development tips to help you work faster and be more productive. Use this Cloud IDE cheat sheet to help you quickly reference some common operations.

## Cloud IDE Keyboard shortcuts

There are default keyboard shortcuts that can help make development more productive and easier for everyone.

- Press Fn-F1 to view a full list of the editor shortcuts
- Command-O on macOS or Control-O on Windows to select a file to open
- Command-P/Command-Shift-P on macOS or Control-P/Control-Shift-P on Windows to see the command palette
- Hold Option-click-on-area or press Shift-Option-Command on macOS or Hold-Alt-click-on-area on Windows to select multiple lines and perform a multi-edit. You can also press Command-E to perform this operation on the command line.
- Command-Enter on macOS or Control-Enter on Windows to Preview your code
- Command-Shift-Enter on macOS or Control-Shift-Enter on Windows to Compile
- Highlight a portion of code and use the above shortcuts to Preview or Compile code
- Enter two underscores (__) in the IDE to reveal a list of dbt functions
- Press Control-backtick (or Ctrl + `) to toggle the Invocation history
- Press Command-Option-forward slash on macOS or Control-Alt-forward slash on Windows on the selected code to add a block comment. SQL files will use the Jinja syntax `({# #})` rather than the SQL one `(/* */)`. Markdown files will use the Markdown syntax `(<!-- -->)`
- Option-W on macOS or Alt-W on Windows will close the currently active editor tab
Use this page to learn about any dbt-related tips and tricks to help you work faster and be more productive.

You can also learn about the default dbt Cloud IDE [keyboard shortcuts](/docs/cloud/dbt-cloud-ide/keyboard-shortcuts) to help make development more productive and easier for everyone.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The language here coupled with the sentence above makes it seem like the keyboard shortcuts should be on this page, but the link opens a new page. Might be beneficial to clarify that.

This is probably a project for another day, but this page feels really disjointed. There's no flow or sense to the information. Maybe long term this could be broken up and put in the FAQs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tweaked it a little and added more context. however, feel free to open up an issue so we address this later!


## Package tips

- Use the [dbt_codegen](https://hub.getdbt.com/dbt-labs/codegen/latest/) package to help you generate YML files for your models and sources and SQL files for your staging models.
- The [dbt_utils](https://hub.getdbt.com/dbt-labs/dbt_utils/latest/) package contains macros useful for daily development. For example, `date_spine` generates a table with all dates between the ones provided as parameters.
- The [dbt_project_evaluator](https://hub.getdbt.com/dbt-labs/dbt_project_evaluator/latest) package compares your dbt project against a list of our best practices and provides suggestions and guidelines on how to update your models.
- The [dbt_expectations](https://hub.getdbt.com/calogica/dbt_expectations/latest) package contains many tests beyond those built into dbt Core.
- The [dbt_audit_helper](https://hub.getdbt.com/#:~:text=adwords-,audit_helper,-codegen) package lets you compare the output of 2 queries. Use it when refactoring existing logic to ensure that the new results are identical.
- The [dbt_artifacts](https://hub.getdbt.com/brooklyn-data/dbt_artifacts/latest) package saves information about your dbt runs directly to your data platform so that you can track the performance of models over time.
- The [dbt_meta_testing](https://hub.getdbt.com/tnightengale/dbt_meta_testing/latest) package checks that your dbt project is sufficiently tested and documented.
| Package | Description |
|---------|-------------|
| [`dbt_codegen`](https://hub.getdbt.com/dbt-labs/codegen/latest/) |Use the package to help you generate YML files for your models and sources and SQL files for your staging models. |
| [`dbt_utils`](https://hub.getdbt.com/dbt-labs/dbt_utils/latest/) | The package contains macros useful for daily development. For example, `date_spine` generates a table with all dates between the ones provided as parameters. |
| [`dbt_project_evaluator`](https://hub.getdbt.com/dbt-labs/dbt_project_evaluator/latest) | The package compares your dbt project against a list of our best practices and provides suggestions and guidelines on how to update your models. |
| [`dbt_expectations`](https://hub.getdbt.com/calogica/dbt_expectations/latest) | The package contains many tests beyond those built into dbt. |
| [`dbt_audit_helper`](https://hub.getdbt.com/#:~:text=adwords-,audit_helper,-codegen) | The package lets you compare the output of 2 queries. Use it when refactoring existing logic to ensure that the new results are identical. |
| [`dbt_artifacts`](https://hub.getdbt.com/brooklyn-data/dbt_artifacts/latest) | The package saves information about your dbt runs directly to your data platform so that you can track the performance of models over time. |
| [`dbt_meta_testing`](https://hub.getdbt.com/tnightengale/dbt_meta_testing/latest) | This package checks that your dbt project is sufficiently tested and documented. |

## Advanced tips

Expand All @@ -61,4 +45,4 @@ There are default keyboard shortcuts that can help make development more product

- [Quickstart guide](/guides)
- [About dbt Cloud](/docs/cloud/about-cloud/dbt-cloud-features)
- [Develop in the Cloud](/docs/cloud/dbt-cloud-ide/develop-in-the-cloud)
- [Develop in the Cloud](/docs/cloud/about-develop-dbt)
2 changes: 1 addition & 1 deletion website/docs/docs/cloud/about-cloud/about-cloud-ide.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ For more information, read the complete [Cloud IDE guide](/docs/cloud/dbt-cloud-
## Related docs

- [IDE user interface](/docs/cloud/dbt-cloud-ide/ide-user-interface)
- [Tips and tricks](/docs/cloud/dbt-cloud-ide/dbt-cloud-tips)
- [Keyboard shortcuts](/docs/cloud/dbt-cloud-ide/keyboard-shortcuts)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pagination_prev: null

The dbt Cloud integrated development environment (IDE) is a single web-based interface for building, testing, running, and version-controlling dbt projects. It compiles dbt code into SQL and executes it directly on your database.

The dbt Cloud IDE offers several [editing features](/docs/cloud/dbt-cloud-ide/ide-user-interface#editing-features) for faster and more efficient data platform development and governance:
The dbt Cloud IDE offers several [keyboard shortcuts](/docs/cloud/dbt-cloud-ide/keyboard-shortcuts) and [editing features](/docs/cloud/dbt-cloud-ide/ide-user-interface#editing-features) for faster and more efficient data platform development and governance:

- Syntax highlighting for SQL: Makes it easy to distinguish different parts of your code, reducing syntax errors and enhancing readability.
- Auto-completion: Suggests table names, arguments, and column names as you type, saving time and reducing typos.
Expand Down Expand Up @@ -44,7 +44,7 @@ To improve your experience using dbt Cloud, we suggest that you turn off ad bloc

## dbt Cloud IDE features

The dbt Cloud IDE comes with [tips](/docs/cloud/dbt-cloud-ide/dbt-cloud-tips) and [features](/docs/cloud/dbt-cloud-ide/ide-user-interface) that make it easier for you to develop, build, compile, run, and test data models.
The dbt Cloud IDE comes with [tips](/docs/build/dbt-tips) and [features](/docs/cloud/dbt-cloud-ide/ide-user-interface) that make it easier for you to develop, build, compile, run, and test data models.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is nothing on the tips page that points out anything related to the IDE. Maybe this should be the keyboard shortcuts link?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ive tweaked this too but the features table does have the keyboard shortcut on the first line and the tips page does have the ide shortcuts linked -- wondering how come it didn't show up for you?
Screenshot 2023-12-18 at 12 08 08


:::tip Stay informed

Expand All @@ -54,7 +54,7 @@ To stay informed on IDE updates, read [dbt Cloud IDE release notes](/tags/ide),

| Feature | Info |
|---|---|
| **Keyboard shortcuts** | You can access a variety of [commands and actions](/docs/cloud/dbt-cloud-ide/dbt-cloud-tips#cloud-ide-keyboard-shortcuts) in the IDE by choosing the appropriate keyboard shortcut. This includes the command palette (Command-P or Control-P), which has common shortcuts and build commands to optimize your developer workflow. For example, you can build modified models or continue the build from the last failure point. |
| **Keyboard shortcuts** | You can access a variety of [commands and actions](/docs/cloud/dbt-cloud-ide/keyboard-shortcuts) in the IDE by choosing the appropriate keyboard shortcut. This includes the command palette (Command-P or Control-P), which has common shortcuts and build commands to optimize your developer workflow. For example, you can build modified models or continue the build from the last failure point. |
| **File state indicators** | Ability to see when changes or actions have been made to the file. The indicators **M, D, A,** and **•** appear to the right of your file or folder name and indicate the actions performed: <br /> <br /> - Unsaved **(•)** &mdash; The IDE detects unsaved changes to your file/folder<br /> - Modification **(M)** &mdash; The IDE detects a modification of existing files/folders<br /> - Added **(A)** &mdash; The IDE detects added files<br/> - Deleted **(D)** &mdash; The IDE detects deleted files.
| **IDE version control** | The IDE version control section and git button allow you to apply the concept of [version control](/docs/collaborate/git/version-control-basics) to your project directly into the IDE. <br /><br /> - Create or change branches<br /> - Commit or revert individual files by right-clicking the edited file<br /> - [Resolve merge conflicts](/docs/collaborate/git/merge-conflicts)<br /> - Execute git commands using the git button <br /> - Link to the repo directly by clicking the branch name |
| **Project documentation** | Generate and view your [project documentation](/docs/collaborate/build-and-view-your-docs) for your dbt project in real-time. You can inspect and verify what your project's documentation will look like before you deploy your changes to production. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The IDE features some delightful tools and layouts to make it easier for you to

1. **File Editor &mdash;** The File Editor is where users edit code. Tabs break out the region for each opened file, and unsaved files are marked with a blue dot icon in the tab view.

* Use intuitive [keyboard shortcuts](/docs/cloud/dbt-cloud-ide/dbt-cloud-tips#cloud-ide-keyboard-shortcuts) to help develop easier for you and your team.
* Use intuitive [keyboard shortcuts](/docs/cloud/dbt-cloud-ide/keyboard-shortcuts) to help develop easier for you and your team.

2. **Save button &mdash;** The editor has a **Save** button that saves editable files. Pressing the button or using the Command-S or Control-S shortcut saves the file contents. You don't need to save to preview code results in the Console section, but it's necessary before changes appear in a dbt invocation. The File Editor tab shows a blue icon for unsaved changes.

Expand Down
29 changes: 29 additions & 0 deletions website/docs/docs/cloud/dbt-cloud-ide/keyboard-shortcuts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: "dbt Cloud IDE keyboard shortcuts"
description: "Learn about the keyboard shortcuts available in the Cloud IDE."
sidebar_label: "Keyboard shortcuts"
---


The Cloud IDE provides keyboard shortcuts, features, and development tips to help you work faster and be more productive.

Use this dbt Cloud IDE page to help you quickly reference some common operations.

| Shortcut description | macOS | Windows |
|--------|----------------|------------------|
| View a full list of editor shortcuts | Fn-F1 | Fn-F1 |
| Select a file to open | Command-O | Control-O |
| Open the command palette to invoke dbt commands and actions | Command-P or Command-Shift-P | Control-P or Control-Shift-P |
| Multi-edit by selecting multiple lines | Option-click or Shift-Option-Command | Hold Alt and click |
| Preview code | Command-Enter | Control-Enter |
| Compile code | Command-Shift-Enter | Control-Shift-Enter |
| Reveal a list of dbt functions | Enter two underscores `__` | Enter two underscores `__` |
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
| Toggle open the [Invocation history drawer](/docs/cloud/dbt-cloud-ide/ide-user-interface#invocation-history) located on the bottom of the IDE. | Control-backtick (or Control + `) | Control-backtick (or Ctrl + `) |
| Add a block comment to selected code. SQL files will use the Jinja syntax `({# #})` rather than the SQL one `(/* */)`.<br /> <br /> Markdown files will use the Markdown syntax `(<!-- -->)` | Command-Option-/ | Control-Alt-/ |
| Close the currently active editor tab | Option-W | Alt-W |

## Related docs

- [Quickstart guide](/guides)
- [About dbt Cloud](/docs/cloud/about-cloud/dbt-cloud-features)
- [Develop in the Cloud](/docs/cloud/dbt-cloud-ide/develop-in-the-cloud)
2 changes: 1 addition & 1 deletion website/docs/docs/cloud/dbt-cloud-ide/lint-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,4 @@ Make sure you're on a development branch. Formatting or Linting isn't available
## Related docs

- [User interface](/docs/cloud/dbt-cloud-ide/ide-user-interface)
- [Tips and tricks](/docs/cloud/dbt-cloud-ide/dbt-cloud-tips)
- [Keyboard shortcuts](/docs/cloud/dbt-cloud-ide/keyboard-shortcuts)
3 changes: 2 additions & 1 deletion website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ const sidebarSettings = {
link: { type: "doc", id: "docs/cloud/dbt-cloud-ide/develop-in-the-cloud" },
items: [
"docs/cloud/dbt-cloud-ide/develop-in-the-cloud",
"docs/cloud/dbt-cloud-ide/keyboard-shortcuts",
"docs/cloud/dbt-cloud-ide/ide-user-interface",
"docs/cloud/dbt-cloud-ide/lint-format",
"docs/cloud/dbt-cloud-ide/dbt-cloud-tips",
],
},
],
Expand All @@ -259,6 +259,7 @@ const sidebarSettings = {
link: { type: "doc", id: "docs/build/projects" },
items: [
"docs/build/projects",
"docs/build/dbt-tips",
{
type: "category",
label: "Build your DAG",
Expand Down
5 changes: 5 additions & 0 deletions website/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"cleanUrls": true,
"trailingSlash": false,
"redirects": [
{
"source": "/docs/cloud/dbt-cloud-ide/dbt-cloud-tips",
"destination": "/docs/build/dbt-tips",
"permanent": true
},
{
"source": "/docs/dbt-cloud-apis/discovery-schema-job-metric",
"destination": "/docs/dbt-cloud-apis/discovery-schema-environment",
Expand Down
Loading