在 SciTE 中重新格式化 80 列文本(或者更好的是 LaTeX)
我最近在 Lix 这样的所见即所得编辑器的帮助下开始研究 LaTeX。现在我开始在 Sci-TE 中编写 tex 文件,它已经具有语法高亮显示,并且我调整了 tex.properties 文件以在 Windows 中工作,显示 Go 上的预览 [F5]
Lyx 做了一件漂亮的事情,但很难用它来实现一个常见的文本编辑器,是将文本格式化为 80 列:我可以写一个段落,每次到达边缘列附近时都按回车键,但如果在初稿之后,我想在这里或那里添加或删除一些单词,我就会结束打破布局并必须重新排列换行符。
在 Sci-TE 中拥有一个工具会很有用,这样我就可以选择添加或删除了一些单词的文本段落,并将其重新排列为 80 列。可能不适用于整个文档,因为它可能会破坏一些预期的换行符。
也许我可以轻松地为 geany 编写一个 Python 插件,我看到 vim 有类似的东西,但我想知道它是否' 在 Sci-TE 中也是可能的。
I recently dived into LaTeX, starting with the help of a WYSIWYM editor like Lix. Now I'm staring writing tex files in Sci-TE, It already has syntax higlighting and I adapted the tex.properties file to work in Windows showing a preview on Go [F5]
One pretty thing Lyx does, and it's hard to acheive with a common text editor, is to format text in 80 columns: I can write a paragraph and hit Return each time I reach near the edge column but if, after the first draft, I want to add or cut some words here and there I end up breaking the layout and having to rearrange newlines.
It would be useful to have a tool in Sci-TE so I can select a paragraph of text I added or deleted some words in and have it rearranged in 80 columns. Probably not something working on the whole document since it could probably break some intended anticipated line break.
Probably I could easily write a Python plugin for geany, I saw vim has something similar, but I'd like to know if its' possible in Sci-TE too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当我在寻找相同的答案时没有找到答案,我感到有点失望。 Google 也没有帮助程序,所以我搜索了 Lua 示例和语法,希望自己制作它。我不了解 Lua,所以这也许可以以不同的方式或有效地进行,但它比我希望的没有更好 - 这是需要放入 SciTE 启动 Lua 脚本中的 Lua 函数:
用法与启动时的任何其他函数一样脚本,但为了完整性,我将从 SciTE 属性文件中粘贴我的工具定义:
它确实尊重段落,因此它可以用于更广泛的选择,而不仅仅是一个段落。
I was a bit disappointed when I found no answer as I was searching for same. No helpers by Google either, so I searched for Lua examples and syntax in a hope to craft it myself. I don't know Lua so this can perhaps be made differently or efficiently but its better then nothing I hope - here is Lua function which needs to be put in SciTE start-up Lua script:
Usage is like any other function from start-up script, but for completness I'll paste my tool definition from SciTE properties file:
It does respect paragraphs, so it can be used on broader selection, not just one paragraph.
这是在 scite 中执行此操作的一种方法:首先,将其添加到您的
.SciTEUser.properties
(选项/打开用户选项文件):...并保存,这样您就可以在 80 处看到一行人物。
然后缩放
scite
窗口,以便您看到的文本自动换行。最后,选择要分成行的长行文本,然后执行编辑/段落/拆分(对我来说,快捷键 Ctrl-K 也适用于此)。
不幸的是,scite
中似乎没有“break-lines-as-you-type”功能,如geany
中的“换行”功能。< /s> 不再是了,现在有一个插件 - 请参阅这个答案This is one way to do it in scite: first, add this to your
.SciTEUser.properties
(Options/Open User Options file):... and save, so you can see a line at 80 characters.
Then scale the
scite
window, so the text you see is wrapped at the line.Finally, select the long line text which is to be broken into lines, and do Edit / Paragraph / Split (for me the shortcut Ctrl-K also works for that).
Unfortunately, there seems to be no "break-lines-as-you-type" facility innot anymore, now there's a plugin - see this answerscite
, like the "Line Breaking" facility ingeany
.好吧,我相当失望 scite 中似乎没有“break-lines-as-you-type”设施< /代码>;我最终成功地为此编写了一个小型 Lua 插件/附加组件/扩展,并将其发布在这里:
安装和使用说明在脚本本身中。以下是正确安装扩展并在启动后激活切换后 SciTE 的外观:
请注意,它几乎是这样与 geany 中的功能相同 - 它在键入文本时插入换行符 - 但不在按退格键或复制/粘贴时插入换行符。
Well, I was rather disappointed that there seems to be no "break-lines-as-you-type" facility in
scite
; and I finally managed to code a small Lua plugin/add-on/extension for that, and released it here:Installation and usage instructions are in the script itself. Here is how SciTE may look when the extension properly installed, and toggle activated after startup:
Note that it's pretty much the same functionality as in
geany
- it inserts linebreaks upon typing text - but not on pressing backspace, nor upon copy/pasting.相同但更容易,我认为......
将其放入用户属性中:
Ciao
彼得罗
the same but more easy, I think...
put this in the user properties:
Ciao
Pietro