spawn $env(VIM) -N --noplugin -u ../vimrc set timeout 3 expect { timeout {exit 1} "VIM - Vi IMproved" } send ":LustyFilesystemExplorer\r" expect { "Press ENTER" {exit 1} "Error" {exit 1} "Warning" {exit 1} timeout {exit 1} ">>" } # Ctrl-N (for next file -- select dir) send \016 # ENTER -- recurse into dir send \015 expect { "Press ENTER" {exit 1} "Error" {exit 1} "Warning" {exit 1} timeout {exit 1} "file-in-dir" } # Enter -- should select send \015 expect { "Press ENTER" {exit 1} "Error" {exit 1} "Warning" {exit 1} timeout {exit 1} "opened!" } # ESC send \033 send ":q\r" expect { timeout {exit 1} eof } exit 0