Back to Notes

How To

Setting Up Quick Open for Zed Editor (in terminal)

October 6, 2024
0min read

This guide will help you set up a feature similar to VS Code's "." (dot) command, which opens the current directory in the editor, but for the Zed code editor.

Steps

  1. Open your shell configuration file:

    • For Bash: ~/.bashrc or ~/.bash_profile

    • For Zsh: ~/.zshrc

  2. Add the following function to the file:

    zed() { if [[ $# -eq 0 ]]; then /path/to/zed . else /path/to/zed "$@" fi }

    Replace /path/to/zed with the actual path to your Zed executable. You can find this by running which zed in your terminal.

  3. Save the file.

  4. Reload your shell configuration:

    • For Bash: source ~/.bashrc or source ~/.bash_profile

    • For Zsh: source ~/.zshrc

  5. (Optional) To make it even more similar to the VS Code "." feature, add this alias after the function:

    alias .='zed .'

  6. Save and reload your configuration again.

Usage

  • To open Zed with the current directory: zed or . (if you added the alias)

  • To open Zed with specific files or directories: zed [path]

Troubleshooting

If the command doesn't work:

  • Make sure you've correctly identified the path to your Zed executable.

  • Check that you've saved the changes to the correct configuration file.

  • Ensure you've reloaded your shell configuration after making changes.

For any issues, reach out to me or consult the Zed documentation or community forums.

Thanks for reading, Glen ❇️

Steps

  1. Open your shell configuration file:

    • For Bash: ~/.bashrc or ~/.bash_profile

    • For Zsh: ~/.zshrc

  2. Add the following function to the file:

    zed() { if [[ $# -eq 0 ]]; then /path/to/zed . else /path/to/zed "$@" fi }

    Replace /path/to/zed with the actual path to your Zed executable. You can find this by running which zed in your terminal.

  3. Save the file.

  4. Reload your shell configuration:

    • For Bash: source ~/.bashrc or source ~/.bash_profile

    • For Zsh: source ~/.zshrc

  5. (Optional) To make it even more similar to the VS Code "." feature, add this alias after the function:

    alias .='zed .'

  6. Save and reload your configuration again.

Usage

  • To open Zed with the current directory: zed or . (if you added the alias)

  • To open Zed with specific files or directories: zed [path]

Troubleshooting

If the command doesn't work:

  • Make sure you've correctly identified the path to your Zed executable.

  • Check that you've saved the changes to the correct configuration file.

  • Ensure you've reloaded your shell configuration after making changes.

For any issues, reach out to me or consult the Zed documentation or community forums.

Thanks for reading, Glen ❇️

Steps

  1. Open your shell configuration file:

    • For Bash: ~/.bashrc or ~/.bash_profile

    • For Zsh: ~/.zshrc

  2. Add the following function to the file:

    zed() { if [[ $# -eq 0 ]]; then /path/to/zed . else /path/to/zed "$@" fi }

    Replace /path/to/zed with the actual path to your Zed executable. You can find this by running which zed in your terminal.

  3. Save the file.

  4. Reload your shell configuration:

    • For Bash: source ~/.bashrc or source ~/.bash_profile

    • For Zsh: source ~/.zshrc

  5. (Optional) To make it even more similar to the VS Code "." feature, add this alias after the function:

    alias .='zed .'

  6. Save and reload your configuration again.

Usage

  • To open Zed with the current directory: zed or . (if you added the alias)

  • To open Zed with specific files or directories: zed [path]

Troubleshooting

If the command doesn't work:

  • Make sure you've correctly identified the path to your Zed executable.

  • Check that you've saved the changes to the correct configuration file.

  • Ensure you've reloaded your shell configuration after making changes.

For any issues, reach out to me or consult the Zed documentation or community forums.

Thanks for reading, Glen ❇️

Steps

  1. Open your shell configuration file:

    • For Bash: ~/.bashrc or ~/.bash_profile

    • For Zsh: ~/.zshrc

  2. Add the following function to the file:

    zed() { if [[ $# -eq 0 ]]; then /path/to/zed . else /path/to/zed "$@" fi }

    Replace /path/to/zed with the actual path to your Zed executable. You can find this by running which zed in your terminal.

  3. Save the file.

  4. Reload your shell configuration:

    • For Bash: source ~/.bashrc or source ~/.bash_profile

    • For Zsh: source ~/.zshrc

  5. (Optional) To make it even more similar to the VS Code "." feature, add this alias after the function:

    alias .='zed .'

  6. Save and reload your configuration again.

Usage

  • To open Zed with the current directory: zed or . (if you added the alias)

  • To open Zed with specific files or directories: zed [path]

Troubleshooting

If the command doesn't work:

  • Make sure you've correctly identified the path to your Zed executable.

  • Check that you've saved the changes to the correct configuration file.

  • Ensure you've reloaded your shell configuration after making changes.

For any issues, reach out to me or consult the Zed documentation or community forums.

Thanks for reading, Glen ❇️

Get in touch

Seeking a fresh opportunity or have an inquiry? Don't hesitate to reach out to me.

Get in touch

Seeking a fresh opportunity or have an inquiry? Don't hesitate to reach out to me.

Get in touch

Seeking a fresh opportunity or have an inquiry? Don't hesitate to reach out to me.

©

2024

- Designed and Developed by Glen