A feature-rich Neovim configuration with AI integration optimized for LaTeX, Markdown, Jupyter Notebooks, and managing NixOS.
This setup provides a streamlined environment for academic writing, code development, and system management.
The AI integration makes it easy to learn and configure this setup for your specific needs.
Every subdirectory includes a README.md file which documents the modules contained in that directory.
Recommended: See the Claude Code-Assisted Installation Guide for AI-powered setup assistance that automates dependency checking, troubleshooting, and configuration validation.
Migrating from Existing Config: See the Migration Guide for systematic instructions on moving from your current Neovim setup while preserving your customizations, keybindings, and preferences.
Traditional Setup: See the Installation Guide for manual step-by-step setup instructions, including how to fork the repository, install dependencies, and run health checks.
Want to customize notifications? See the Notification System Documentation for configuring notification behavior across all modules and plugins.
nvim/
├── init.lua # Main configuration entry point
├── lazy-lock.json # Plugin version lockfile
├── CLAUDE.md # Project guidelines and policies
├── after/ # Post-load configurations
│ ├── ftdetect/ # File type detection rules
│ └── ftplugin/ # File type specific settings
├── lua/neotex/ # Main configuration modules
│ ├── bootstrap.lua # Plugin system initialization
│ ├── config/ # Core Neovim settings
│ ├── plugins/ # Plugin configurations
│ └── util/ # Utility functions
├── templates/ # Document templates
│ ├── *.tex # LaTeX templates
│ ├── report/ # Multi-chapter documents
│ └── springer/ # Publisher templates
├── snippets/ # Code snippet collections
├── scripts/ # Maintenance utilities
├── sessions/ # Saved editor sessions
└── spell/ # Custom spell check dictionaries
This Neovim configuration includes specialized support for:
NeoVim will open with the dashboard which includes the following options:
| Key | Description |
|---|---|
s |
Restore Session - Load a saved session |
r |
Recent Files - Browse and open recently edited files |
e |
Explorer - Toggle the NvimTree file explorer |
f |
Find File - Search for files in your project |
g |
Find Text - Search for text content across files |
n |
New File - Create and start editing a new file |
c |
Config - Browse Neovim configuration files |
i |
Info - View Neovim configuration information |
m |
Manage Plugins - Open the Lazy plugin manager |
h |
Checkhealth - Run Neovim's health diagnostics |
q |
Quit - Exit Neovim |
The dashboard provides quick access to common actions and makes it easy to start working on your projects such as:
Press the corresponding key to activate any option, or use your mouse to click on the desired action.
This configuration requires several dependencies including Neovim (≥ 0.9.0), Git, Node.js, Python 3, and the uv package manager for MCP-Hub AI integration.
For complete installation requirements and step-by-step setup instructions, see the Installation Guide.
This configuration features comprehensive documentation following DOCUMENTATION_STANDARDS.md. Every directory contains a README.md with detailed information about its purpose, components, and usage.
Topic-focused documentation covering major systems and workflows:
Detailed READMEs in every directory documenting modules and functionality:
Each README follows DOCUMENTATION_STANDARDS.md and includes:
This documentation structure ensures information is easily accessible with consistent organization throughout the configuration.
The scripts/ directory contains utility scripts for maintaining and troubleshooting the configuration:
scripts/check_plugins.lua - Verify plugin loading and organizationSee scripts/README.md for detailed script documentation and usage instructions.
Check for Conflicts: Before adding new keybindings, check for conflicts with:
:verbose map <key-combo>
This shows if the key is already mapped and in which file.
Test Changes Incrementally: Make small changes and test them before proceeding to more complex modifications.
Update Documentation: Always update docstrings in the corresponding files when making changes:
keymaps.luawhich-key.luaOrganize Related Functions: Keep related functionality together in appropriate files:
lua/neotex/core/lua/neotex/plugins/after/ftplugin/Avante provides AI-powered code assistance directly within Neovim, offering intelligent code completion, explanations, refactoring suggestions, and conversational help. It supports multiple AI providers including Claude (Anthropic), GPT (OpenAI), and Gemini (Google).
[Info] The
leaderkey is set tospace.
<leader>aa to ask a question or <leader>at to toggle project-specific TTS notifications<leader>ae to edit with AI assistance<C-c> to toggle Claude Code sidebar (works in any mode)<leader>am to select a model for the current provider<leader>ap to select AI provider (Claude, OpenAI, Gemini)<leader>ar to open Claude session pickerMore details are provided in Making Configuration Changes below.
Avante is particularly useful for understanding and modifying this Neovim configuration:
Example prompts:
When in an Avante buffer (AI interface):
| Key | Action |
|---|---|
q |
Quit Avante |
<C-t> |
Toggle Avante interface |
<C-c> |
Reset/clear Avante content |
<C-m> |
Select model for current provider |
<C-p> |
Select provider and model |
<C-s> |
Stop AI generation |
<C-d> |
Select provider/model with default |
<CR> |
Create new line (not submission) |
<C-j> |
Move up between panes |
<C-k> |
Move down between panes |
<C-l> |
Accept suggestion (insert mode) |
<C-h> |
Dismiss suggestion |
o |
Select 'ours' in diff |
t |
Select 'theirs' in diff |
a |
Select all 'theirs' in diff |
b |
Select both in diff |
c |
Select at cursor in diff |
n |
Jump to next |
N |
Jump to previous |
A |
Apply all in sidebar |
a |
Apply at cursor in sidebar |
<Tab> |
Switch windows in sidebar |
<S-Tab> |
Reverse switch windows in sidebar |
Avante AI can be an invaluable tool when modifying this configuration. When modifying this Neovim configuration, follow these guidelines to ensure consistency and prevent conflicts.
Ask for Documentation: Use Avante to generate detailed docstrings by asking:
Help me create a comprehensive docstring for this function: [paste function]
Understand Existing Code: Ask Avante to explain complex parts of the configuration:
Explain how this (LaTeX) code works: [paste code]
Find Keybinding Conflicts: Ask Avante to help identify conflicts:
Check if these keybindings might conflict with existing ones: [list keys]
Generate Configuration Snippets: Get help creating new configuration:
Help me create a configuration for [plugin/feature] that works with my existing setup/needs
Troubleshoot Issues: When something isn't working, ask Avante:
I'm having an issue with [feature]. Here's the relevant configuration and error...
This configuration provides extensive keybinding customizations to enhance productivity and provide a cohesive editing experience. The keybindings are organized through two main systems:
For complete keybinding reference, see:
lua/neotex/config/keymaps.lua)Defines the fundamental key mappings including:
lua/neotex/plugins/editor/which-key.lua)Provides the which-key system for:
<space><space> - Access to all major functionality through organized menus<leader> and wait to see available commands<leader>aiLectic provides AI-assisted writing for markdown files with these features:
<leader>mn creates a new Lectic file with a template<leader>ml runs Lectic on the entire filev, V, or <C-v>)<Esc> to exit visual mode<leader>ms to process the selected textUse Lectic for AI-assisted writing, brainstorming, or refining your markdown documents.
This configuration uses nvim-surround with filetype-aware buffer configurations to provide context-appropriate text manipulation. The same keybindings produce different outputs depending on the file type.
ys{motion}{char} - Add surround around motionds{char} - Delete surrounding charactercs{old}{new} - Change surround from old to newS{char} - Surround visual selection (visual mode)Examples:
ysiw" - Surround word with double quotesds{ - Delete surrounding curly bracescs"' - Change double quotes to single quotesMarkdown Files (.md) Special surrounds available only in markdown:
| Key | Result | Description |
|---|---|---|
b |
**text** |
Bold (strong emphasis) |
i |
*text* |
Italic (emphasis) |
` |
`text` |
Inline code |
c |
```lang\ntext\n``` |
Fenced code block (prompts for language) |
l |
[text](url) |
Link (prompts for URL) |
~ |
~~text~~ |
Strikethrough (GFM) |
LaTeX Files (.tex) Special surrounds available only in LaTeX:
| Key | Result | Description |
|---|---|---|
e |
\begin{env}...\end{env} |
Environment (prompts for name) |
b |
\textbf{text} |
Bold text |
i |
\textit{text} |
Italic text |
t |
\texttt{text} |
Typewriter (monospace) |
q |
`text' |
LaTeX single quotes |
Q |
text'' `` |
LaTeX double quotes |
$ |
$text$ |
Math mode |
Filetype Isolation
This design prevents cross-filetype pollution - pressing ysiw + b on "word" produces:
**word** in markdown files (markdown bold)\textbf{word} in LaTeX files (LaTeX bold)For complete surround documentation, see:
This configuration includes a smart folding system with the following features:
manual for better performance<leader>mf to toggle between:<leader>ma - Toggle all folds open/closed<leader>mf - Toggle fold under cursor<leader>mt - Toggle folding method (manual/smart)The system is integrated throughout the configuration to provide a consistent experience across all file types while prioritizing performance.
This configuration includes a comprehensive URL handling system for all file types:
gx to open URL under cursorCtrl+Click to open URL at mouse position<leader>mu to open URL under cursor via keybindingThis configuration provides comprehensive support for working with Jupyter notebooks through three integrated plugins:
<leader>j)| Key | Action |
|---|---|
<leader>je |
Execute current cell |
<leader>jj |
Navigate to next cell |
<leader>jk |
Navigate to previous cell |
<leader>jn |
Execute cell and move to next |
<leader>jo |
Insert new cell below |
<leader>jO |
Insert cell above |
<leader>js |
Split cell at cursor position |
<leader>jc |
Comment current cell |
<leader>ja |
Run all cells in file |
<leader>jb |
Run current and all cells below |
<leader>ju |
Merge with cell above |
<leader>jd |
Merge with cell below |
<leader>ji |
Start IPython REPL |
<leader>jt |
Send motion to REPL |
<leader>jl |
Send current line to REPL |
<leader>jf |
Send entire file to REPL |
<leader>jv |
Send visual selection to REPL |
<leader>jq |
Exit REPL |
<leader>jr |
Clear REPL screen |
<leader>jc |
Show jupytext config |
The system recognizes cells based on these markers:
# %% or #%% comments<leader>jj and <leader>jk<leader>je or execute and move to next with <leader>jn<leader>jo (below) or <leader>jO (above)<leader>js (split cell), <leader>jc (comment cell), or <leader>ja (run all cells)This integration provides a seamless experience for data analysis, scientific computing, and literate programming without leaving Neovim.
This configuration includes convenient keybindings for managing NixOS systems directly from Neovim, streamlining system administration tasks:
<leader>n)| Key | Action |
|---|---|
<leader>nr |
Rebuild system from flake |
<leader>nh |
Apply home-manager changes |
<leader>nu |
Update flake dependencies |
<leader>ng |
Clean up old nix packages |
<leader>nd |
Enter nix development shell |
| Key | Action |
|---|---|
<leader>np |
Open NixOS packages website |
<leader>nm |
Open MyNixOS website |
These commands integrate NixOS system management into your development workflow, allowing you to manage system configuration, packages, and environments without leaving your editor.
This configuration is optimized for fast startup and responsive editing:
Built-in tools for analyzing and improving performance:
:AnalyzeStartup to identify bottlenecks in your NeoVim startup process:ProfilePlugins to measure load times for all plugins:OptimizationReport:SuggestLazyLoadingThese tools provide actionable insights to help you maintain a fast and responsive editing environment. See the comprehensive documentation in lua/neotex/utils/README.md for more details on the optimization workflow.
After making changes:
<leader>rr or (better) restart Neovim<leader>rs:checkhealth to verify plugin health (also linked in the dashboard <leader>rd):verbose commands to debugRemember that a well-documented configuration is easier to maintain and extend. Take the time to add clear comments and keep this README updated as the configuration evolves.
By default, debug messages are hidden to keep your Neovim experience clean. If you need to see these messages for troubleshooting:
View all notification levels:
:lua vim.notify_level = vim.log.levels.DEBUG
View even more verbose messages (including trace level):
:lua vim.notify_level = vim.log.levels.TRACE
Check notification history:
Press <leader>rm to view the notification history, which includes all past messages.
Return to normal notifications (hide debug messages again):
:lua vim.notify_level = vim.log.levels.INFO
These debug messages can be helpful when diagnosing plugin loading issues, performance problems, or other configuration concerns.