5/19/2023 0 Comments Textadept speed test![]() ![]() I feel that LPeg is more flexible and has a sense of programming. LPeg can be said to be quite powerful, but also will give you a completely different experience. If you’re not familiar with it, check out the official documentation or Textadept’s manual. Common matching is fine, that is, there is a relatively large difference with the commonly used regular expressions, but in general the syntax is still similar. In most places the author uses this scheme. Let me talk about these three pattern matching schemes. ![]() Of course, if you hold a learning attitude, it may be more helpful to you. Textadept uses three different pattern matching schemes in different places. If you haven’t used Lua before, I think the thing that will probably be most unfamiliar to you is Lua’s pattern matching. In addition to these, I also use folding (code folding), File Browser, etc. It provides auto-completion of languages, shortcuts, and snippets. I believe the language modules are the ones you use the most. Mitchell is a very enthusiastic person, and he answered all the questions I asked. To avoid reinventing wheels, you’d better read this Wiki. Some feelings of JavaScript programming can be used for reference. Some people say that Lua is like JavaScript, and I think so too. _M.file_browser = require('file_browser') Never write all your code in a single a, the way Lua imports modules is simple. If you want to use someone else’s extensions or write your own extensions, you will have to import modules. The easiest way is to set the font (as well as the theme) for Textadept in the first line of ~/.textadept/a, and the font has to support both English and Chinese, such as WenQuanYi Micro Hei: view:set_theme('light', widget "*" style "wqyfont" User modules Then why do other editors using Courier New display Chinese characters well? The reason is that they check the system’s fallback fonts, but Textadept because of the minimalism, of course, doesn’t check, so we have to manually configure it. Since the encoding has been corrected, then why still doesn’t show up? The reason is that the font used by Textadept for the code is directly taken from the default monospace font of GTK, which may be Courier New under Windows, but this is a problem, this font does not have Chinese characters. We probably won’t see it on Linux, but Chinese characters probably won’t show up on Windows. Once added, you will notice that opening GBK encoded files does not crash. To support GBK encoding, we need to add gbk to io.encodings in core/file_io.lua. It may take a long time for Linux users who commonly use UTF-8 to notice it, but other encodings are often encountered on Windows. Only some common encodings for Latin languages are listed. Textadept doesn’t list all possible encodings in its table like some other editors do, for reasons of minimalism and efficiency. I’ll start with this since I just mentioned encoding. How easy it would be to program if paths use slashes instead of backslashes like Linux. These are since paths or files under Windows like to use an anti-human GBK series encoding (for Chinese users). So Textadept needs to be configured a little bit more in Windows than in Linux to be configured properly. Anyone who’s ever used Lua or GTK will think they run better on Linux. We know that Textadept is a cross-platform, graphical interface based on GTK. To facilitate your daily use of Textadept. ![]() In the previous blog, I recommended Textadept to everyone, and in this article, I will talk about my Textadept experience.
0 Comments
Leave a Reply. |