Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One of the first things I had to with tmux is figure out a convenient prefix key. I found the default prefix key (C-b) to be a little clumsy to use. After a little experimentation, C-j has become my secondary tmux prefix key of choice.

It doesn't interfere with my shell or Vim usage. C-j is redundant in shell as well as Vim because it does what pressing the Enter key would do. Further, in Vim, C-j is synonymous to j in normal and visual modes. C-j is also very easy to type because my right forefinger always returns to j while resting.

This is what my ~/.tmux.conf looks like.

  # Set C-j as secondary prefix key.
  # C-b remains intact as primary prefix key.
  set -g prefix2 C-j
  bind-key C-j send-prefix -2

  # Eliminate delay after <Esc> key press in Vim.
  set -g escape-time 0

  # Let Vim use 256 colors.
  set -g default-terminal screen-256color



I use C-], but basically pick anything that isn't a common bash or emacs cursor movement. I can't use C-b as that is my "backspace"


I ended up using C-s. Unfortunately C-j is taken over by vim-tmux-navigator (which I don't mind at all).




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: