This allows us to use ctrl- to move anywhere in our tmux window, whether we’re jumping between vim splits or tmux panes. With tmux in the picture, we can use vim-tmux-navigator to not only set up these vim key bindings, but also to set up similar key bindings for tmux pane navigation. vimrc to simplify split navigation, so that I can jump between vim splits using ctrl-j, ctrl-k, etc. To address this, like many vim users, I edited my. h, j, k, l).This isn’t as efficient as it could be, especially for such a common operation. By default, if you want to move from one split to another, vim requires that you hit ctrl-W and then one of the directional keys (i.e. I’m constantly using vim splits, so being able to move between splits efficiently is crucial. Similarly, tmux’s panes allow us to divide up our window so we can run and view several terminal based commands and programs at the same time. In vim, we use splits to divide up the current view, allowing us to edit several files side by side, or even to edit multiple regions of a single file without having to scroll around. Moving around vim and tmux Seamless navigationĪs a general goal, I want to be able to use vim-style movements and text editing patterns whether I’m in vim or some other tmux pane. If you’re just getting started with tmux and vim, see the related reading section for links to some resources to get you up to speed.
This post is a collection of those essential tips that have become indispensable parts of my development workflow. Over the last few years of using tmux and vim together, I’ve found a few tips and plugins that have really stood out. Configuring tmux and vim to get the exact behavior you want is often a time consuming endeavor, but in my view it’s worth it. In this post we’ll look at a few ways of customizing tmux and vim to help get more done with less typing and context switching. One of my favorite aspects of tmux is that it unlocks the potential for a more powerful vim-based development environment, allowing vim and the shell to feel more like a single cohesive tool. But if you’re a vim user, the benefits of tmux reach even further. The benefits I discussed there are independent of one’s choice of text editor.
Recently, I wrote about a few benefits of using tmux.