使用 Vim 编辑 SciTE

lua-users home
wiki

SciTE 有一些弱点,其中之一就是块编辑功能。如果我需要这个功能,我就会使用 Vim。Vim 有许多强大的编辑功能,所以我将 Vim 作为 SciTE 的第二个编辑器,并使用这个简单的 Lua 脚本 SciteEditWithVim

-- Edit with Vim as an external editor of SciTE
-- 2013.03.31 by lee.sheen at gmail dot com

scite_Command {
  'Edit with Vim|EditWithVim|Alt+Shift+V',
}

function CurrentLine ()
  return editor:LineFromPosition(editor.CurrentPos) + 1
end

function EditWithVim ()
  local gvim_exe = 'C:/"Program Files"/Vim/vim73/gvim.exe'
  local cur_file_path = props['FilePath']
  local current_line = CurrentLine()
  os.execute("start " .. gvim_exe .. " " .. cur_file_path .. " +" .. current_line)
end

想法和建议:是否有可能捕获 os.execute 的状态 - 当 Vim 中的编辑工作完成后,SciTE 能否在 Vim 关闭后自动重新打开文件?


RecentChanges · preferences
编辑 · 历史
最后编辑于 2013 年 9 月 5 日 上午 11:23 GMT (差异)