A powerful Zellij plugin that seamlessly integrates zoxide (smart directory navigation) with Zellij sessions, making it incredibly easy to jump between your most-used directories and create/manage development sessions.
ZSM bridges the gap between zoxide
and Zellij's session management:
- π― Smart Directory Listing: Shows your most-used directories from zoxide, ranked by frequency
- β‘ Instant Session Creation: Create new Zellij sessions in any directory with one keystroke
- π Fuzzy Search: Search through directories and existing sessions simultaneously
- π§ Intelligent Naming: Auto-generates meaningful session names with conflict resolution
- βοΈ Layout Support: Choose from available layouts or use your default layout
- zoxide - Install and use it for a while to build up your directory database
- Zellij with plugin support
- Download the latest
zsm.wasm
from Releases - Copy it to your Zellij plugins directory (~/.config/zellij/plugins/):
- Add to your Zellij configuration (see Configuration)
mkdir -p ~/.config/zellij/plugins
curl -sSL -o ~/.config/zellij/plugins https://github.com/liam-mackie/zsm/releases/download/v0.1.0/zsm.wasm
# Add WASM target if not already added
rustup target add wasm32-wasip1
# Build the plugin
cargo build --target wasm32-wasip1 --release
# The plugin will be at: target/wasm32-wasip1/release/zsm.wasm
Add ZSM to your configuration file (e.g., ~/.config/zellij/config.kdl
):
keybinds clear-defaults=true {
...
shared_except "locked" {
bind "<your-key>" {
// Note: you must use the absolute path to the plugin file
LaunchOrFocusPlugin "file:/your/home/dir/.config/zellij/plugins/zsm.wasm" {
floating true
move_to_focused_tab true
}
}
}
...
}
keybinds clear-defaults=true {
...
shared_except "locked" {
bind "<your-key>" {
// Note: you must use the absolulte path to the plugin file
LaunchOrFocusPlugin "file:/your/home/dir/.config/zellij/plugins/zsm.wasm" {
floating true
move_to_focused_tab true
// Default layout for Ctrl+Enter quick creation
default_layout "development"
// Session name separator (default: ".")
session_separator "_"
// Show sessions that can be resurrected
show_resurrectable_sessions true
// Base paths to strip from directory names (pipe-separated)
// Example: "/home/user/projects/foo" becomes just "foo"
base_paths "/home/user/projects|/Users/dev/work"
}
}
}
...
Option | Description | Default | Example |
---|---|---|---|
default_layout |
Layout name for Ctrl+Enter quick creation | None | "development" |
session_separator |
Character used in session names | "." |
"-" or "_" |
show_resurrectable_sessions |
Show sessions that can be resurrected | false |
true |
base_paths |
Base paths to strip from directory names (pipe-separated) | None | "/home/user|/home/user/git/projects" |
ZSM shows your zoxide directories ranked by usage frequency:
~/projects/my-app (most used)
~/work/client-project
~/personal/website
~/dotfiles (least used)
ZSM automatically generates meaningful session names:
- Simple:
~/projects/webapp
βwebapp
- Nested:
~/projects/client/backend
βclient.backend
- Conflicts: Multiple "app" directories β
client.app
,personal.app
- Long names: Intelligent abbreviation β
very-long-project-name
βv-l-p-name
- Base Paths: Configure base paths to strip from names (e.g.,
/home/user
as base path)/home/user/projects/foo
βprojects.foo
/home/user
β/home/user
(exact matches keep full path)
- Existing sessions are shown with indicators:
β current
orβ available
- Resurrectable sessions (if enabled) are shown with a
βΊ
icon - Auto-increment: If session
webapp
exists, createswebapp.2
,webapp.3
, etc.
Jump to existing session
- Open ZSM
- Type to search for session
- Press
Enter
β Instantly switch
Create new session
- Open ZSM
- Navigate to directory
- Press
Enter
β Opens session creation (orCtrl+Enter
for default) - Choose layout
- Session is created in that directory
ZSM requires these Zellij permissions:
- RunCommands: Execute zoxide queries
- ReadApplicationState: Read existing sessions and layouts
- ChangeApplicationState: Create and switch sessions
- MessageAndLaunchOtherPlugins: Launch filepicker
- Ensure zoxide is installed:
which zoxide
- Build up your directory database by navigating around:
cd ~/projects && cd ~/work
- Check zoxide database:
zoxide query -l
- Verify layout name matches exactly (case-sensitive)
- Check available layouts in Zellij
- Layout must exist in current session
- Ensure MessageAndLaunchOtherPlugins permission is granted
# Start the plugin development layout
zellij -l zellij.kdl
# Use the default alt-r keybinding to reload the plugin
# If you exit the plugin, you can re-open it with the following command:
zellij action launch-or-focus-plugin file:target/wasm32-wasip1/debug/zsm.wasm
watchexec --exts rs -- 'cargo build --target wasm-wasip1; zellij action start-or-reload-plugin file:target/wasm32-wasip1/debug/zsm.wasm'
Contributions welcome, though my time is limited so please be patient with reviews!
Made with β€οΈ for the Zellij community