Skip to content

dail8859/LuaScript

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
October 27, 2022 08:51
March 28, 2022 19:02
March 28, 2022 19:02
February 9, 2018 08:32
src
October 27, 2022 08:51
January 19, 2016 16:29
October 27, 2022 08:51
October 27, 2022 08:51

LuaScript

Build status

Notepad++ plugin for Lua scripting capabilities. This provides control over all of Scintilla's features and options with a light-weight, fully-functional programming language.

Major features include:

  • Assign Lua functions to shortcut keys
  • Register callback functions for events
  • Full Lua 5.3 functionality
  • Interactive console with auto-completion
  • Requires no special permissions

Getting Started

Install the plugin using the Notepad++ Plugin Admin, or you can manually download it from the Release page and extract the zip into your plugins folder.

Lua Console

LuaScript provides an interactive console for running Lua commands. This can be shown by Plugins > LuaScript > Show Console.

Startup Script

LuaScript looks for the \plugins\config\startup.lua file and automatically runs it on Notepad++ startup. You can easily edit this file via Plugins > LuaScript > Edit Startup Script. You can include any commands you want to immediately execute on program startup, as well as register any additional shortcuts or callbacks.

Registering New Shortcuts

New functions can be added as shortcuts by using AddShortcut. The new menu items are listed under the Plugins > LuaScript menu. For example this script adds 2 new menu items.

Registering Callback Functions

Scripts can also register functions to be called when certain events occur, such as a file being opened, text being modified, etc. Each callback provides a different set of parameters. See the documentation for callbacks to see the entire list of possible events and parameters provided.

Documentation

The full API documentation can be found here. Also be sure to check out the examples directory.

Development

The code has been developed using Visual Studio 2019. To compile the code:

  1. Open the LuaScript.sln file
  2. Press F7 and that's it!

For convenience, Visual Studio automatically copies the DLL into the Notepad++ plugin directory.

License

This code is released under the GNU General Public License version 2.

Thanks

Special thanks to the PythonScript plugin and SciTE.