maxxxxx
V2EX  ›  Vim

一个简单的快速打开关闭 terminal 的 vim8.1 插件。

  •  1
     
  •   maxxxxx · Jun 19, 2018 · 6713 views
    This topic created in 2899 days ago, the information mentioned may be changed or developed.
    Vimscript 写的不多,实现也很简单,不过也是满足日常使用了。主要是希望大家能多提一下想要的 feature。送上 github 地址:
    https://github.com/PangPangPangPangPang/vim-terminal
    Supplement 1  ·  Jun 21, 2018

    上班摸鱼搞定了多tab的支持。欢迎star!

    Toggle

    toggle

    Add tab

    add

    Switch tab

    change

    9 replies    2018-06-21 16:40:23 +08:00
    mikac
        1
    mikac  
       Jun 19, 2018
    看起来听不错
    maxxxxx
        2
    maxxxxx  
    OP
       Jun 19, 2018 via Android
    @mikac vim 里面管理 terminal 没有其他编辑器好用,好在可定制性在那儿了,搞完确实方便多了,这个星期再把管理多个 terminal 的能力加上!
    KentY
        3
    KentY  
       Jun 19, 2018   ❤️ 1
    c-z & fg
    maxxxxx
        4
    maxxxxx  
    OP
       Jun 19, 2018 via Android
    @KentY 经常会用到 gui 的,特别是 mac 终端,稍微跑几个插件就性能特别差…
    mikac
        5
    mikac  
       Jun 19, 2018
    @maxxxxx 其实也想说 ctrl-z & fg 很方便很实用的,当然你写的这个插件也适用一些人(喜欢平铺窗口),多种选择总是好的 :)
    glues
        6
    glues  
       Jun 20, 2018 via iPhone
    不错
    kran
        7
    kran  
       Jun 20, 2018
    建议针对 tab 打开终端。之前自己改的一个:

    function! Term_toggle(height)
    if exists("t:term_win") && win_gotoid(t:term_win)
    let t:term_hight = winheight("")
    hide
    if exists("t:term_org_win")
    call win_gotoid(t:term_org_win)
    endif
    else
    let t:term_org_win = win_getid()
    botright new

    if exists("t:term_hight")
    exec "resize " . t:term_hight
    else
    exec "resize " . a:height
    endif


    try
    exec "buffer " . t:term_buf
    catch
    call termopen($SHELL, {"detach": 0})
    let t:term_buf = bufnr("")
    endtry
    startinsert!
    let t:term_win = win_getid()
    endif
    endfunction
    maxxxxx
        8
    maxxxxx  
    OP
       Jun 20, 2018 via Android
    @kran 针对 tab 的在计划之中~谢谢建议
    maxxxxx
        9
    maxxxxx  
    OP
       Jun 21, 2018
    捞一下,支持了新的多 tab 功能。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5367 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 62ms · UTC 09:05 · PVG 17:05 · LAX 02:05 · JFK 05:05
    ♥ Do have faith in what you're doing.