Enhance the code prompt function of the scite Editor

Source: Internet
Author: User

Link: http://blog.csdn.net/zhangxaochen/article/details/8104034

Write Lua in Windows. The best editor I can find is the scite IN THE luaforwindows project. NPP (Notepad ++) will also be used, but onlyCodeHighlighting and simple word/function prompts are really simple compared with scite. Many people say that Vim is the best, but I don't know why I am more distant from vim, that is, I don't like it very much. I will explore Vim when necessary.

Scite is really good. You can perform one-step debugging on Lua Code, set breakpoints, view variable values, stack tracking, and code prompts (more powerful than NPP ). For debugging, scite in luaforwindows has been configured, mainly because the default code prompts still need to be improved.
By default, scite only prompts the function parameter list. When you enter print and press '(', a prompt is displayed.

But if I don't know the print function or whether it is print or printf, what should I do if I want scite to prompt me?
Only need to changeSciteglobal. PropertiesAdd a sentence to the file:
AutoComplete. *. Start. characters =. $ (chars. Alpha)

It means that when you press the period '.' And the period key, an automatic completion prompt is displayed. If you press 'P', The 'pairs, pcall, and print 'prompt is displayed. We can see that there is no printf in the standard library.

Of course, this prompt can be customized by yourself.Lua. PropertiesThe API file is specified:
Api. $ (file. patterns. Lua) = $ (scitedefaulthome) \ lualib5_annot.api

OpenLualib5_annot.apiThis file shows a line like this:
Print (E1, E2,...) Prints values to stdout using tostring
This is the so-called code prompt content.

If you want to write your own API file, add the custom file name xxx. API to the configuration file, so:
Api. $ (file. patterns. Lua) = $ (scitedefaulthome) \ lualib5_annot.api; $ (scitedefaulthome) \ XXX. API

Note that the two API file paths are separated by semicolons. Do not use spaces after the semicolons.

Then you can write your own code prompts in XXX. API.

In addition, you can add the following sentence to the sciteglobal. properties file:
AutoComplete. *. fillups = (

After the code prompts, You need to press the tab key to complete it. Now press the left brace '(', saving you the need to press the tab button to relieve fatigue.

Link: http://blog.csdn.net/zhangxaochen/article/details/8104034

{Over }}

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.