http://hit9.hit9.net/post-67.html
2012-2-7 21:07 Tuesday
习惯了ubuntu下面Scribes的配对符号(诸如(,{,单引号,双引号)自动补全功能,所以总想在SciTE上面也实现这个功能.
在配置文件中添加:
- ext.lua.startup.script=$(SciteDefaultHome)\startup.lua
SciTE目录下新建文件startup.lua:
- local toClose = { ['('] = ')', ['{'] = '}', ['['] = ']', ['"'] = '"', ["'"] = "'" }
- function OnChar(charAdded)
- if toClose[charAdded] ~= nil then
- editor:InsertText(editor.CurrentPos,toClose[charAdded])
- end
- end
不过这个只是实现了配对符号的(括号,大括号,单引号....)的自动配对补齐,并把光标放在符号中间,我还期盼一个功能:光标在配对符号中间的时候按回车,右边的符号自动换行.