Skip to content

Qdthon/Notepad-AIPlugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Assistant Plugin for Notepad++

License: GPL v2 Platform Notepad++

A Notepad++ plugin that integrates AI capabilities (ChatGPT, Claude, Gemini) directly into the editor.

AI Panel Screenshot

Features

  • Dockable AI Chat Panel - Opens on the right side of Notepad++
  • Multiple AI Providers - Support for OpenAI (ChatGPT), Anthropic (Claude), and Google (Gemini)
  • Custom Endpoints - Use OpenRouter, local LLMs, or any OpenAI-compatible API
  • Context-Aware - Automatically includes file content and selected text in prompts
  • Apply AI Suggestions - Apply AI-generated code changes directly to your document
  • Keyboard Shortcut - Ctrl+Shift+A to toggle the AI panel

Table of Contents

Installation

From Release

  1. Download the latest release from Releases
  2. Extract the appropriate DLL for your Notepad++ version:
    • 64-bit Notepad++: Use notepad_aiplug_x64.dll
    • 32-bit Notepad++: Use notepad_aiplug_x86.dll
  3. Copy the DLL to your Notepad++ plugins folder:
    %ProgramFiles%\Notepad++\plugins\notepad_aiplug\notepad_aiplug.dll
    
  4. Restart Notepad++
  5. Configure your API keys in Plugins > AI Assistant > Settings

From Source

See Building from Source below.

Quick Start

  1. Open the AI Panel: Press Ctrl+Shift+A or go to Plugins > AI Assistant > Show AI Panel
  2. Go to Plugins > AI Assistant > Settings and enter your API key
  3. Select a provider from the dropdown
  4. Type your question and press Send

Usage

Opening the AI Panel

  • Press Ctrl+Shift+A, or
  • Go to Plugins > AI Assistant > Show AI Panel

The panel will dock on the right side of Notepad++.

Basic Workflow

  1. Select a provider from the dropdown (ChatGPT, Claude, Gemini, or custom)
  2. Type your question in the prompt box at the bottom
  3. Click Send or press Enter
  4. View the AI response in the chat history

Using File Context

Check "Include file context" to send your current file to the AI:

Selection State What Gets Sent
Text selected Only the selected text
No selection Entire file content with file path and language

This allows the AI to understand your code and provide relevant suggestions.

Applying AI Suggestions

When the AI provides code:

  1. Click Apply to insert/replace code in your document
  2. If text was selected, it replaces the selection
  3. If no selection, it replaces the entire document

Custom Endpoints

You can use any OpenAI-compatible API by setting a custom URL:

OpenRouter Example
  • Provider: ChatGPT (OpenAI) - uses OpenAI API format
  • API Key: Your OpenRouter API key (sk-or-v1-...)
  • Custom URL: https://openrouter.ai/api/v1/chat/completions
Local LLM Example (Ollama, LM Studio)
  • Provider: ChatGPT (OpenAI)
  • API Key: not-needed (or leave empty if your server doesn't require it)
  • Custom URL: http://localhost:11434/v1/chat/completions

Adding Custom Providers

  1. Open Settings
  2. Enter a new name in the Provider Name field
  3. Enter the API Key and Custom URL
  4. Click Add Provider

Custom providers appear in the dropdown alongside built-in providers.

Configuration

Settings are stored in:

%APPDATA%\Notepad++\plugins\config\notepad_aiplug.ini

Getting API Keys

Provider Link
OpenAI (ChatGPT) platform.openai.com/api-keys
Anthropic (Claude) console.anthropic.com
Google (Gemini) makersuite.google.com/app/apikey
OpenRouter openrouter.ai/keys

Default API Endpoints

Provider Default URL
OpenAI https://api.openai.com/v1/chat/completions
Claude https://api.anthropic.com/v1/messages
Gemini https://generativelanguage.googleapis.com/v1/models/{model}:generateContent

Building from Source

Prerequisites

  • Visual Studio 2019 or 2022 with C++ Desktop Development workload
  • Windows 10 SDK

Build Steps

# Clone the repository
git clone https://github.com/user/notepad_aiplug.git
cd notepad_aiplug

# Open solution in Visual Studio
start notepad_aiplug.sln
  1. Select configuration:
    • Release|x64 for 64-bit Notepad++
    • Release|Win32 for 32-bit Notepad++
  2. Build the solution (Ctrl+Shift+B)
  3. Copy the output DLL:
    • 32-bit: bin\notepad_aiplug.dll
    • 64-bit: bin64\notepad_aiplug.dll

Project Structure

notepad_aiplug/
├── src/
│   ├── PluginDefinition.cpp    # Main plugin logic
│   ├── NppPluginDemo.cpp       # DLL entry point
│   ├── DockingFeature/         # UI dialogs
│   │   ├── AIPanelDlg.*        # AI chat panel
│   │   ├── SettingsDlg.*       # Settings dialog
│   │   └── DiffViewDlg.*       # Diff viewer
│   ├── AIProviders/            # AI provider implementations
│   │   ├── OpenAIProvider.*    # ChatGPT / OpenAI-compatible
│   │   ├── ClaudeProvider.*    # Claude
│   │   └── GeminiProvider.*    # Gemini
│   ├── Http/
│   │   └── HttpClient.*        # WinHTTP wrapper
│   └── Utils/
│       └── Config.*            # Settings management
├── include/                    # Notepad++/Scintilla headers
├── res/                        # Dialog resources
├── lib/nlohmann/json.hpp       # JSON library
├── vs.proj/                    # Visual Studio project
└── notepad_aiplug.sln          # Solution file

Troubleshooting

"API key not set" error

Go to Settings and enter your API key for the selected provider.

"HTTP error 401" (Unauthorized)
  • Check that your API key is correct
  • For OpenRouter: Make sure you're using the OpenRouter key, not an OpenAI key
"HTTP error 402" (Payment Required)
Custom endpoint not working
  • Ensure the URL is correct and includes the full path (e.g., /v1/chat/completions)
  • Check that the endpoint uses OpenAI-compatible API format
Plugin not appearing in Notepad++
  • Ensure the DLL is in the correct folder: plugins\notepad_aiplug\notepad_aiplug.dll
  • Check that you're using the correct version (32-bit vs 64-bit)
  • Restart Notepad++

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the GPL v2 License - see the LICENSE file for details.

Author

Jiawei Qi - 2026

Acknowledgments

About

AI plugin for Notepad++

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors