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

vim 系统寄存器"+y 映射 快捷键

  •  
  •   chrysan · 2015-12-11 14:39:57 +08:00 · 3068 次点击
    这是一个创建于 3053 天前的主题,其中的信息可能已经有所发展或是发生改变。

    每次要调用系统寄存器的时候 都要双手在键盘上大幅度移动,左手按住 shift 右手 按 3 次 “ + Y ,觉得很影响效率。在想能不能直接 map leader 键一类的映射减少输入。自己尝试过 leader 键发现并不起作用。

    3 条回复
    weaming
        1
    weaming  
       2015-12-11 15:06:56 +08:00
    可以参考我的 https://github.com/weaming/vimrc

    " 设置快捷键将选中文本块复制至系统剪贴板
    vnoremap <Leader>y "+y
    " 设置快捷键将系统剪贴板内容粘贴至 vim
    nmap <Leader>p "+p
    vmap <Leader>p "+p
    imap <Leader>p <esc>"+p
    halfcrazy
        2
    halfcrazy  
       2015-12-11 15:07:09 +08:00
    ```viml
    if has('clipboard')
    if has('unnamedplus') " When possible use + register for copy-paste
    set clipboard=unnamed,unnamedplus
    else " On mac and Windows, use * register for copy-paste
    set clipboard=unnamed
    endif
    endif
    ```
    halfcrazy
        3
    halfcrazy  
       2015-12-11 15:09:58 +08:00
    @Livid viml 怎么没高亮
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2657 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 15:33 · PVG 23:33 · LAX 08:33 · JFK 11:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.