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

vim中如何取消输入#字符时自动跳到行首?

  •  
  •   sdjl · 2013-02-09 15:14:17 +08:00 · 3465 次点击
    这是一个创建于 4087 天前的主题,其中的信息可能已经有所发展或是发生改变。
    写python经常用#注释, 每次都会自动跳到行首去, 很不方便, 怎么去掉?
    3 条回复    1970-01-01 08:00:00 +08:00
    reorx
        1
    reorx  
       2013-02-09 17:27:50 +08:00   ❤️ 1
    Use `set cindent` instead of `set smartindent`

    ref: http://vim.wikia.com/wiki/Restoring_indent_after_typing_hash
    Sherlockhlt
        2
    Sherlockhlt  
       2013-02-09 23:56:34 +08:00
    我是跳到上一个当前字符串呀
    sdjl
        3
    sdjl  
    OP
       2013-02-10 14:07:47 +08:00
    :inoremap # X<BS>#
    @reorx 搞定 3q
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2946 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 03:21 · PVG 11:21 · LAX 20:21 · JFK 23:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.