Skip to content

xicv/zed-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Zed Editor Configuration with Vim Mode

This repository contains a complete Zed editor configuration with customized vim mode keybindings for enhanced productivity.

🚀 Quick Setup

1. Backup Existing Configuration (Optional)

mv ~/.config/zed ~/.config/zed.backup

2. Clone and Install Configuration

# Clone this repository
git clone git@github.com:xicv/zed-config.git

# Create Zed config directory if it doesn't exist
mkdir -p ~/.config/zed

# Copy configuration files
cp zed-config/settings.json ~/.config/zed/
cp zed-config/keymap.json ~/.config/zed/

# Restart Zed to apply changes

3. Alternative: Symlink Configuration (Recommended)

For automatic syncing across devices:

# Remove existing config
rm -rf ~/.config/zed

# Create symlink to this repository
ln -s /path/to/zed-config ~/.config/zed

⚙️ Configuration Overview

Features Enabled

  • Vim Mode: Full vim modal editing
  • System Clipboard: Seamless copy/paste integration
  • Relative Line Numbers: For easier vim navigation
  • Git Integration: Inline blame support
  • Telemetry Disabled: Privacy-focused configuration

Font Settings

  • UI Font Size: 16px
  • Buffer Font Size: 16px
  • Terminal Dock: Right side

⌨️ Custom Keybindings

Insert Mode

Key Action Description
jj Escape Quick exit to normal mode

Normal Mode

Search & Navigation

Key Action Description
Ctrl-n Clear Search Dismiss buffer search highlights
Space Search Start buffer search (/)
Shift-K Insert Line Add new line at cursor

Leader Key Mappings (, as leader)

Key Action Description
,a Go to Line Jump to specific line number
,A Go to Line Jump to specific line number
,s Save Save current file
,t Outline Toggle outline/symbol panel
,f Format Format current document
,r File Finder Open file finder (duplicate)
,g Find in Files Project-wide search
,c Terminal Toggle terminal panel
,e Sidebar Toggle left sidebar
,d Assistant Toggle AI assistant chat
,x Code Actions Show available code actions
,q Hover Info Show hover information
,b Git Blame Toggle git blame display
,w Switch Window Activate next pane/window
,z File Search Open file finder

Global Vim Bindings

Key Action Description
g d Go to Definition Jump to symbol definition
g r Find References Find all references
g h Hover Show hover information

🔧 Customization

Adding New Keybindings

Edit keymap.json to add custom bindings:

{
  "context": "Editor && vim_mode == normal",
  "bindings": {
    "your_key": "action_name"
  }
}

Vim Mode Contexts

  • vim_mode == insert - Insert mode only
  • vim_mode == normal - Normal mode only
  • vim_mode == visual - Visual mode only
  • Editor && vim_mode - Any vim mode in editor

Available Actions

Common Zed actions you can bind:

  • file_finder::Toggle
  • workspace::Save
  • outline::Toggle
  • terminal_panel::ToggleFocus
  • project_search::ToggleFocus
  • assistant::ToggleFocus
  • editor::Format
  • editor::GoToDefinition
  • editor::FindAllReferences
  • buffer_search::Deploy
  • buffer_search::Dismiss

🔄 Syncing Across Multiple Computers

Method 1: Git Repository (Recommended)

  1. Setup on first computer:

    cd ~/.config/zed
    git init
    git remote add origin git@github.com:xicv/zed-config.git
    git add .
    git commit -m "Initial Zed configuration"
    git push -u origin main
  2. Setup on additional computers:

    # Remove existing config
    rm -rf ~/.config/zed
    
    # Clone your config
    git clone git@github.com:xicv/zed-config.git ~/.config/zed
  3. Updating configuration:

    cd ~/.config/zed
    # Make changes to settings.json or keymap.json
    git add .
    git commit -m "Update configuration"
    git push
    
    # On other computers
    git pull

Method 2: Cloud Storage Sync

  • Use Dropbox, iCloud, or Google Drive
  • Symlink ~/.config/zed to your cloud folder
  • Automatic sync across devices

🚨 Troubleshooting

Common Issues

Keybindings not working:

  • Restart Zed after configuration changes
  • Check syntax in keymap.json (valid JSON required)
  • Use command palette to verify action names

Vim mode disabled:

  • Ensure "vim_mode": true in settings.json
  • Toggle vim mode via command palette: "Toggle Vim Mode"

Git integration issues:

  • Ensure project is a git repository
  • Git blame requires valid git history

Debugging Keybindings

  1. Open command palette (Cmd/Ctrl + Shift + P)
  2. Run "dev: Open Key Context View"
  3. Debug problematic key combinations

📚 Resources

🤝 Contributing

Feel free to submit issues and pull requests to improve this configuration!

📄 License

This configuration is provided as-is under MIT License. Feel free to modify and share!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •