VimLM - LLM-powered Vim assistant
Project description
VimLM - Local LLM-Powered Coding Assistant for Vim
LLM-powered coding companion for Vim, inspired by GitHub Copilot/Cursor. Integrates contextual code understanding, summarization, and AI assistance directly into your Vim workflow.
Features
- Model Agnostic - Use any MLX-compatible model via a configuration file
- Vim-Native UX - Intuitive keybindings and split-window responses
- Deep Context - Understands code context from:
- Current file
- Visual selections
- Referenced files
- Project directory structure
- Conversational Coding - Iterative refinement with follow-up queries
- Air-Gapped Security - 100% offline - no APIs, no tracking, no data leaks
Requirements
- Apple M-series chip
- Python 3.12.8
Quick Start
Install:
pip install vimlm
Launch:
vimlm
or
vimlm path/to/your_file
This launches Vim with the LLM in a split window, ready to assist you.
Basic Usage
-
From Normal Mode:
Ctrl-l: Adds current line + file to context- Example prompt: "Regex for removing html tags from item.content"
-
From Visual Mode:
- Select code →
Ctrl-l: Adds selected block + current file to context - Example prompt: "Convert this to async/await syntax"
- Select code →
-
Inline Commands:
!include: Adds specified outside files/folders to context:
- !include (no path): Current folder
- !include ~/scrap/jph00/hypermedia-applications.summ.md: Specific folder
- !include ~/wtm/utils.py: Specific file
- Example prompt: "AJAX-ify this app @ ~/scrap/jph00/hypermedia-applications.summ.md"
!deploy: Extract code blocks to files in user specified dir (current dir if none specified).
!continue: Lets the LLM resume the generation from where it had halted due to length limits.
!followup: Continue the thread (equivalent to Ctrl-j
-
Follow-Up: After initial response:
Ctrl-j: Continue thread- Example follow-up: "In Manifest V3"
-
**Code Extraction: Press
Ctrl-pto choose a code block from the response and insert them into:- The last selected visual block (in Normal mode)
- The current selection (in Visual mode)
- Example workflow:
- Select a block of code in Visual mode.
- Prompt the LLM with
Ctrl-l(e.g., "Convert this to async/await syntax"). - Once the response is generated, press
Ctrl-pto replace the selected block with the extracted code.
Key Bindings
| Binding | Mode | Action |
|---|---|---|
Ctrl-l |
Normal/Visual | Send current file + selection to LLM |
Ctrl-j |
Normal | Continue conversation |
Ctrl-p |
Normal/Visual | Replace the selection with generated code |
Esc |
Prompt | Cancel input |
Advanced Configuration
VimLM uses a JSON config file with the following configurable parameters:
{
"DEBUG": true,
"LLM_MODEL": null,
"NUM_TOKEN": 2000,
"SEP_CMD": "!",
"USE_LEADER": false
}
Custom Model Setup
-
Browse models: MLX Community Models on Hugging Face
-
Edit config file:
{
"LLM_MODEL": "mlx-community/DeepSeek-R1-Distill-Qwen-7B-4bit"
}
- Save to:
~/vimlm/config.json
- Restart VimLM
Custom Keybinding
If you prefer using <Leader> in place of <Ctrl> for the ViMLM key bindings:
{
"USER_LEADER": true
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vimlm-0.0.6.tar.gz.
File metadata
- Download URL: vimlm-0.0.6.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db5edda3a2c487e3905ec10c5be1ff3f091166da8bb7280b06f079917ffcc5a6
|
|
| MD5 |
8a1f2ce3b4062bdf39734e43385d0325
|
|
| BLAKE2b-256 |
1646358f5c37def979d6bc7bf0adf13bb125145d41883abe4bc24bfd14d0ca65
|
File details
Details for the file vimlm-0.0.6-py3-none-any.whl.
File metadata
- Download URL: vimlm-0.0.6-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a0d9939e0348b489422b5bffd6d53b5871807d7709abb918bd20991a2e13e45
|
|
| MD5 |
99f992baa0d941794a059cab6e59f2bf
|
|
| BLAKE2b-256 |
254c8066283ace2dda1d96f53071fa74abe5db76857a0c73b89517aba1f01245
|