Giter VIP home page Giter VIP logo

emacs-opencc's Introduction

opencc.el MELPA

介绍

opencc.el 利用 OpenCC 的命令行工具实现在 Emacs 内进行中文简繁转换。

需求

  • Emacs 版本至少 24.4
  • OpenCC

使用

(opencc-string CONFIG STRING)

按配置文件 CONFIG 转换字符串 STRING。比如把简体转换成繁体:

(opencc-string "s2t" "简繁转换")
     => "簡繁轉換"

(opencc-region CONFIG START END)

按配置文件 CONFIG 转换 START 和 END 之间的文字。

M-x opencc-message

从 minibuffer 读取配置和字符串,然后用 message 显示结果。使用举例:

M-x opencc-message s2t RET 简繁转换 RET

会显示“簡繁轉換”。

M-x opencc-replace-at-point

从 Minibuffer 读取配置,转换并替换选中区域内的中文。如果没有可用的选中区域,用光标下的一句话。

M-x opencc-print-buffer

转化当前 Buffer 的内容,在另一个 Buffer 中显示转换的结果。

M-x opencc-insert-mode

输入的简体自动转换层繁体。可通过选项 opencc-insert-mode-config 调整转换的方向。

M-x opencc-isearch-mode

输入简体搜索对应的繁体。可通过 opencc-isearch-mode-config 调整转换的方向。

备注

配置 说明 说明
s2t 简体到繁体 Simplified Chinese to Traditional Chinese
t2s 繁体到简体 Traditional Chinese to Simplified Chinese
s2tw 简体到**正体 Simplified Chinese to Traditional Chinese
tw2s **正体到简体 Traditional Chinese to Simplified Chinese
s2hk 简体到香港繁体(香港小学学习字词表标准) Simplified Chinese to Traditional Chinese
hk2s 香港繁体(香港小学学习字词表标准)到简体 Traditional Chinese to Simplified Chinese
s2twp 简体到繁体(**正体标准)并转换为**常用词汇 Simplified Chinese to Traditional Chinese with Taiwanese idiom
tw2sp 繁体(**正体标准)到简体并转换为**大陆常用词汇 Traditional Chinese to Simplified Chinese with Mainland Chinese idiom

emacs-opencc's People

Contributors

purcell avatar xuchunyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

emacs-opencc's Issues

opencc-replace-at-point 丢失内容

选中区域,执行 opencc-replace-at-point ,t2s 只转换一部分,其他内容丢失。

(accept-process-output proc)

我在这下面添加 (sleep-for 0.1) 就可以用了。

GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.13, cairo version 1.17.3)

关于首行中文

;;; opencc.el --- 中文简繁转换 <-> 中文簡繁轉換  -*- lexical-binding: t; -*-

你确定在 package buffer 中可以正确显示中文吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.