2013-06-11 30 views
15

.tmux.conf của tôi trông như thế nàyKhông thể nguồn .tmux.conf

base-index 0 
    bell-action any 
    buffer-limit 9 
    default-command "" 
    default-path "" 
    default-shell "/bin/bash" 
    default-terminal "screen" 
    destroy-unattached off 
    detach-on-destroy on 
    display-panes-colour blue 
    display-panes-active-colour red 
    display-panes-time 1000 
    display-time 750 
    history-limit 2000 
    lock-after-time 0 
    lock-command "lock -np" 
    lock-server on 
    message-attr none 
    message-bg yellow 
    message-fg black 
    message-limit 20 
    mouse-select-pane off 
    pane-active-border-bg default 
    pane-active-border-fg green 
    pane-border-bg default 
    pane-border-fg default 
    set -g prefix ` 
    repeat-time 500 
    set-remain-on-exit off 
    set-titles off 
    set-titles-string "#S:#I:#W - "#T"" 
    status on 
    status-attr none 
    status-bg green 
    status-fg black 
    status-interval 15 
    status-justify left 
    status-keys emacs 
    status-left "[#S]" 
    status-left-attr none 
    status-left-bg default 
    status-left-fg default 
    status-left-length 10 
    status-right ""#22T" %H:%M %d-%b-%y" 
    status-right-attr none 
    status-right-bg default 
    status-right-fg default 
    status-right-length 40 
    status-utf8 off 
    terminal-overrides "*88col*:colors=88,*256col*:colors=256" 
    update-environment "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY" 
    visual-activity off 
    visual-bell off 
    visual-content off 
    visual-silence off 

khi tôi nguồn nó với

nguồn .tmux.conf

Nó cung cấp cho các lỗi sau

-bash: base-index: command not found 
-bash: bell-action: command not found 
-bash: buffer-limit: command not found 
-bash: default-command: command not found 
-bash: default-path: command not found 
-bash: default-shell: command not found 
-bash: default-terminal: command not found 
-bash: destroy-unattached: command not found 
-bash: detach-on-destroy: command not found 
-bash: display-panes-colour: command not found 
-bash: display-panes-active-colour: command not found 
-bash: display-panes-time: command not found 
-bash: display-time: command not found 
-bash: history-limit: command not found 
-bash: lock-after-time: command not found 
-bash: lock-command: command not found 
-bash: lock-server: command not found 
-bash: message-attr: command not found 
-bash: message-bg: command not found 
-bash: message-fg: command not found 
-bash: message-limit: command not found 
-bash: mouse-select-pane: command not found 
-bash: pane-active-border-bg: command not found 
-bash: pane-active-border-fg: command not found 
-bash: pane-border-bg: command not found 
-bash: pane-border-fg: command not found 
-bash: /home/srijan/.tmux.conf: line 27: unexpected EOF while looking for matching ``' 
-bash: /home/srijan/.tmux.conf: line 56: syntax error: unexpected end of file 

Trả lời

26

Vấn đề là bạn đang cố gắng chạy nó như một tập tin kịch bản khi nó là một cấu hình nên nằm trong thư mục gốc của bạn, tmux sẽ tìm một tập tin của tên đó ở vị trí đó khi bạn tạo một phiên mới.

Nếu bạn có một phiên tmux mở bạn bạn có thể tải lại một cấu hình bằng cách gõ

Prefix+B : 

Sau đó gõ:

source-file ~/.tmux.conf 
+0

Nó làm việc một cách hoàn hảo. Cảm ơn Dave :) Có cách nào để làm điều đó bên ngoài phiên tmux không? – Srijan

+1

Bạn có thể tạo một tệp kịch bản lệnh và tôi nghĩ hầu hết các lệnh của bạn sẽ hoạt động nhưng sẽ cần phải được đặt trước bằng lệnh tmux để bash sẽ hiểu. Xem http://pragprog.com/book/bhtmux/tmux để có một cuốn sách thực sự hay bao gồm kịch bản tmux. –

+6

@Srijan: Bạn có thể sử dụng 'tmux source-file ~/.tmux.conf' ở bất cứ đâu bạn có thể sử dụng bất kỳ lệnh shell nào khác (giả sử shell của bạn mở rộng' ~/'một cách thích hợp). –