When I run vim in tmux, it only takes up half the screen (usually the left half). I would like vim to use up the whole screen, but don't know how. Tmux still seems to consider the entire screen as one pane though - when I press Ctrl+b q, the pane number ('0') appears in the middle of the screen. Any ideas on what the issue is (I'm not sure if it's tmux or vim)?

  • Weird. What is the value of $ echo $COLUMNS outside and inside of tmux and the value of :echo &columns in Vim? Also what is the value of $ echo $TERM in and outside of tmux? – romainl Apr 20 '13 at 11:34
  • Outside tmux: 202 (columns) xterm-256color – user977588 Apr 21 '13 at 22:17
  • Inside tmux: 202 (columns) screen. And inside vim, :echo columns returns 100 – user977588 Apr 21 '13 at 22:18
  • I don't know why, but I think I found a fix by putting set term=xterm into my .vimrc. Thank you for the clue! – user977588 Apr 21 '13 at 22:25
  • The recommended TERM setting for tmux is screen-256color. Add this line to ~/.tmux.conf: set -g default-terminal "screen-256color". – romainl Apr 22 '13 at 5:00

As @user977588 suggests, the fix here is to add:

set term=xterm

... to .vimrc.

EDIT: if you wish to retain syntax coloring, instead use:

set term=xterm-256color

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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