Back to Notes
How To
Setting Up Quick Open for Zed Editor (in terminal)
October 6, 2024
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
Open your shell configuration file:
For Bash:
~/.bashrcor~/.bash_profileFor Zsh:
~/.zshrc
Add the following function to the file:
zed() { if [[ $# -eq 0 ]]; then /path/to/zed . else /path/to/zed "$@" fi }Replace
/path/to/zedwith the actual path to your Zed executable. You can find this by runningwhich zedin your terminal.Save the file.
Reload your shell configuration:
For Bash:
source ~/.bashrcorsource ~/.bash_profileFor Zsh:
source ~/.zshrc
(Optional) To make it even more similar to the VS Code "." feature, add this alias after the function:
alias .='zed .'Save and reload your configuration again.
Usage
To open Zed with the current directory:
zedor.(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
Open your shell configuration file:
For Bash:
~/.bashrcor~/.bash_profileFor Zsh:
~/.zshrc
Add the following function to the file:
zed() { if [[ $# -eq 0 ]]; then /path/to/zed . else /path/to/zed "$@" fi }Replace
/path/to/zedwith the actual path to your Zed executable. You can find this by runningwhich zedin your terminal.Save the file.
Reload your shell configuration:
For Bash:
source ~/.bashrcorsource ~/.bash_profileFor Zsh:
source ~/.zshrc
(Optional) To make it even more similar to the VS Code "." feature, add this alias after the function:
alias .='zed .'Save and reload your configuration again.
Usage
To open Zed with the current directory:
zedor.(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
Open your shell configuration file:
For Bash:
~/.bashrcor~/.bash_profileFor Zsh:
~/.zshrc
Add the following function to the file:
zed() { if [[ $# -eq 0 ]]; then /path/to/zed . else /path/to/zed "$@" fi }Replace
/path/to/zedwith the actual path to your Zed executable. You can find this by runningwhich zedin your terminal.Save the file.
Reload your shell configuration:
For Bash:
source ~/.bashrcorsource ~/.bash_profileFor Zsh:
source ~/.zshrc
(Optional) To make it even more similar to the VS Code "." feature, add this alias after the function:
alias .='zed .'Save and reload your configuration again.
Usage
To open Zed with the current directory:
zedor.(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
Open your shell configuration file:
For Bash:
~/.bashrcor~/.bash_profileFor Zsh:
~/.zshrc
Add the following function to the file:
zed() { if [[ $# -eq 0 ]]; then /path/to/zed . else /path/to/zed "$@" fi }Replace
/path/to/zedwith the actual path to your Zed executable. You can find this by runningwhich zedin your terminal.Save the file.
Reload your shell configuration:
For Bash:
source ~/.bashrcorsource ~/.bash_profileFor Zsh:
source ~/.zshrc
(Optional) To make it even more similar to the VS Code "." feature, add this alias after the function:
alias .='zed .'Save and reload your configuration again.
Usage
To open Zed with the current directory:
zedor.(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 ❇️
