(2) Build a Lua environment using EditPlus to build a Lua Development Environment

Source: Internet
Author: User

I. syntax highlighting

Enable EditPlus,ToolsTools --"PreferencesPreference =Setting & syntaxSyntax

ClickAddButton to add a file type, in the followingDescr resume ptionEnterLua,FIle extensionEnterLua. Note that you can select one of the following columns:Syntax FileThis is where the Lua syntax file is provided. With this feature, EditPlus can support the highlighted keyword display of lua code. This highlighted support code can be found online (http://download.csdn.net/source/2225860 ).

Ii. Custom OPERATION button

Enable EditPlus,ToolsTools --"PreferencesPreferences --"User toolsUser tools

SelectUser toolsOption, clickAdd Tool -- Program
ThenMenu TextEnter in the columnRun_Lua 
InCommandEnter in the columnLua 
InArgumentEnter in the column$ (FileName)
InInitial directoryEnter in the column$ (FileDir)

Check the output and click the output mode. In the regular expression, enter ^ (.: //. *): ([0-9]):. *
After changing all settings, do not forget to clickApplyApplication, and then clickOK

 

3. Define a function template.

Why? Because one {
Function onclick ()
{
Function onclick ()
{
Function onclick ()
{
Sendmsg ('PW _ ajax. php', 'Action = relatetag & tagname = lua file', this. id)
}
}
}
} "> There are often a lot of functions in the lua file. It is very troublesome to find a function. If you press ctrl F11 to list the functions, it will be much better. How many functions can be seen at a glance. To do this, click [function TEMPLATE] in the configuration syntax window just now. In the function template definition expression, type the following: function [a-zA-Z0-9] +/([a-zA-Z0-9,] +/)/n. */nend

 

4. Set your own template
Browse your template file and name it template. lua
My template file is as follows:


-- Encoding: UTF-8


------------------------------------------------
-- Program name:
-- Version:
-- Author:
-- Author's homepage:
-- Project homepage:
--
-- This extension follows GPLv3 release
------------------------------------------------
Print (_ VERSION)
Print ("Hello, Lua! ")
-- Single line comments in Lua start with double hyphen.
-- [Multi-line comment
Two square brackets
] --

5. Create test. lua

Press ctrl + 1 to view the output result. Press ctrl + F11 to view the function list.

 
SelectFile -- New -- Others...And then selectLuaFile, write a line of code as follows:
Print ("Hello, Lua! ")
Save it. SelectToolsMenu, with the following custom commandsRun_LuaClick this command to complete the execution of the lua file (or press Ctrl + 1 ). The execution result is a console written with "Hello, Lua. If it doesn't appear, it means you don't have Lua compiler, You need to download one, you can download Lua For Windows, URL: http://code.google.com/p/luaforwindows/downloads/list

After the installation is downloaded, specify the compilation path in EditPlus: Tools-> Preferences-> Tools-> User tools-> Command-> select the path of the installed lua.exe-> Apply-> OK. Run the program again.

 

In this way, you can use EditPlus to read and write lua comfortably. It is lightweight and convenient to use EditPlus to write scripts.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.