在Sublime Text 2中显示状态栏中当前字符的信息

act*_*mel 3 character sublimetext2

我缺少一个其他文本编辑经常提供的有用功能.在底部状态栏中,它们显示当前字符的ASCII和UTF代码 - 当前位置之前或之后的字符(现在不确定).我无法找到执行此操作的程序包或执行此操作的本机功能.

谢谢您的帮助.

Ser*_*sky 11

我为此制作了一个插件:)

anyname.pyPackages/User/目录中创建一个文件.

import sublime, sublime_plugin, textwrap, unicodedata

class utfcodeCommand(sublime_plugin.EventListener):
    def on_selection_modified(self, view):
        # some test chars = $ €
        sublime.status_message('Copying with pretty format')
        selected = view.substr(view.sel()[0].a)
        char = str(selected)
        view.set_status('Charcode', "ASCII: " + str(ord(selected)) + " UTF: " + str(char.encode("unicode_escape"))[2:-1])
Run Code Online (Sandbox Code Playgroud)

这应该在插入符右侧的字符的状态栏中显示ASCII和Unicode代码.

告诉我这是否适合您,在Kubuntu Linux 12.04 x64上使用ST3进行测试.由于Python版本不同,可能无法在ST2上运行.