vimterminalconque

Disable VIm autocommands for specific buffer


As a windows user I use conque term as my vim terminal. Is there a way to disable the CursorHoldI and CursorMovedI autocmds when the buffer is a conque term. My vim script skills are basic , I 'm sure there is a line I can add to my vimrc.Thanks


Solution

  • I don't fully understand why you would need to do that, but the way to disable certain autocmds from firing is via the 'eventignore' option. (Alternatively, you could delete the corresponding autocmds, but that would only work for buffer-scoped ones, not global ones, as you presumably want to keep the autocmds running in non-Conque buffers.)

    The thing is, 'eventignore' is a global setting, so you need another pair of autocmds to turn on / off the option, based on entering / leaving the Conque buffer.

    Inside each Conque buffer, run this:

    :autocmd WinEnter <buffer> set eventignore+=CursorHoldI,CursorMovedI
    :autocmd WinLeave <buffer> set eventignore-=CursorHoldI,CursorMovedI