A minimal Zsh plugin that lets you quickly jump into your development directories with a single command.
dev acts as a smart replacement for cd, allowing you to navigate into project folders instantly with recursive autocompletion β and even open them directly in VS Code.
dev api-server
# β cd ~/dev/api-serverOr open the project in your configured editor:
dev -o api-server
# β Opens ~/dev/api-server in your configured editor (default: VS Code)Create a new project directory:
dev -c new-project
# β Creates ~/dev/new-project and navigates to itCreate a new project with git repository:
dev -cg new-project
# β Creates ~/dev/new-project, initializes git, and navigates to itExecute a file (with confirmation):
dev script.sh
# β Asks for confirmation, then executes ~/dev/script.shExecute a file with arguments:
dev test.sh -ac --verbose
# β Target is a file: ~/dev/test.sh
# β With arguments: -ac --verbose
# β Do you want to execute this file? [y/N]: y
# β Executes: ~/dev/test.sh -ac --verbose
# Or interactively:
dev test.sh
# β Do you want to execute this file? [y/N]: y
# β Enter arguments (or press Enter for none): -ac --verbose
# β Executing with arguments: -ac --verboseOpen a file in editor:
dev -o config.json
# β Opens ~/dev/config.json in your configured editor- β‘ Quickly
cdinto any development project with a simple command. - π Smart recursive autocompletion for subfolders.
- π§ Defaults to your base development folder when no argument is provided.
- πͺ Optional flags to extend functionality β e.g., open projects directly in your preferred editor.
- π Create new project directories on-the-fly with the
-cflag. - π§ Initialize git repositories automatically with the
-cgflag. - βοΈ Configurable base directory and default editor via configuration file.
- π€ Auto git init option to initialize git repositories with
-cflag automatically. - π File execution support with confirmation prompts for executable files.
- π File editing with
-oflag to open files directly in your configured editor. - π§ Intelligent file/directory detection based on file extensions.
- π File creation with automatic parent directory creation.
- π Fallback mode for users without fzf installed.
- π Fuzzy finder integration (fzf) for interactive project selection when no argument is provided.
- π― Support for multiple editors: VS Code, Cursor, Windsurf, Sublime Text, Vim, and more.
-
Clone the plugin into your Oh My Zsh custom plugins folder:
git clone https://github.com/dvigo/zsh-dev-navigator.git ~/.oh-my-zsh/custom/plugins/zsh-dev-navigator -
Enable it in your
~/.zshrc:plugins=(... zsh-dev-navigator)
-
Reload Zsh:
source ~/.zshrc
Basic usage:
dev api-serverResult:
π Moved to: ~/dev/api-server
Autocompletion:
Start typing and press <TAB> to explore all projects and subfolders:
dev fr<TAB>
# frontend-app
# frontend-utils
# frontend-tests
Open in your preferred editor:
dev -o frontend-app
# β Opens ~/dev/frontend-app in your configured editor (e.g., Cursor, VS Code, etc.)Interactive project selection with fuzzy finder:
dev
# β Opens fzf interface to select from available projects
# β Press ESC to navigate to the root dev folderCreate new project:
dev -c new-project
# β Creates ~/dev/new-project and navigates to itCreate new project with git:
dev -cg new-project
# β Creates ~/dev/new-project, initializes git, and navigates to itThe plugin uses a configuration file located in the plugin directory. You can customize the following settings:
The plugin includes a config file with the following options:
# Development directory - where your projects are located
# This can be an absolute path or use ~ for home directory
dev_directory = ~/dev
# Default editor to use with the -o flag
# Supported editors: code, cursor, windsurf, subl, vim, nvim, emacs, atom, webstorm, idea, pycharm
editor = code
# Automatically initialize git repository when creating new directories with -c flag
# Set to true to enable automatic git init, false to disable
auto_git_init = false-
Development Directory: Change the
dev_directorysetting to point to your projects folder:dev_directory = ~/Development dev_directory = /path/to/your/projects -
Default Editor: Set your preferred editor for the
-oflag:editor = cursor # Cursor editor editor = windsurf # Windsurf editor editor = code # VS Code editor = subl # Sublime Text editor = vim # Vim editor = nvim # Neovim
-
Custom Editor Path: You can also specify a full path to a custom editor:
editor = /usr/local/bin/my-custom-editor
-
Automatic Git Initialization: Enable automatic
git initwhen creating directories with-c:auto_git_init = true # Always initialize git with -c flag auto_git_init = false # Only initialize git with -cg flag (default)
Basic syntax:
dev <project-name>Examples:
dev dashboard-ui
# β cd ~/dev/dashboard-ui
dev api-server/routes
# β cd ~/dev/api-server/routes
dev
# β cd ~/devOpen a project in your configured editor:
dev -o api-server
# β Opens the project in your configured editor (Cursor, VS Code, etc.)Create a new project directory:
dev -c new-project
# β Creates ~/dev/new-project and navigates to itCreate a new project with git repository:
dev -cg new-project
# β Creates ~/dev/new-project, initializes git, and navigates to itNote: If you have auto_git_init = true in your config, then dev -c new-project will also initialize git automatically.
Combine flags:
dev -c -o new-app
# β Creates ~/dev/new-app and opens it in your configured editor
dev -cg -o new-git-project
# β Creates ~/dev/new-git-project, initializes git, and opens it in your editorThe plugin now supports working with files in addition to directories:
When targeting a file, the plugin will ask for confirmation before execution:
dev script.sh
# β Target is a file: ~/dev/script.sh
# β Do you want to execute this file? [y/N]: y
# β Executes the file and navigates to its directoryWith arguments:
dev deploy.sh --env production --force
# β Target is a file: ~/dev/deploy.sh
# β With arguments: --env production --force
# β Do you want to execute this file? [y/N]: y
# β Executes: ./deploy.sh --env production --forceInteractive argument input:
dev script.sh
# β Target is a file: ~/dev/script.sh
# β Do you want to execute this file? [y/N]: y
# β Enter arguments (or press Enter for none): -v --debug
# β Executing with arguments: -v --debug
# β Executes: ./script.sh -v --debugUse cases:
- Run scripts with flags:
dev test.sh -v - Pass configuration:
dev build.sh --config prod - Multiple arguments:
dev script.sh arg1 arg2 arg3 - Interactive mode:
dev script.shβ then enter arguments when prompted
Use the -o flag to open files directly in your configured editor:
dev -o config.json
# β Opens ~/dev/config.json in your editor
# β Navigates terminal to ~/dev/ directoryThe plugin intelligently detects when you're trying to work with files and offers to create them:
With -o flag (create and edit):
dev -o new-config.json
# β File does not exist: ~/dev/new-config.json
# β Do you want to create this file? [y/N]: y
# β Created and opened file in your editorWithout flags (create and optionally execute):
dev new-script.sh
# β File does not exist: ~/dev/new-script.sh
# β Do you want to create this file? [y/N]: y
# β File created: ~/dev/new-script.sh
# β Do you want to execute this file? [y/N]: nThe plugin automatically creates parent directories when needed:
dev -o src/components/Header.jsx
# β Creates src/components/ directory if it doesn't exist
# β Creates and opens Header.jsx in your editorThe plugin automatically detects whether you're working with files or directories:
Files (with extensions):
script.sh,config.json,README.mdβ Treated as files- Offers creation, execution, or editing options
Directories (without extensions):
my-project,frontend-app,api-serverβ Treated as directories- Suggests using
-cflag for creation
- Creation flags (
-c,-cg) cannot be used with files - fzf selection with
-c/-cgshows only directories - Autocompletion with
-c/-cgshows only directories
The dev command includes powerful autocompletion for all subdirectories inside your base development folder.
Just type part of a project name and press <TAB> to complete it.
When you run dev without any arguments, the plugin provides different interfaces based on availability:
If fzf is installed, you get an interactive selection interface:
- Browse through all your projects with fuzzy search
- Use arrow keys or type to filter projects
- Press Enter to navigate to the selected project
- Press ESC to navigate to the root development folder instead
If fzf is not available, the plugin shows a list and prompts for input:
dev
# β Available projects in ~/dev:
# β api-server
# β config.json
# β frontend-app
# β script.sh
# β Enter project/file name (or press Enter for root directory): new-file.txtThe interface adapts based on the flags used:
- Regular navigation: Shows both files and directories
- With
-cor-cg: Shows only directories (prevents file creation conflicts)
- Add flag to create new project directories.
- Add flag to open projects directly in editors.
- Add support for multiple editors (VS Code, Cursor, Windsurf, Sublime, Vim, etc.).
- Add fuzzy search for project names with fzf integration.
- Add configuration file system for customizable settings.
- Add aliases or shortcuts per project.
- Add project templates for new directory creation.
GNU General Public License v3.0 β See LICENSE for details.