chrysan
V2EX  ›  Vim

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

  •  
  •   chrysan · Dec 11, 2015 · 3924 views
    This topic created in 3834 days ago, the information mentioned may be changed or developed.

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

    3 replies
    weaming
        1
    weaming  
       Dec 11, 2015
    可以参考我的 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  
       Dec 11, 2015
    ```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  
       Dec 11, 2015
    @Livid viml 怎么没高亮
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5680 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 03:23 · PVG 11:23 · LAX 20:23 · JFK 23:23
    ♥ Do have faith in what you're doing.