linux - Tmux .tmux.conf 无法正确加载

标签 linux shell tmux

<分区>

我是一个新的 Tmux 用户。 我有一个包含大量设置的 .tmux.conf 文件,但是当我尝试获取该文件时,它会抛出大量错误。

############
# Settings #
############
# http://alexyu.se/content/2012/04/tmux-and-irssi-sitting-tree

# Define default shell
set -g default-command /bin/zsh

# Start numbering at 1
set -g base-index 1
setw -g pane-base-index 1

# Allows for faster key repetition
set -s escape-time 0

# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on

# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on

# Status bar configuration
set -g status-utf8 on
set -g status-justify center
set -g status-interval 60
set -g status-left-length 40

# Status bar data
set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
set -g status-right "#(~/battery Discharging) | #[fg=cyan]%d %b %R"

# Enable the mouse
setw -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
# setw -g mode-mouse off

# Settings tmux for 256 colors
set -g default-terminal "screen-256color"

# enable vi keys.
setw -g mode-keys vi

################
# Key bindings #
################

# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
unbind C-b
bind-key a last-window

# reload source file
bind r source-file ~/.tmux.conf \; display "Reloaded!"

# Allows us to use C-a a <command> to send commands
# to a TMUX session inside another TMUX session
bind-key C-a send-prefix

# Vertical and horizontal splitting
bind | split-window -h
bind - split-window -v

# Home row movement between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# Cycle through windows
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+

# Resizing Panes
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

# Open panes in the same directory using the tmux-panes script
unbind v
unbind h
bind v send-keys " ~/tmux-panes -h" C-m
bind h send-keys " ~/tmux-panes -v" C-m

# Maximize and restore a pane
unbind Up
bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp
unbind Down
bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp

# vi like keybindings
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection

# copy and paste with system clipboard using xclip
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"

# Pipe the current pane to a log file with Shift-H - Press Shift-H again to stop.
bind-key H pipe-pane -o "cat >>$HOME/#W-tmux.log" \; display-message "Toggled logging to $HOME/#W-tmux.log"

# Sync panes - send what you're typing to other panes.
bind C-s set-window-option synchronize-panes

我得到的错误是这些:

  • 未知选项:pane-base-index
  • 坏值:开
  • 未知值:中心
  • 无效值:60
  • 未知命令: 绑定(bind)
  • 未知命令: 解除绑定(bind)
  • 未知命令: setw
  • 未知命令: set

最佳答案

问题是不可见的字节在文档中蔓延。只有在 Vim 中编辑时,我才能看到它。谢谢。

关于linux - Tmux .tmux.conf 无法正确加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12069477/

相关文章:

c - GCC + 内联汇编 - notl 上的意外段错误

php - 输出 "linux shell"与 "php system()"- 排序

c++ - 使用条件变量在 Linux 中实现 Windows 事件?

c - 为什么 bash 在分配时不自动导出 PATH?

Linux shell : Changing decimal (float) separator from dot to comma

vim - 在gnome终端,tmux和vim中配置日晒颜色方案

linux - 如何使用linux grep命令检查文件中的第4个字符是否为 'a'

c++ - 如何处理在 bash 文件中获取运行时输入的 C++ 程序?

为 session 设置 TMUX 环境变量

emacs - tmux 干扰 emacs 命令? (windmove-default-keybindings)