VIM注释颜色看不到解决方案:
系统终端开启256支持 export TERM="xterm-256color" >> .bashrc

常用快捷键

命令 备注
C-b C-o 调换窗口位置
C-b 空格键 采用下一个内置布局
C-b w 以菜单方式显示及选择窗口
C-b s 以菜单方式显示和选择会话
C-b [ 复制(空格开始)
C-b ] 粘贴(回车结束)
C-b , 给当前窗口改名
C-b & 关闭window
C-b d 脱离当前会话;
C-b D 选择要脱离的会话;在同时开启了多个会话时使用
C-b C-z 挂起当前会话
C-b s list session
C-b $ rename seesion
C-b c 创建一个新窗口
C-b & 关闭当前窗口
C-b , 重命名当前窗口;这样便于识别
C-b . 修改当前窗口编号;相当于窗口重新排序
C-b ! 将当前面板置于新窗口;即新建一个窗口,其中仅包含当前面板

Tmux 命令

Tmux命令 解释
tmux list-session
tmux new-session <会话名>
tmux attach-session -t <会话名>
tmux rename-session -t <会话名>
tmux choose-session -t <会话名>
tmux kill-session -t <会话名>

Tmux 配置

  1. # Our .tmux.conf file
  2. # Setting the prefix from C-b to C-a
  3. set -g prefix C-a
  4. # Free the original Ctrl-b prefix keybinding
  5. unbind C-b
  6. #setting the delay between prefix and command
  7. set -s escape-time 1
  8. # 使用鼠标滚轮滑动屏幕
  9. set -g mouse on
  10. # Ensure that we can send Ctrl-A to other apps
  11. bind C-a send-prefix
  12. # Set the base index for windows to 2 instead of 0
  13. set -g base-index 1
  14. # Set the base index for panes to 1 instead of 0
  15. setw -g pane-base-index 1
  16. # Reload the file with Prefix r
  17. bind r source-file ~/.tmux.conf \; display "Reloaded!"
  18. # splitting panes
  19. bind | split-window -h
  20. bind - split-window -v
  21. # moving between panes
  22. bind h select-pane -L
  23. bind j select-pane -D
  24. bind k select-pane -U
  25. bind l select-pane -R
  26. # Quick pane selection
  27. bind -r C-h select-window -t :-
  28. bind -r C-l select-window -t :+
  29. # Pane resizing
  30. bind -r H resize-pane -L 5
  31. bind -r J resize-pane -D 5
  32. bind -r K resize-pane -U 5
  33. bind -r L resize-pane -R 5
  34. # mouse support - set to on if you want to use the mouse
  35. setw -g mode-mouse off
  36. set -g mouse-select-pane off
  37. set -g mouse-resize-pane off
  38. set -g mouse-select-window off
  39. # Set the default terminal mode to 256color mode
  40. set -g default-terminal "screen-256color"
  41. # set the status line's colors
  42. set -g status-fg white
  43. set -g status-bg black
  44. # set the color of the window list
  45. setw -g window-status-fg cyan
  46. setw -g window-status-bg default
  47. setw -g window-status-attr dim
  48. # set colors for the active window
  49. setw -g window-status-current-fg white
  50. setw -g window-status-current-bg red
  51. setw -g window-status-current-attr bright
  52. # pane colors
  53. set -g pane-border-fg white
  54. #set -g pane-border-bg black
  55. set -g pane-active-border-fg green
  56. #set -g pane-active-border-bg yellow
  57. # Command / message line
  58. set -g message-fg white
  59. set -g message-bg black
  60. set -g message-attr bright
  61. #START:utf8
  62. set -g status-utf8 on
  63. # Center the window list
  64. set -g status-justify centre
  65. # Status line left side
  66. set -g status-left ''
  67. #set -g status-left-length 40
  68. #set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
  69. # Status line right side
  70. # 15% | 28 Nov 18:15
  71. set -g status-right "#[fg=cyan]%d %b %R"
  72. #2015-11-23 11:34
  73. #set -g status-right '#[fg=green][#[fg=cyan]%Y-%m-%d %H:%M#[fg=green]]'
  74. # Update the status bar every sixty seconds
  75. set -g status-interval 60
  76. # enable vi keys.
  77. setw -g mode-keys vi
  78. # set scrollback history to 10000 (10k)
  79. set -g history-limit 1000
  80. # visual notification of activity in other windows
  81. setw -g monitor-activity on
  82. set -g visual-activity on
  83. # visual Copy & Paste
  84. bind-key -t vi-copy 'v' begin-selection
  85. bind-key -t vi-copy 'y' copy-selection
  86. #set-option -g default-command "reattach-to-user-namespace -l zsh"
  87. # Session 恢复
  88. run-shell ~/.tmux/tmux-resurrect/resurrect.tmux
  89. run-shell ~/.tmux/tmux-continuum/continuum.tmux
  90. # 禁止重命名窗口名称
  91. set-option -g allow-rename off

FAQ

1. 打通 tmux 与系统中使用复制粘贴

https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
相关文章:https://evertpot.com/osx-tmux-vim-copy-paste-clipboard/

相关文档

  1. https://gist.github.com/ryerh/14b7c24dfd623ef8edc7