简体   繁体   English

在 Vim 和 Emacs 中编辑非 ASCII 文本

[英]Editing non-ASCII text in Vim vs Emacs

I have spent several hours reading and searching for the difference between vim and emacs as I am considering learning one of these in order to edit multiple text files written in Thai.我花了几个小时阅读和搜索 vim 和 emacs 之间的区别,因为我正在考虑学习其中之一,以便编辑用泰语编写的多个文本文件。 My question is:我的问题是:

Given that navigation and editing are done via key stroke combinations, are either of these editors practical for editing of non-Latin files, and if so, which has the upper hand for this specific task, and why?鉴于导航和编辑是通过按键组合完成的,这些编辑器中的任何一个是否适用于编辑非拉丁文文件,如果是,哪个在此特定任务中占上风,为什么?

I would also like to batch apply search/replace regex over multiple files.我还想在多个文件上批量应用搜索/替换正则表达式。

Edit: The files are all UTF-8.编辑:这些文件都是 UTF-8。 Some are LaTeX files, others are text files and html files.有些是 LaTeX 文件,有些是文本文件和 html 文件。 The primary editing will be of the Thai text itself.主要编辑将是泰文本身。 I also have a few Lao files that I will be editing as well and I see a future use for editing Greek and Khmer.我也有一些老挝语文件,我也将对其进行编辑,我认为将来可以用于编辑希腊语和高棉语。

Emacs has extensive multilingual text editing supports, including a large library of input methods (eg, thai-kesmanee, thai-pattachote), and tools for working with various character sets and encodings (utf-8, tis620, etc.). Emacs 具有广泛的多语言文本编辑支持,包括大型输入法库(例如,thai-kesmanee、thai-pattachote)以及用于处理各种字符集和编码(utf-8、tis620 等)的工具。

Once you start Emacs, you can type Ch h to check if you have the necessary fonts installed for the desired script, and C-\\ to toggle specialized input method.启动 Emacs 后,您可以输入Ch h来检查是否为所需的脚本安装了必要的字体,并输入C-\\来切换专用输入法。

"Can't you just try them?" “你就不能试试吗?” @romainl said. @romainl 说。

2 1/2 months later the answer for vim is a resounding YES. 2 1/2 个月后,vim 的答案是响亮的“是”。

Extensive mapping in the vimrc file and I can navigate and edit Thai texts while in the Thai keyboard faster than I could edit in a word processor in my previous life. vimrc 文件中的广泛映射,我可以在泰语键盘中导航和编辑泰语文本,这比我以前在文字处理器中编辑的速度要快。

The only issues with vim so far are text wrapping and single word navigation/edits.到目前为止,vim 的唯一问题是文本换行和单字导航/编辑。 Apparently both of these could be fixed by someone kindly patching vim with ICU bindings.显然,这两个都可以通过有人用 ICU 绑定修补 vim 来修复。

I can not speak as to which has the upper hand, but only say that vim works well for this.我不能说哪个占上风,但只能说 vim 对此很有效。 Apparently emacs does too.显然 emacs 也是如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM