Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e48eea7

Browse filesBrowse files
committed
new readme
1 parent cf6bdca commit e48eea7
Copy full SHA for e48eea7

File tree

Expand file treeCollapse file tree

1 file changed

+71
-13
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+71
-13
lines changed

‎README.md

Copy file name to clipboard
+71-13Lines changed: 71 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,83 @@
1-
# Code Explain
1+
# codeexplain.nvim
22

3-
## Python dependencies
4-
```bash
5-
pip install pynvim langchain pygpt4all llama-cpp-python pygments
6-
```
3+
codeexplain.nvim is a NeoVim plugin that uses the powerful [GPT4ALL](https://gpt4all.io/) language model to provide on-the-fly, line-by-line explanations and potential security vulnerabilities for selected code directly in your NeoVim editor. It's like having your personal code assistant right inside your editor without leaking your codebase to any company.
4+
5+
![Demo](https://github.com/mthbernardes/codeexplain.nvim/assets/12648924/734f1687-d506-4b0b-9dd0-6e9232284e09)
6+
7+
## Features
8+
- No internet necessary
9+
- Automatic language detection for explaining code.
10+
- Supports a wide range of programming languages.
11+
- Powered by [GPT4ALL](https://gpt4all.io/) for code explanation.
12+
- Identification of potential security vulnerabilities.
13+
- Creates a new NeoVim window to display the explanations.
14+
15+
## Installation
16+
17+
### Download the GPT4ALL model
18+
19+
Before installing the plugin, download the GPT4ALL model and save it in your home directory:
720

8-
## Model
921
```bash
1022
mkdir -p "$HOME/.codeexplain/"
1123
curl -o "$HOME/.codeexplain/model.bin" https://gpt4all.io/models/ggml-gpt4all-j-v1.3-groovy.bin
1224
```
1325

14-
## Packer
15-
```
16-
use { 'mthbernardes/codeexplain.nvim', run = ':UpdateRemotePlugins' }
26+
### vim-plug
27+
28+
Add the following line to your `init.vim`:
29+
30+
```vim
31+
Plug 'mthbernardes/codeexplain.nvim'
1732
```
1833

19-
## vim-plug
20-
```
21-
Plug 'mthbernardes/codeexplain.nvim', { 'do': ':UpdateRemotePlugins' }
34+
Then run the following commands in your NeoVim editor:
35+
36+
```vim
37+
:source %
38+
:PlugInstall
2239
```
2340

41+
### packer.nvim
42+
43+
Add the following to your `plugins.lua` file:
44+
45+
```lua
46+
use 'mthbernardes/codeexplain.nvim'
47+
```
48+
49+
Then run `PackerSync` in your NeoVim editor.
50+
51+
### Other package managers
52+
53+
Please refer to your package manager's documentation for installation instructions. The general process involves adding a line to your `init.vim` (or equivalent configuration file) and running an installation command.
54+
2455
## Usage
25-
Select the piece of code and invoke the command `CodeExplain`
56+
57+
Once installed, you can use the plugin by selecting a piece of code in Visual mode and running the `CodeExplain` command:
58+
59+
```vim
60+
:CodeExplain
61+
```
62+
63+
A new window will be opened in your NeoVim editor, displaying line-by-line explanations of the selected code and potential security vulnerabilities.
64+
65+
## Requirements
66+
67+
- NeoVim
68+
- Python3
69+
- pynvim
70+
- langchain
71+
- pygments
72+
73+
## Contributions
74+
75+
Contributions are welcome! Please feel free to submit a pull request.
76+
77+
## License
78+
79+
codeexplain.nvim is open-source software licensed under the [MIT license](LICENSE).
80+
81+
## Disclaimer
82+
83+
This plugin uses GPT-4all to provide line-by-line explanations and to point out potential security vulnerabilities in your code. While it strives to be helpful, it's not a replacement for understanding your code or manually checking for security vulnerabilities. Always verify the information provided by this plugin.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.