Skip to content

Set an independent timeout for CursorHold and CursorHoldI without changing updatetime

License

Notifications You must be signed in to change notification settings

tanchihpin0517/cursorhold-timeout.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cursorhold-timeout.nvim

Inspired by FixCursorHold.nvim which is used to solve the performance bug in the earlier version of Neovim, this plugin provides an independent timeout option for CursorHold and CursorHoldI

Features

The triggered time of auto-commands CursorHold and CursorHoldI is set by updatetime in vim's options.

Some plugins like symbols-outline.nvim insert their callback function into CursorHold for frequent state updates. However, it may cause performance issues if we tune updatetime to a small value because this option is also used for other purposes, such as the waiting time of saving swap file. Check :h updatetime for more information.

This plugin provides a way to set an independent timeout for CursorHold and CursorHoldI without changing updatetime. Unlike FixCursorHold.nvim, this plugin is completely written in Lua.

Installation

Using packer.nvim

use 'tanchihpin0517/cursorhold-timeout.nvim'

Setup

Put the setup call in your init.lua or any lua file that is sourced.

require("cursorhold-timeout").setup {
    timeout = 1000, -- (milliseconds)
}

About

Set an independent timeout for CursorHold and CursorHoldI without changing updatetime

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages