使用 Vim 編輯 Scite |
|
-- 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 關閉後)?