Home  >  Q&A  >  body text

shell - How to quickly switch command mode in terminal development mode?

For example, if you are developing with vim, you suddenly want to execute some shell commands, such as viewing processes, starting services, etc. Is there any way to do this in the current window without opening a new window?

过去多啦不再A梦过去多啦不再A梦2712 days ago688

reply all(5)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-05-16 16:44:36

    That’s it
    :!ls

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-16 16:44:36

    In fact, you can also use Ctrl+Z. fg recovery.

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 16:44:36

    There is a vim plug-in called conque that allows you to use the console in the buffer

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 16:44:36

    Vim configuration

    "快速执行脚本,可以添加更多脚本类型
    function! RunScript()
        if &ft == "sh"
            :w|!bash %
        elseif &ft == "python"
    	:w|!python %
        elseif &ft == "php"
    	:w|!php %
        else 
    	echo "Unsupport script type: " .&ft. ",please add below line to RunScript()"
    	echo "\telseif &ft == ".&ft
    	echo "\t:w|run_command % \"Please replace run_command as your own need"
        endif
    endfunction
    "普通模式下执行F2键快速执行脚本
    nmap <F2> :call RunScript()<CR>`

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-16 16:44:36

    I think the most convenient way is to use GNU screen

    reply
    0
  • Cancelreply