ethanpil / LuaScript

Notepad++ plugin for Lua scripting capabilities

Home Page:https://dail8859.github.io/LuaScript/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LuaScript

Notepad++ plugin for Lua scripting capabilities. Provides control over all of Scintilla's features and options with a light-weight, fully-functional programming language. Download it from the Release page.

Major features include:

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

Documentation

The full API documentation can be found here.

Examples

Just show me what it can do! Also, check out the examples directory.

  • Change Notepad++'s ugly marker symbols:
-- Notepad++ uses 24 internally
editor:MarkerDefine(24, SC_MARK_BOOKMARK)
editor.MarkerFore[24] = 0x0000EE
editor.MarkerBack[24] = 0x6060F2
  • Find all instances of image345.jpg, image123.png, etc and modify the number:
for m in editor:match("(image)(\\d+)(\\.(jpg|png))", SCFIND_REGEXP) do
    i = tonumber(editor.Tag[2])
    m:replace(editor.Tag[1] .. i + 1 .. editor.Tag[3])
end
  • Get some of Visual Studio's copy and paste functionality:
-- Mimic Visual Studio's "Ctrl+C" that copies the entire line if nothing is selected
npp.AddShortcut("Copy Allow Line", "Ctrl+C", function()
	editor:CopyAllowLine()
end)

-- Mimic Visual Studio's "Ctrl+X" that cuts the line if nothing is selected
npp.AddShortcut("Cut Allow Line", "Ctrl+X", function()
	if editor.SelectionEmpty then
		editor:CopyAllowLine()
		editor:LineDelete()
	else
		editor:Cut()
	end
end)

Development

The code has been developed using MSVC 2013. To compile the code:

  1. Open the LuaScript.sln file
  2. Select the Win32 platform (x64 is currently experimental)
  3. Press F7 and that's it!

For convenience, MSVC 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.

About

Notepad++ plugin for Lua scripting capabilities

https://dail8859.github.io/LuaScript/

License:GNU General Public License v2.0


Languages

Language:C 55.7%Language:C++ 29.9%Language:HTML 7.0%Language:Lua 2.3%Language:Objective-C 2.0%Language:Python 1.8%Language:Makefile 0.8%Language:CSS 0.5%Language:Batchfile 0.0%