Git Product home page Git Product logo

fixcursorhold.nvim's Introduction

❗ This plugin is not needed after neovim/neovim#20198

Fix CursorHold Performance

Rationale

This plugin exists for two reasons:

  1. fix neovim CursorHold and CursorHoldI autocmd events performance bug
  2. decouple updatetime from CursorHold and CursorHoldI (works for Vim and Neovim)

1., fixes slowdowns and untriggered events

2., you can now use small delays for CursorHold without writing the swap file 10x/sec (see :help updatetime)

This will result in more snappiness for plugins using those events, such as: coc.nvim, vim-gitgutter, tagbar, vim-devicons, vim-polyglot, etc.

Installation

Make sure to have the following plugins in your vimrc:

Plug 'antoinemadec/FixCursorHold.nvim'

Configuration

" in millisecond, used for both CursorHold and CursorHoldI,
" use updatetime instead if not defined
let g:cursorhold_updatetime = 100

License

MIT

fixcursorhold.nvim's People

Contributors

a5ob7r avatar antoinemadec avatar kevinhwang91 avatar okuramasafumi avatar yous avatar zeertzjq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fixcursorhold.nvim's Issues

Respect! Your plugin works!

Thank you! If you read this and realize someone is happy because of your generous hard work, then we can close it now. It works. It just works.

Issue when using with fzf.vim and vim-ultest

Summary

When using with fzf.vim and vim-ultest, with updatetime=300, fzf commands trigger an error Error: vim-ultest encountered an unknown error on startup, check v:exception due to some issue with the CursorHold event at https://github.com/rcarriga/vim-ultest/blob/0f4c264129f11950bd471043ce3ab70f3c0545dc/plugin/ultest.vim#L399-L402.

Steps to reproduce

  1. Using the following minimal vimrc, open some file
    set runtimepath^=~/.vim runtimepath+=~/.vim/after
    let &packpath = &runtimepath
    
    call plug#begin()
    Plug 'antoinemadec/FixCursorHold.nvim'
    Plug 'junegunn/fzf'
    Plug 'junegunn/fzf.vim'
    Plug 'vim-test/vim-test'
    Plug 'rcarriga/vim-ultest', { 'do': ':UpdateRemotePlugins' }
    call plug#end()
    
    set nocompatible
    set updatetime=300
    set cmdheight=2
  2. :BLines

NeoVim version

NVIM v0.6.0
Build type: Release
LuaJIT 2.0.5
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Still required for decoupling from `updatetime`

Hey there, thanks for this plugin! I've been using it for a long time to primarily decouple the updatetime setting from CursorHold events. I like to have the CursorHold trigger very often and have it set to 50ms. The README states that this plugin is no longer necessary but it seems from the linked issue that the decoupling is still only provided by this, is that correct?

If so, would you consider rewording the README message to clarify what this still provides vs what is now fixed in core?

Missing LICENSE file

This project is missing a license file despite having MIT listed in the README. You can get a template from here if you need one.

No matching autocommands: gitgutter CursorHold

When using this plugin in vim (8.2) with airblade/vim-gitgutter I see a message on startup:
No matching autocommands: gitgutter CursorHold

Maybe the plugin needs a conditional for the neovim specific logic? Apologies for my ignorance :)

Many thanks and Farewell

I just saw the updated README.md that the targeted problem (seems to?) has been resolved(eliminated!) on the master branch. Thanks for your help when the (NeoVim) world is under attack(that bug)! Let me keep my star here, for memory :)

Visual selection gets cancelled when using with NERDTree and vim-devicons

Description

When using with NERDTree and vim-devicons, after opening NERDTree, visual selection in main buffer gets cancelled after ~1s.

Steps to reproduce

set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath

" vim-plug
call plug#begin()

Plug 'antoinemadec/FixCursorHold.nvim'
Plug 'preservim/nerdtree'
Plug 'ryanoasis/vim-devicons'

call plug#end()
  1. nvim -u /path/to/minimal.vim some_file
  2. :NERDTree
  3. Now in the main buffer, V and select a few lines
  4. Wait for 1-2 seconds, the visual selection gets cancelled

NeoVim:

NVIM v0.4.4
Build type: Release
LuaJIT 2.0.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.