Skip to content

machakann/vim-highlightedyank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
endif

Optimizing 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 = 1000

A negative number makes the highlight persistent.

let g:highlightedyank_highlight_duration = -1

When 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:

hi HighlightedyankRegion cterm=reverse gui=reverse

Inspired by

Demo

vim-highlightedyank

About

Make the yanked region apparent!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages