Build Lua environment with EditPlus to build Lua Development Environment

Source: Internet
Author: User

Build a Lua EnvironmentExploitationEditPlusBuildLuaThe development environment is the content to be introduced in this article, mainly to learnLuaOfEnvironment ConstructionAnd the configuration of the development environment. For more information, see this article.

I. syntax highlighting

OpenEditPlus, Tools tool, and then select Preferences, in the select setting & syntax

Click the Add button on the right to Add a file type, and enter the file type in the Descr resume ption column below.Lua, Fill in the FIle extension ColumnLua. Be careful that there is another column below to choose SyntaxFile, Which is supplyLuaWhere the syntax file www.dj5g.com is located. With this feature, EditPlus can support the exposure of highlighted keywords in lua code. This highlighted support code can be found online

 
 
  1. (http://download.csdn.net/source/2225860) 

Ii. Custom OPERATION button

OpenEditPlus, Tools tools, Preferences, User Tools, User tools

Select the User tools option on the left and click Add Tool Program on the right.

Then, enter Run_Lua in the Menu Text column.

Enter lua in the Command column.

Enter $ (FileName) in the Argument column)

Enter $ (FileDir) in the Initial directory column)

Click the output format and enter ^ (.: //. *) in the regular expression: ([0-9]):. *

After changing all the settings, do not forget to click Apply to use it, and then click OK.

3. Define a function template.

Why? Because a lua file often contains many functions, it is very complicated to find a function. If you press ctrl F11 to display the number list, it will be much better. How many functions are clear at a glance. To do this, click [function TEMPLATE] In the syntax window just now. In the function template definition expression, enter the following: function [a-zA-Z0-9] +/([a-zA-Z0-9 www.gsd2.com,] ++)/n. */nend

4. Set your own template

The template file of the Expo, named "template.Lua

My template file is as follows:

 
 
  1. encoding: UTF-8 

Process name:

Version:

Author:
 
Author's homepage:
 
Project homepage:

This stretch complies with GPLv3 announcement

 
 
  1. Print (_ VERSION)
  2. Print ("Hello, Lua! ")
  3. Single line comments in Lua start with double hyphen.
  4. [Multi-line comment
  5. Two square brackets
  6. ]

5. Build test. lua

Ctrl + 1 to see the output, ctrl + F11 to view the function list.

Choose File New Others... and then choose the Lua File we just created. Write a line of code as follows:

 
 
  1. print("Hello,Lua!") 

And keep it. Choose the Tools menu, and click the custom call Run_Lua at the bottom. Click this call to final The lua file. The corresponding shortcut key may be Ctrl + 1 ). The best result is to bring up a browser with "Hello, Lua. In case you haven't revealed that you haven't Lua compiler, you must download one that 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 previously installed lua.exe-> Apply-> OK. Now let's run the process again.

So that you can useEditPlusComfortable read/writeLua. UseEditPlusThe script writing process is lightweight and decent. This article puts forward some pioneering advocates for common issues that are easily revealed in Java code.

Summary: DetailsBuild a Lua EnvironmentExploitationEditPlusBuildLuaThe development environment has been introduced, and I hope this article will help you!

Related Article

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.