- Update package description and fix mainProgram typo - Rewrite documentation to describe project switching, not process viewing - Add PROJECT_FOLDERS configuration and usage examples - Update all references across docs (README, guides, module overviews)
5.0 KiB
editors Home Manager Module
Editor configurations for Home Manager.
Overview
This module provides pre-configured settings for various code editors, making it easy to set up your development environment.
Quick Start
{config, ...}: {
imports = [m3ta-nixpkgs.homeManagerModules.default];
m3ta.coding.editors = {
enable = true;
neovim.enable = true;
zed.enable = true;
};
}
Module Options
m3ta.coding.editors.enable
Enable the editors module.
- Type:
boolean - Default:
false
m3ta.coding.editors.neovim.enable
Enable Neovim configuration.
- Type:
boolean - Default:
false
m3ta.coding.editors.neovim.package
Custom Neovim package.
- Type:
package - Default:
pkgs.neovim
m3ta.coding.editors.zed.enable
Enable Zed editor configuration.
- Type:
boolean - Default:
false
m3ta.coding.editors.zed.package
Custom Zed package.
- Type:
package - Default:
pkgs.zed
Supported Editors
Neovim
Neovim is a highly extensible Vim-based text editor.
m3ta.coding.editors = {
enable = true;
neovim = {
enable = true;
package = pkgs.neovim;
};
}
Features:
- Vim-style editing
- Plugin system
- Lua scripting
- Fast performance
- Built-in LSP support
Configuration: The module provides sensible defaults. You can customize by adding your own configuration.
Zed
Zed is a high-performance, multiplayer code editor.
m3ta.coding.editors = {
enable = true;
zed = {
enable = true;
package = pkgs.zed;
};
}
Features:
- Fast startup
- Built-in collaboration
- AI assistance (optional)
- Modern UI
- Low memory usage
Configuration: Zed uses JSON configuration files that can be customized.
Usage Examples
Minimal Neovim Setup
{config, ...}: {
m3ta.coding.editors = {
enable = true;
neovim.enable = true;
};
}
Minimal Zed Setup
{config, ...}: {
m3ta.coding.editors = {
enable = true;
zed.enable = true;
};
}
Multiple Editors
{config, ...}: {
m3ta.coding.editors = {
enable = true;
neovim.enable = true;
zed.enable = true;
};
}
Custom Package
{config, ...}: {
m3ta.coding.editors = {
enable = true;
neovim = {
enable = true;
package = pkgs.neovim-unwrapped; # Use unwrapped version
};
};
}
Configuration Files
Neovim
The module sets up Neovim configuration in:
~/.config/nvim/
You can extend it with:
{config, ...}: {
xdg.configFile."nvim/init.lua".text = ''
-- Your custom Neovim configuration
'';
}
Zed
Zed configuration is in:
~/.config/zed/settings.json
You can customize it with:
{config, ...}: {
xdg.configFile."zed/settings.json".text = builtins.toJSON {
# Your custom Zed settings
};
}
Migration Guide
From Manual Configuration
If you have existing editor configurations, you can:
- Backup your current config
- Enable the module
- Test it out
- Gradually migrate custom settings
Backup:
# Backup Neovim
cp -r ~/.config/nvim ~/.config/nvim.backup
# Backup Zed
cp -r ~/.config/zed ~/.config/zed.backup
From Other Editors
Vim to Neovim:
- Most Vim configurations work with Neovim
- Enable module and test
- Migrate plugins to modern Lua versions
VSCode to Zed:
- Zed has built-in keybinding presets
- Enable module and check keybindings
- Adjust as needed
Keybindings
Neovim
Default keybindings (Vim-style):
| Mode | Key | Action |
|---|---|---|
| Normal | i |
Enter insert mode |
| Normal | ESC |
Exit insert mode |
| Normal | :w |
Save |
| Normal | :q |
Quit |
| Normal | u |
Undo |
| Normal | Ctrl+r |
Redo |
Zed
Default keybindings:
| Mode | Key | Action |
|---|---|---|
| General | Ctrl+S |
Save |
| General | Ctrl+P |
Command palette |
| General | Ctrl+Shift+P |
File palette |
| Navigation | Ctrl+B |
Toggle sidebar |
| Navigation | Ctrl+Shift+B |
Toggle activity bar |
Plugins and Extensions
Neovim
The module provides a base. You can add plugins using:
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
nvim-lspconfig
nvim-treesitter
telescope-nvim
];
}
Zed
Zed extensions are managed through the editor:
- Open Zed
- Go to Extensions (Ctrl+Shift+X)
- Browse and install extensions
Troubleshooting
Editor Not Found
Ensure the editor package is installed:
# Check Neovim
which nvim
# Check Zed
which zed
Configuration Not Applied
Check if the module is enabled:
# Check Home Manager state
home-manager show
# View current config
nix eval .#homeConfigurations.username.config.m3ta.coding.editors --apply builtins.attrNames
Conflicts with Existing Config
If you have existing configuration:
- Backup current config
- Test module with fresh config
- Gradually add custom settings
Related
- Using Modules Guide - How to use modules
- Adding Packages - How to add new packages