百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

textbringer

> 开发工具
开源

一款类似 Emacs 的文本编辑器,使用 Ruby 编写

389 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一款类似 Emacs 的文本编辑器,使用 Ruby 编写

  • Japanese version

Textbringer is an Emacs-like text editor written in Ruby. It is extensible by Ruby instead of Lisp.

Screenshot

Demo

  • FizzBuzz: https://asciinema.org/a/103357
  • Ruby Programming: https://asciinema.org/a/100156
  • Japanese Text Editing: https://asciinema.org/a/100166

Installation

$ gem install textbringer

You need ncursesw to use multibyte characters. Install ncursesw before installing curses.gem, on which textbringer depends.

$ sudo apt-get install libncursesw5-dev
$ gem install curses

You need ffi to use clipboard commands on Windows.

$ gem install ffi

Usage

$ txtb

You can quit the editor by Ctrl-x Ctrl-c.

Many commands and key bindings are similar to Emacs.

Type F1 b or Alt+x describe_bindings RET to see key bindings.

Configuration

Meta key

You need the following configuration of terminal emulators to use meta key.

xterm

Add the following line to ~/.Xresources.

XTerm*metaSendsEscape: true

mlterm

Add the following lines to ~/.mlterm/main.

mod_meta_key = alt
mod_meta_mode = esc

True color (24-bit color)

If your terminal emulator supports true color, set TERM to xterm-direct to enable 24-bit color.

$ TERM=xterm-direct txtb

This allows themes to display their exact hex colors instead of approximating to the 256-color palette.

East asian ambiguous width

Add the following line to ~/.textbringer.rb to treat ambiguous characters as fullwidth.

CONFIG[:east_asian_ambiguous_width] = 2

You also need a LD_PRELOAD hack or a modified locale charmap because ncursesw uses wcwidth(3).

  • https://github.com/fumiyas/wcwidth-cjk
  • https://github.com/hamano/locale-eaw

xterm, mlterm and screen have their own configuration options.

xterm

Add the following lines to ~/.Xresources.

xterm*utf8: 1
xterm*locale: true
xterm*cjkWidth: true

mlterm

Add the following line to ~/.mlterm/main.

col_size_of_width_a = 2

screen

Add the following line to ~/.screenrc.

cjkwidth on

Plugins

  • Mournmail: a mail user agent
  • MedicineShield: a Mastodon client
  • textbringer-presentation: a presentation tool
  • textbringer-ghost_text: a GhostText plugin

Themes

Type Alt+x load_theme RET to load a theme from textbringer/themes or ~/.textbringer/themes.

Themes can also be loaded in ~/.textbringer.rb.

ruby
load_theme "catppuccin"

If a theme sets its own background color but you prefer to use the terminal's default background, add the following after load_theme:

ruby
set_background_color "default"

Development

After checking out the repo, run bundle install to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To run the tests, run bundle exec rake test. To install this gem onto your local machine, run bundle exec rake install.

To release a new version, run bundle exec rake bump on a clean main branch. It increments the version number in version.rb, commits and pushes the change, and pushes a v tag. The tag triggers the push_gem.yml workflow, which publishes the gem to rubygems.org via trusted publishing and creates a GitHub release. Do not run bundle exec rake release; it would try to push the gem from your machine as well.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/shugo/textbringer.

License

The gem is available as open source under the terms of the MIT License.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubyelric-sagarubytext-editortextbringer

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具