Ⅰ. 插件描述
Make the yanked region apparent!Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'machakann/vim-highlightedyank'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'machakann/vim-highlightedyank'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'machakann/vim-highlightedyank'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/machakann/vim-highlightedyank
Ⅳ. 文档说明
# vim-highlightedyank
Make the yanked region apparent!
Usage
If you are using Neovim or Vim 8.0.1394 (or later version),
there is no need for configuration, as the highlight event is automatically triggered by the TextYankPost event.
If you are using older Vim,
define a keymapping to <Plug>(highlightedyank). Checking the existence of TextYankPost event would be good.
if !exists('##TextYankPost')
map y <Plug>(highlightedyank)
endifOptimizing highlight duration
If you want to optimize highlight duration, use g:highlightedyank_highlight_duration or b:highlightedyank_highlight_duration. Assign a number of time in milliseconds.
let g:highlightedyank_highlight_duration = 1000A negative number makes the highlight persistent.
let g:highlightedyank_highlight_duration = -1When a new text is yanked or user starts editing, the old highlighting would be deleted.
Highlight coloring
If the highlight is not visible for some reason, you can redefine the HighlightedyankRegion highlight group like:
highlight HighlightedyankRegion cterm=reverse gui=reverseNote that the line should be located after :colorscheme command execution in your vimrc.
Inspired by
Demo
