分享一个好用的tmux配置文件

tmux众所周知,不过多介绍,友好的tmux配置,让人用起来很舒服,分享一个tmux配置文件

# ------ general ------------------------------------
set -g prefix2 C-s
bind C-s send-prefix -2

set -g escape-time 0
set -g base-index 1
set -g renumber-windows on
set -g mouse on
set -wg pane-base-index 1

# rename-window
set -wg allow-rename off
set -wg automatic-rename off

set -wg mode-keys vi

# last-window
bind a last

# retain current path
bind c new-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"

# restart and edit
bind r source ~/.tmux.conf\; display "tmux config sourced"
bind e neww -n tmux-config "\${EDITOR:-vim} ~/.tmux.conf"

# ------ move around --------------------------------
bind -r h select-pane -L 
bind l select-pane -R        # remove repeat, because of ls
bind -r j select-pane -D
bind -r k select-pane -U

# ------ status theme -------------------------------
set -g message-style "bg=#00346e, fg=#ffffd7"        # tomorrow night blue, base3

set -g status-style "bg=#00346e, fg=#ffffd7"   # tomorrow night blue, base3
set -g status-left "#[bg=#0087ff] ❐ #S "       # blue
set -g status-left-length 400
set -g status-right "#{?client_prefix, ⌨ , } #[bg=#0087ff] #(whoami)@#h #[bg=red] %Y-%m-%d %H:%M "
set -g status-right-length 600

set -g set-clipboard on
set -g history-limit 8000

set -wg window-status-format " #I #W "
set -wg window-status-current-format " #I #W "
set -wg window-status-separator ""
set -wg window-status-current-style "bg=red" # red
set -wg window-status-last-style "fg=red"

set -wg pane-active-border-style "fg=blue"
set -wg pane-border-style "fg=#585858"       # base01

# ------- copy to clipboard ------------------------
# bind -t vi-copy y copy-pipe 'xclip -selection clipboard > /dev/null'
# bind -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"

注意在添加配置文件的时候,一定要关闭所有tmux窗口,然后source .tmux.conf,之后进入tmux就可以愉快的使用了

--------

更新,进入tmux之后,可能无法使用鼠标选中并且复制的情况,这个时候将配置文件中的

set -g mouse on

这一行注释掉即可

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要下载tmux配置文件,你可以按照以下步骤进行操作: 1. 首先,确保你的系统上已经安装了tmux。你可以使用包管理器(如apt、yum或brew)来安装tmux。例如,在Ubuntu上,你可以运行以下命令来安装tmux: ``` sudo apt-get install tmux ``` 2. 接下来,下载配置文件。你可以在Github等代码托管平台上找到很多现成的tmux配置文件。你可以根据自己的需求选择一个合适的配置文件。例如,你可以在Github上搜索“tmux config”并浏览搜索结果。 3. 找到一个适合你的配置文件后,你可以直接下载它。在Github上,你可以点击绿色的“Code”按钮,然后选择“Download ZIP”,将配置文件的zip包下载到你的本地。 4. 解压缩下载的zip包。你可以使用archive工具(如WinRAR、7-Zip)来解压缩文件。解压缩后,你会得到一个包含配置文件文件夹。 5. 找到tmux配置文件。在解压缩后的文件夹中,你可能会找到一个或多个文件,带有`.tmux.conf`、`.tmux`或`tmux.conf`的名称。选择其中一个文件,并将其命名为`.tmux.conf`。 6. 将配置文件放置在正确的位置。将`.tmux.conf`文件复制到你的用户目录下(在Linux和macOS中为`~`,在Windows中为`C:\Users\你的用户名`)。 7. 然后,打开终端,并重新启动tmux。你将看到新应用的配置已经生效。 通过遵循以上步骤,你可以方便地下载并使用tmux配置文件。记得在使用之前备份你的现有配置文件,以防止出现问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值