1

I have a tmux + vim setup in which I use split panes. Every time I press ctrl+w to move between the vim panes, my vim instance becomes completely unresponsive. At first I thought this was a tmux issue so I disabled all my tmux plugins and shortcuts.

After disabling, I still run into this issue.

Every time I press ctrl+w, the whole terminal window becomes unresponsive (in my case it's iTerm2 on mac). I can switch over to other apps like my browser and everything is a bit slowed down on my computer (a simple google search hangs). And then about a minute later, things are back to normal. I can continue using vim and other apps on my computer no problem until I accidentally or intentionally tap ctrl+w again.

I should note that I am using neovim instead of vim.

4
  • 1
    What is your tmux prefix? Does this happen outside of tmux? With vim --clean? Is your $TERM configured correctly inside tmux? Outside? It sounds like something is hogging your cpu when vim freezes, but I’m guessing.
    – D. Ben Knoble
    Jul 19, 2021 at 21:10
  • Yikes. Are you sure that the only way to recreate this is through Vim? If you could reproduce it elsewhere you could probably then move this question to an SE site with more traffic, increasing your chances of finding a solution.
    – B Layer
    Jul 20, 2021 at 6:13
  • @D.BenKnoble I'm using ctrl-j as my prefix. I looked at the activity log and it doesn't seem to spike my CPU, iTerm2 just becomes unresponsive which baffles me even more. Jul 26, 2021 at 19:00
  • @BLayer I've tried it with anything else, nano/emacs, just using the command line for other things and it seemed to not cause any issues. Jul 26, 2021 at 19:01

1 Answer 1

0

I've found a workaround this.

Things I tried:

  • Disabled all plugins for vim, this seemed to help for a bit but after a few presses of ctrl+w it went back to freezing up my iTerm2
  • Used vim outside of tmux, issue still occurred.
  • Disabled the ctrl+w keymap in iTerm2, this was unfeasible as I need to move between panes in vim.

My current workaround is to disable ctrl+h which would freeze up my iTerm as well and being human, I would often press ctrl+w ctrl+h instead of ctrl+w, then h and this has helped a lot. Disabling some unused plugins helped but only for the first few instances of ctrl+w. At this point, I'm going to avoid using panes in vim.

2
  • 1
    As far as workarounds go, most ctrl-w Normal mode commands have a command-line mode alias. See :h :wincmd. If the problem is actually caused by ctrl-w itself you could at least create mappings for the commands you need (e.g. let's say you're okay with using ctrl-x instead of ctrl-w ... :nnoremap <c-x>w :wincmd w<cr>) thus maintaining access to the same functionality without too much inconvenience.
    – B Layer
    Jul 26, 2021 at 20:16
  • 1
    BTW, the above assumes that "pressing" ctrl-w through a mapping like :nnoremap <c-x>w <c-w>w still causes problems...but does it? Because if not then that makes for even simpler mappings. (And if it does still cause problems that's an interesting data point.)
    – B Layer
    Jul 26, 2021 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.