V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
wentian
V2EX  ›  Vim

Vim 用 Tab 还是 Buffer? 用 Buffer 的话有什么好的使用思路?用 Tab 有什么好的思路?

  •  
  •   wentian · 2016-02-23 19:24:26 +08:00 · 4030 次点击
    这是一个创建于 2990 天前的主题,其中的信息可能已经有所发展或是发生改变。
    希望自己的 Vim 能够像 Sublime 那样简洁明了的 Tabs 栏(特别是多文件编辑时),但是最近几天折腾很久了,仍然没有一个理想结果.

    恳请 V 友指教.
    8 条回复    2016-05-28 10:08:10 +08:00
    uniudy
        1
    uniudy  
       2016-02-23 20:54:08 +08:00 via iPad
    jsfaint
        2
    jsfaint  
       2016-02-24 07:34:18 +08:00 via Android   ❤️ 1
    装了 airline 就有很漂亮的 tab 栏了(当然不装也有,丑一点), gt 可以切换到下一个 tab 。也可以用命令:tabnext, :tabprew, :tabclose 等。当然鼠标爱好者可以直接点击
    buffer 也不麻烦,很多人喜欢依赖插件,实际上我觉得自带的 buffer 管理就很方便
    :ls 列出所有已打开的 buffer
    :b 数字 切换到对应 buffer
    :bd 数字 删除对应 buffer
    记住这三个基本够用了
    jerray
        3
    jerray  
       2016-02-24 10:47:14 +08:00
    ming2281
        4
    ming2281  
       2016-03-14 11:44:08 +08:00
    @jsfaint buffer 命令是否需要做快捷键的映射?(我感觉还是需要做一下的)
    如果是,怎么映射比较科学(您是如何映射的?)
    ming2281
        5
    ming2281  
       2016-03-14 11:44:59 +08:00
    @jerray awesome
    ming2281
        6
    ming2281  
       2016-03-14 11:53:34 +08:00
    @jerray 就是喜欢这种透彻的文章!
    wsdjeg
        7
    wsdjeg  
       2016-05-28 10:07:16 +08:00
    @ming2281
    不知道你是否喜欢这样的快捷键, 这对于多文件 编辑非常有用.
    https://img.vim-cn.com/24/c52868a96a0584460aff16b63ef0cd4d335683.png

    https://github.com/wsdjeg/DotFiles
    wsdjeg
        8
    wsdjeg  
       2016-05-28 10:08:10 +08:00
    Window Management
    Key Mode Action
    q Normal Smart buffer close
    s+p Normal Split nicely
    s+v Normal :split
    s+g Normal :vsplit
    s+t Normal Open new tab (:tabnew)
    s+o Normal Close other windows (:only)
    s+x Normal Remove buffer, leave blank window
    s+q Normal Closes current buffer (:close)
    s+Q Normal Removes current buffer (:bdelete)
    Tab Normal Next window or tab
    Shift+Tab Normal Previous window or tab
    <leader>+sv Normal Split with previous buffer
    <leader>+sg Normal Vertical split with previous buffer
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1524 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 16:30 · PVG 00:30 · LAX 09:30 · JFK 12:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.