V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
lbj96347
V2EX  ›  问与答

vim插入模式中不能使用backspace键?

  •  
  •   lbj96347 · 2011-10-21 22:10:11 +08:00 · 6268 次点击
    这是一个创建于 4582 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我已经设置了set backspace=indent,eol,start?但是仍然不奏效,求高手配置,感谢!
    5 条回复    1970-01-01 08:00:00 +08:00
    WarWithinMe
        1
    WarWithinMe  
       2011-10-21 22:12:03 +08:00
    你用的是Windows的gVim还是Mac的MacVim?
    WarWithinMe
        2
    WarWithinMe  
       2011-10-21 22:15:54 +08:00
    MacVim本身好像就不用怎么设置。但是gVim要用函数:
    func Backspace()
    if col('.') == 1
    if line('.') != 1
    return "\<ESC>kA\<Del>"
    else
    return ""
    endif
    else
    return "\<Left>\<Del>"
    endif
    endfunc
    if MySys() == "windows"
    inoremap <BS> <c-r>=Backspace()<CR>
    endif

    MacVim只需要设置
    set backspace=2
    lbj96347
        3
    lbj96347  
    OP
       2011-10-21 22:24:33 +08:00
    @WarWithinMe 我是在ubuntu下使用vim的,之前还是好好的,但是升级ubuntu11.10后就变成这样了,我看了配置文件,感觉好像又没有问题。
    lbj96347
        4
    lbj96347  
    OP
       2011-10-21 22:33:14 +08:00
    @WarWithinMe 感谢你,我设置了set backspace=2后修复了这个问题。不过真的不知道是什么原理。虽然不是macvim。
    WarWithinMe
        5
    WarWithinMe  
       2011-10-21 22:48:32 +08:00
    其实我一般是搜vim wiki的。。。vim自带的帮助感觉太折腾了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1250 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 18:11 · PVG 02:11 · LAX 11:11 · JFK 14:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.