V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
lbj96347
V2EX  ›  问与答

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

  •  
  •   lbj96347 · Oct 21, 2011 · 6907 views
    This topic created in 5313 days ago, the information mentioned may be changed or developed.
    我已经设置了set backspace=indent,eol,start?但是仍然不奏效,求高手配置,感谢!
    5 replies    1970-01-01 08:00:00 +08:00
    WarWithinMe
        1
    WarWithinMe  
       Oct 21, 2011
    你用的是Windows的gVim还是Mac的MacVim?
    WarWithinMe
        2
    WarWithinMe  
       Oct 21, 2011
    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
       Oct 21, 2011
    @WarWithinMe 我是在ubuntu下使用vim的,之前还是好好的,但是升级ubuntu11.10后就变成这样了,我看了配置文件,感觉好像又没有问题。
    lbj96347
        4
    lbj96347  
    OP
       Oct 21, 2011
    @WarWithinMe 感谢你,我设置了set backspace=2后修复了这个问题。不过真的不知道是什么原理。虽然不是macvim。
    WarWithinMe
        5
    WarWithinMe  
       Oct 21, 2011
    其实我一般是搜vim wiki的。。。vim自带的帮助感觉太折腾了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5891 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 06:14 · PVG 14:14 · LAX 23:14 · JFK 02:14
    ♥ Do have faith in what you're doing.