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 配置
# Our .tmux.conf file
# Setting the prefix from C-b to C-a
set -g prefix C-a
# Free the original Ctrl-b prefix keybinding
unbind C-b
#setting the delay between prefix and command
set -s escape-time 1
# 使用鼠标滚轮滑动屏幕
set -g mouse on
# Ensure that we can send Ctrl-A to other apps
bind C-a send-prefix
# Set the base index for windows to 2 instead of 0
set -g base-index 1
# Set the base index for panes to 1 instead of 0
setw -g pane-base-index 1
# Reload the file with Prefix r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# splitting panes
bind | split-window -h
bind - split-window -v
# moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Quick pane selection
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# Pane resizing
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# mouse support - set to on if you want to use the mouse
setw -g mode-mouse off
set -g mouse-select-pane off
set -g mouse-resize-pane off
set -g mouse-select-window off
# Set the default terminal mode to 256color mode
set -g default-terminal "screen-256color"
# set the status line's colors
set -g status-fg white
set -g status-bg black
# set the color of the window list
setw -g window-status-fg cyan
setw -g window-status-bg default
setw -g window-status-attr dim
# set colors for the active window
setw -g window-status-current-fg white
setw -g window-status-current-bg red
setw -g window-status-current-attr bright
# pane colors
set -g pane-border-fg white
#set -g pane-border-bg black
set -g pane-active-border-fg green
#set -g pane-active-border-bg yellow
# Command / message line
set -g message-fg white
set -g message-bg black
set -g message-attr bright
#START:utf8
set -g status-utf8 on
# Center the window list
set -g status-justify centre
# Status line left side
set -g status-left ''
#set -g status-left-length 40
#set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
# Status line right side
# 15% | 28 Nov 18:15
set -g status-right "#[fg=cyan]%d %b %R"
#2015-11-23 11:34
#set -g status-right '#[fg=green][#[fg=cyan]%Y-%m-%d %H:%M#[fg=green]]'
# Update the status bar every sixty seconds
set -g status-interval 60
# enable vi keys.
setw -g mode-keys vi
# set scrollback history to 10000 (10k)
set -g history-limit 1000
# visual notification of activity in other windows
setw -g monitor-activity on
set -g visual-activity on
# visual Copy & Paste
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
#set-option -g default-command "reattach-to-user-namespace -l zsh"
# Session 恢复
run-shell ~/.tmux/tmux-resurrect/resurrect.tmux
run-shell ~/.tmux/tmux-continuum/continuum.tmux
# 禁止重命名窗口名称
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/