vimlm 0.0.5__tar.gz → 0.0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
vimlm-0.0.7/PKG-INFO ADDED
@@ -0,0 +1,204 @@
1
+ Metadata-Version: 2.2
2
+ Name: vimlm
3
+ Version: 0.0.7
4
+ Summary: VimLM - LLM-powered Vim assistant
5
+ Home-page: https://github.com/JosefAlbers/vimlm
6
+ Author: Josef Albers
7
+ Author-email: albersj66@gmail.com
8
+ Requires-Python: >=3.12.8
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: nanollama==0.0.5
12
+ Requires-Dist: mlx_lm_utils==0.0.2
13
+ Requires-Dist: watchfiles==1.0.4
14
+ Dynamic: author
15
+ Dynamic: author-email
16
+ Dynamic: description
17
+ Dynamic: description-content-type
18
+ Dynamic: home-page
19
+ Dynamic: requires-dist
20
+ Dynamic: requires-python
21
+ Dynamic: summary
22
+
23
+
24
+ # VimLM - Local LLM-Powered Coding Assistant for Vim
25
+
26
+ ![vimlm](https://raw.githubusercontent.com/JosefAlbers/VimLM/main/assets/captioned_vimlm.gif)
27
+
28
+ LLM-powered coding companion for Vim, inspired by GitHub Copilot/Cursor. Integrates contextual code understanding, summarization, and AI assistance directly into your Vim workflow.
29
+
30
+ ## Features
31
+
32
+ - **Model Agnostic** - Use any MLX-compatible model via a configuration file
33
+ - **Vim-Native UX** - Intuitive keybindings and split-window responses
34
+ - **Deep Context** - Understands code context from:
35
+ - Current file
36
+ - Visual selections
37
+ - Referenced files
38
+ - Project directory structure
39
+ - **Conversational Coding** - Iterative refinement with follow-up queries
40
+ - **Air-Gapped Security** - 100% offline - no APIs, no tracking, no data leaks
41
+
42
+ ## Requirements
43
+
44
+ - Apple M-series chip
45
+ - Python 3.12.8
46
+
47
+ ## Quick Start
48
+
49
+ ```zsh
50
+ pip install vimlm
51
+ vimlm
52
+ ```
53
+
54
+ ## Basic Usage
55
+
56
+ ### 1. **From Normal Mode**
57
+ **`Ctrl-l`**: Add current line + file to context
58
+
59
+ *Example prompt:* `"Regex for removing HTML tags from item.content"`
60
+
61
+ ### 2. **From Visual Mode**
62
+ Select code → **`Ctrl-l`**: Add selected block + current file to context
63
+
64
+ *Example prompt:* `"Convert this to async/await syntax"`
65
+
66
+ ### 3. **Follow-Up Conversations**
67
+ **`Ctrl-j`**: Continue current thread
68
+
69
+ *Example follow-up:* `"Use Manifest V3 instead"`
70
+
71
+ ### 4. **Code Extraction & Replacement**
72
+ **`Ctrl-p`**: Insert code blocks from response into:
73
+ - Last visual selection (Normal mode)
74
+ - Active selection (Visual mode)
75
+
76
+ **Workflow Example**:
77
+ 1. Select a block of code in Visual mode
78
+ 2. Prompt with `Ctrl-l`: `"Convert this to async/await syntax"`
79
+ 3. Press `Ctrl-p` to replace selection with generated code
80
+
81
+ ### 5. **Inline Commands**
82
+
83
+ #### `!include` - Add External Context
84
+ ```text
85
+ !include [PATH] # Add files/folders to context
86
+ ```
87
+ - **`!include`** (no path): Current folder
88
+ - **`!include ~/projects/utils.py`**: Specific file
89
+ - **`!include ~/docs/api-specs/`**: Entire folder
90
+
91
+ *Example:* `"AJAX-ify this app !include ~/scrap/hypermedia-applications.summ.md"`
92
+
93
+ #### `!deploy` - Generate Project Files
94
+ ```text
95
+ !deploy [DEST_DIR] # Extract code blocks to directory
96
+ ```
97
+ - **`!deploy`** (no path): Current directory
98
+ - **`!deploy ./src`**: Specific directory
99
+
100
+ *Example:* `"Create REST API endpoint !deploy ./api"`
101
+
102
+ #### `!continue` - Resume Generation
103
+ ```text
104
+ !continue [MAX_TOKENS] # Continue stopped response
105
+ ```
106
+ - **`!continue`**: Default 2000 tokens
107
+ - **`!continue 3000`**: Custom token limit
108
+
109
+ *Example:* `"tl;dr !include large-file.txt !continue 5000"`
110
+
111
+ #### `!followup` - Thread Continuation
112
+ ```text
113
+ !followup # Equivalent to Ctrl-j
114
+ ```
115
+ *Example:*
116
+
117
+ Initial: `"Create Chrome extension"`
118
+
119
+ Follow-up: `"Add dark mode support !followup"`
120
+
121
+ #### **Command Combinations**
122
+ Chain multiple commands in one prompt:
123
+ ```text
124
+ "Create HTMX component !include ~/lib/styles.css !deploy ./components !continue 4000"
125
+ ```
126
+
127
+ ### 6. **Command-Line Mode `:VimLM`**
128
+ ```vim
129
+ :VimLM "prompt" [!command1] [!command2]...
130
+ ```
131
+ Use predefined command chains for repetitive tasks:
132
+
133
+ **Example 1 – CI/CD Fixer Macro**:
134
+ ```vim
135
+ " Debug CI failures using error logs
136
+ :VimLM Fix Dockerfile !include .gitlab-ci.yml !include $(tail -n 20 ci.log)
137
+ ```
138
+
139
+ **Example 2 – Test Generation Workflow**:
140
+ ```vim
141
+ " Generate unit tests for selected functions and save to test/
142
+ :VimLM Write pytest tests for this !include ./src !deploy ./test
143
+ ```
144
+
145
+ **Example 3 – Documentation Helper**:
146
+ ```vim
147
+ " Add docstrings to all Python functions in file
148
+ :VimLM Add Google-style docstrings !include % !continue 4000
149
+ ```
150
+
151
+ ### Key Bindings
152
+
153
+ | Binding | Mode | Action |
154
+ |------------|---------------|----------------------------------------|
155
+ | `Ctrl-l` | Normal/Visual | Send current file + selection to LLM |
156
+ | `Ctrl-j` | Normal | Continue conversation |
157
+ | `Ctrl-p` | Normal/Visual | Replace the selection with generated code |
158
+ | `Esc` | Prompt | Cancel input |
159
+
160
+ ## Advanced Configuration
161
+ VimLM uses a JSON config file with the following configurable parameters:
162
+ ```json
163
+ {
164
+ "LLM_MODEL": null,
165
+ "NUM_TOKEN": 2000,
166
+ "USE_LEADER": false,
167
+ "KEY_MAP": {},
168
+ "DO_RESET": true,
169
+ "SHOW_USER": false,
170
+ "SEP_CMD": "!",
171
+ "VERSION": "0.0.7",
172
+ "DEBUG": true
173
+ }
174
+ ```
175
+ ### Custom Model Setup
176
+ 1. **Browse models**: [MLX Community Models on Hugging Face](https://huggingface.co/mlx-community)
177
+ 2. **Edit config file**:
178
+ ```json
179
+ {
180
+ "LLM_MODEL": "mlx-community/DeepSeek-R1-Distill-Qwen-7B-4bit",
181
+ "NUM_TOKEN": 9999
182
+ }
183
+ ```
184
+ 3. **Save to**: `~/vimlm/cfg.json`
185
+ 4. **Restart VimLM**
186
+
187
+ ### Custom Key Bindings
188
+ You can also configure shortcuts:
189
+ ```json
190
+ {
191
+ "USE_LEADER": true, // Swap Ctrl for Leader key
192
+ "KEY_MAP": { // Remap default keys (l/j/p)
193
+ "l": "a", // <Leader>a instead of <Leader>l
194
+ "j": "s", // <Leader>s instead of <Leader>j
195
+ "p": "d" // <Leader>d instead of <Leader>p
196
+ }
197
+ }
198
+ ```
199
+
200
+ ## License
201
+
202
+ VimLM is licensed under the [Apache-2.0 license](LICENSE).
203
+
204
+
vimlm-0.0.7/README.md ADDED
@@ -0,0 +1,182 @@
1
+
2
+ # VimLM - Local LLM-Powered Coding Assistant for Vim
3
+
4
+ ![vimlm](https://raw.githubusercontent.com/JosefAlbers/VimLM/main/assets/captioned_vimlm.gif)
5
+
6
+ LLM-powered coding companion for Vim, inspired by GitHub Copilot/Cursor. Integrates contextual code understanding, summarization, and AI assistance directly into your Vim workflow.
7
+
8
+ ## Features
9
+
10
+ - **Model Agnostic** - Use any MLX-compatible model via a configuration file
11
+ - **Vim-Native UX** - Intuitive keybindings and split-window responses
12
+ - **Deep Context** - Understands code context from:
13
+ - Current file
14
+ - Visual selections
15
+ - Referenced files
16
+ - Project directory structure
17
+ - **Conversational Coding** - Iterative refinement with follow-up queries
18
+ - **Air-Gapped Security** - 100% offline - no APIs, no tracking, no data leaks
19
+
20
+ ## Requirements
21
+
22
+ - Apple M-series chip
23
+ - Python 3.12.8
24
+
25
+ ## Quick Start
26
+
27
+ ```zsh
28
+ pip install vimlm
29
+ vimlm
30
+ ```
31
+
32
+ ## Basic Usage
33
+
34
+ ### 1. **From Normal Mode**
35
+ **`Ctrl-l`**: Add current line + file to context
36
+
37
+ *Example prompt:* `"Regex for removing HTML tags from item.content"`
38
+
39
+ ### 2. **From Visual Mode**
40
+ Select code → **`Ctrl-l`**: Add selected block + current file to context
41
+
42
+ *Example prompt:* `"Convert this to async/await syntax"`
43
+
44
+ ### 3. **Follow-Up Conversations**
45
+ **`Ctrl-j`**: Continue current thread
46
+
47
+ *Example follow-up:* `"Use Manifest V3 instead"`
48
+
49
+ ### 4. **Code Extraction & Replacement**
50
+ **`Ctrl-p`**: Insert code blocks from response into:
51
+ - Last visual selection (Normal mode)
52
+ - Active selection (Visual mode)
53
+
54
+ **Workflow Example**:
55
+ 1. Select a block of code in Visual mode
56
+ 2. Prompt with `Ctrl-l`: `"Convert this to async/await syntax"`
57
+ 3. Press `Ctrl-p` to replace selection with generated code
58
+
59
+ ### 5. **Inline Commands**
60
+
61
+ #### `!include` - Add External Context
62
+ ```text
63
+ !include [PATH] # Add files/folders to context
64
+ ```
65
+ - **`!include`** (no path): Current folder
66
+ - **`!include ~/projects/utils.py`**: Specific file
67
+ - **`!include ~/docs/api-specs/`**: Entire folder
68
+
69
+ *Example:* `"AJAX-ify this app !include ~/scrap/hypermedia-applications.summ.md"`
70
+
71
+ #### `!deploy` - Generate Project Files
72
+ ```text
73
+ !deploy [DEST_DIR] # Extract code blocks to directory
74
+ ```
75
+ - **`!deploy`** (no path): Current directory
76
+ - **`!deploy ./src`**: Specific directory
77
+
78
+ *Example:* `"Create REST API endpoint !deploy ./api"`
79
+
80
+ #### `!continue` - Resume Generation
81
+ ```text
82
+ !continue [MAX_TOKENS] # Continue stopped response
83
+ ```
84
+ - **`!continue`**: Default 2000 tokens
85
+ - **`!continue 3000`**: Custom token limit
86
+
87
+ *Example:* `"tl;dr !include large-file.txt !continue 5000"`
88
+
89
+ #### `!followup` - Thread Continuation
90
+ ```text
91
+ !followup # Equivalent to Ctrl-j
92
+ ```
93
+ *Example:*
94
+
95
+ Initial: `"Create Chrome extension"`
96
+
97
+ Follow-up: `"Add dark mode support !followup"`
98
+
99
+ #### **Command Combinations**
100
+ Chain multiple commands in one prompt:
101
+ ```text
102
+ "Create HTMX component !include ~/lib/styles.css !deploy ./components !continue 4000"
103
+ ```
104
+
105
+ ### 6. **Command-Line Mode `:VimLM`**
106
+ ```vim
107
+ :VimLM "prompt" [!command1] [!command2]...
108
+ ```
109
+ Use predefined command chains for repetitive tasks:
110
+
111
+ **Example 1 – CI/CD Fixer Macro**:
112
+ ```vim
113
+ " Debug CI failures using error logs
114
+ :VimLM Fix Dockerfile !include .gitlab-ci.yml !include $(tail -n 20 ci.log)
115
+ ```
116
+
117
+ **Example 2 – Test Generation Workflow**:
118
+ ```vim
119
+ " Generate unit tests for selected functions and save to test/
120
+ :VimLM Write pytest tests for this !include ./src !deploy ./test
121
+ ```
122
+
123
+ **Example 3 – Documentation Helper**:
124
+ ```vim
125
+ " Add docstrings to all Python functions in file
126
+ :VimLM Add Google-style docstrings !include % !continue 4000
127
+ ```
128
+
129
+ ### Key Bindings
130
+
131
+ | Binding | Mode | Action |
132
+ |------------|---------------|----------------------------------------|
133
+ | `Ctrl-l` | Normal/Visual | Send current file + selection to LLM |
134
+ | `Ctrl-j` | Normal | Continue conversation |
135
+ | `Ctrl-p` | Normal/Visual | Replace the selection with generated code |
136
+ | `Esc` | Prompt | Cancel input |
137
+
138
+ ## Advanced Configuration
139
+ VimLM uses a JSON config file with the following configurable parameters:
140
+ ```json
141
+ {
142
+ "LLM_MODEL": null,
143
+ "NUM_TOKEN": 2000,
144
+ "USE_LEADER": false,
145
+ "KEY_MAP": {},
146
+ "DO_RESET": true,
147
+ "SHOW_USER": false,
148
+ "SEP_CMD": "!",
149
+ "VERSION": "0.0.7",
150
+ "DEBUG": true
151
+ }
152
+ ```
153
+ ### Custom Model Setup
154
+ 1. **Browse models**: [MLX Community Models on Hugging Face](https://huggingface.co/mlx-community)
155
+ 2. **Edit config file**:
156
+ ```json
157
+ {
158
+ "LLM_MODEL": "mlx-community/DeepSeek-R1-Distill-Qwen-7B-4bit",
159
+ "NUM_TOKEN": 9999
160
+ }
161
+ ```
162
+ 3. **Save to**: `~/vimlm/cfg.json`
163
+ 4. **Restart VimLM**
164
+
165
+ ### Custom Key Bindings
166
+ You can also configure shortcuts:
167
+ ```json
168
+ {
169
+ "USE_LEADER": true, // Swap Ctrl for Leader key
170
+ "KEY_MAP": { // Remap default keys (l/j/p)
171
+ "l": "a", // <Leader>a instead of <Leader>l
172
+ "j": "s", // <Leader>s instead of <Leader>j
173
+ "p": "d" // <Leader>d instead of <Leader>p
174
+ }
175
+ }
176
+ ```
177
+
178
+ ## License
179
+
180
+ VimLM is licensed under the [Apache-2.0 license](LICENSE).
181
+
182
+
@@ -5,7 +5,7 @@ with open("requirements.txt") as f:
5
5
 
6
6
  setup(
7
7
  name="vimlm",
8
- version="0.0.5",
8
+ version="0.0.7",
9
9
  author="Josef Albers",
10
10
  author_email="albersj66@gmail.com",
11
11
  readme='README.md',
@@ -0,0 +1,204 @@
1
+ Metadata-Version: 2.2
2
+ Name: vimlm
3
+ Version: 0.0.7
4
+ Summary: VimLM - LLM-powered Vim assistant
5
+ Home-page: https://github.com/JosefAlbers/vimlm
6
+ Author: Josef Albers
7
+ Author-email: albersj66@gmail.com
8
+ Requires-Python: >=3.12.8
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: nanollama==0.0.5
12
+ Requires-Dist: mlx_lm_utils==0.0.2
13
+ Requires-Dist: watchfiles==1.0.4
14
+ Dynamic: author
15
+ Dynamic: author-email
16
+ Dynamic: description
17
+ Dynamic: description-content-type
18
+ Dynamic: home-page
19
+ Dynamic: requires-dist
20
+ Dynamic: requires-python
21
+ Dynamic: summary
22
+
23
+
24
+ # VimLM - Local LLM-Powered Coding Assistant for Vim
25
+
26
+ ![vimlm](https://raw.githubusercontent.com/JosefAlbers/VimLM/main/assets/captioned_vimlm.gif)
27
+
28
+ LLM-powered coding companion for Vim, inspired by GitHub Copilot/Cursor. Integrates contextual code understanding, summarization, and AI assistance directly into your Vim workflow.
29
+
30
+ ## Features
31
+
32
+ - **Model Agnostic** - Use any MLX-compatible model via a configuration file
33
+ - **Vim-Native UX** - Intuitive keybindings and split-window responses
34
+ - **Deep Context** - Understands code context from:
35
+ - Current file
36
+ - Visual selections
37
+ - Referenced files
38
+ - Project directory structure
39
+ - **Conversational Coding** - Iterative refinement with follow-up queries
40
+ - **Air-Gapped Security** - 100% offline - no APIs, no tracking, no data leaks
41
+
42
+ ## Requirements
43
+
44
+ - Apple M-series chip
45
+ - Python 3.12.8
46
+
47
+ ## Quick Start
48
+
49
+ ```zsh
50
+ pip install vimlm
51
+ vimlm
52
+ ```
53
+
54
+ ## Basic Usage
55
+
56
+ ### 1. **From Normal Mode**
57
+ **`Ctrl-l`**: Add current line + file to context
58
+
59
+ *Example prompt:* `"Regex for removing HTML tags from item.content"`
60
+
61
+ ### 2. **From Visual Mode**
62
+ Select code → **`Ctrl-l`**: Add selected block + current file to context
63
+
64
+ *Example prompt:* `"Convert this to async/await syntax"`
65
+
66
+ ### 3. **Follow-Up Conversations**
67
+ **`Ctrl-j`**: Continue current thread
68
+
69
+ *Example follow-up:* `"Use Manifest V3 instead"`
70
+
71
+ ### 4. **Code Extraction & Replacement**
72
+ **`Ctrl-p`**: Insert code blocks from response into:
73
+ - Last visual selection (Normal mode)
74
+ - Active selection (Visual mode)
75
+
76
+ **Workflow Example**:
77
+ 1. Select a block of code in Visual mode
78
+ 2. Prompt with `Ctrl-l`: `"Convert this to async/await syntax"`
79
+ 3. Press `Ctrl-p` to replace selection with generated code
80
+
81
+ ### 5. **Inline Commands**
82
+
83
+ #### `!include` - Add External Context
84
+ ```text
85
+ !include [PATH] # Add files/folders to context
86
+ ```
87
+ - **`!include`** (no path): Current folder
88
+ - **`!include ~/projects/utils.py`**: Specific file
89
+ - **`!include ~/docs/api-specs/`**: Entire folder
90
+
91
+ *Example:* `"AJAX-ify this app !include ~/scrap/hypermedia-applications.summ.md"`
92
+
93
+ #### `!deploy` - Generate Project Files
94
+ ```text
95
+ !deploy [DEST_DIR] # Extract code blocks to directory
96
+ ```
97
+ - **`!deploy`** (no path): Current directory
98
+ - **`!deploy ./src`**: Specific directory
99
+
100
+ *Example:* `"Create REST API endpoint !deploy ./api"`
101
+
102
+ #### `!continue` - Resume Generation
103
+ ```text
104
+ !continue [MAX_TOKENS] # Continue stopped response
105
+ ```
106
+ - **`!continue`**: Default 2000 tokens
107
+ - **`!continue 3000`**: Custom token limit
108
+
109
+ *Example:* `"tl;dr !include large-file.txt !continue 5000"`
110
+
111
+ #### `!followup` - Thread Continuation
112
+ ```text
113
+ !followup # Equivalent to Ctrl-j
114
+ ```
115
+ *Example:*
116
+
117
+ Initial: `"Create Chrome extension"`
118
+
119
+ Follow-up: `"Add dark mode support !followup"`
120
+
121
+ #### **Command Combinations**
122
+ Chain multiple commands in one prompt:
123
+ ```text
124
+ "Create HTMX component !include ~/lib/styles.css !deploy ./components !continue 4000"
125
+ ```
126
+
127
+ ### 6. **Command-Line Mode `:VimLM`**
128
+ ```vim
129
+ :VimLM "prompt" [!command1] [!command2]...
130
+ ```
131
+ Use predefined command chains for repetitive tasks:
132
+
133
+ **Example 1 – CI/CD Fixer Macro**:
134
+ ```vim
135
+ " Debug CI failures using error logs
136
+ :VimLM Fix Dockerfile !include .gitlab-ci.yml !include $(tail -n 20 ci.log)
137
+ ```
138
+
139
+ **Example 2 – Test Generation Workflow**:
140
+ ```vim
141
+ " Generate unit tests for selected functions and save to test/
142
+ :VimLM Write pytest tests for this !include ./src !deploy ./test
143
+ ```
144
+
145
+ **Example 3 – Documentation Helper**:
146
+ ```vim
147
+ " Add docstrings to all Python functions in file
148
+ :VimLM Add Google-style docstrings !include % !continue 4000
149
+ ```
150
+
151
+ ### Key Bindings
152
+
153
+ | Binding | Mode | Action |
154
+ |------------|---------------|----------------------------------------|
155
+ | `Ctrl-l` | Normal/Visual | Send current file + selection to LLM |
156
+ | `Ctrl-j` | Normal | Continue conversation |
157
+ | `Ctrl-p` | Normal/Visual | Replace the selection with generated code |
158
+ | `Esc` | Prompt | Cancel input |
159
+
160
+ ## Advanced Configuration
161
+ VimLM uses a JSON config file with the following configurable parameters:
162
+ ```json
163
+ {
164
+ "LLM_MODEL": null,
165
+ "NUM_TOKEN": 2000,
166
+ "USE_LEADER": false,
167
+ "KEY_MAP": {},
168
+ "DO_RESET": true,
169
+ "SHOW_USER": false,
170
+ "SEP_CMD": "!",
171
+ "VERSION": "0.0.7",
172
+ "DEBUG": true
173
+ }
174
+ ```
175
+ ### Custom Model Setup
176
+ 1. **Browse models**: [MLX Community Models on Hugging Face](https://huggingface.co/mlx-community)
177
+ 2. **Edit config file**:
178
+ ```json
179
+ {
180
+ "LLM_MODEL": "mlx-community/DeepSeek-R1-Distill-Qwen-7B-4bit",
181
+ "NUM_TOKEN": 9999
182
+ }
183
+ ```
184
+ 3. **Save to**: `~/vimlm/cfg.json`
185
+ 4. **Restart VimLM**
186
+
187
+ ### Custom Key Bindings
188
+ You can also configure shortcuts:
189
+ ```json
190
+ {
191
+ "USE_LEADER": true, // Swap Ctrl for Leader key
192
+ "KEY_MAP": { // Remap default keys (l/j/p)
193
+ "l": "a", // <Leader>a instead of <Leader>l
194
+ "j": "s", // <Leader>s instead of <Leader>j
195
+ "p": "d" // <Leader>d instead of <Leader>p
196
+ }
197
+ }
198
+ ```
199
+
200
+ ## License
201
+
202
+ VimLM is licensed under the [Apache-2.0 license](LICENSE).
203
+
204
+
@@ -0,0 +1,3 @@
1
+ nanollama==0.0.5
2
+ mlx_lm_utils==0.0.2
3
+ watchfiles==1.0.4