加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

键绑定 – 使用Ctrl-b和Ctrl-f的Tmux向上/向下滚动页面

发布时间:2020-12-13 18:37:00 所属栏目:Linux 来源:网络整理
导读:一旦进入滚动模式,如何使用Ctrl b和Ctrl f来滚动页面? 这些命令当前在字符之间来回移动. .tmux.conf set -g default-terminal "screen-256color"setw -g xterm-keys onset -g status-bg blackset -g status-fg whiteset -g history-limit 999999999bind C-d
一旦进入滚动模式,如何使用Ctrl b和Ctrl f来滚动页面?

这些命令当前在字符之间来回移动.

.tmux.conf

set -g default-terminal "screen-256color"
setw -g xterm-keys on
set -g status-bg black
set -g status-fg white
set -g history-limit 999999999

bind C-d detach
bind r source-file ~/.tmux.conf

set -g prefix C-z 

if-shell 'test "$(tmux -V)" = "tmux 1.5"' 'set -g prefix C-a,C-z'
if-shell 'test "$(tmux -V)" = "tmux 1.6"' 'set -g prefix2 C-a'
if-shell 'test "$(tmux -V)" = "tmux 1.7"' 'set -g prefix2 C-a'

unbind C-b 
bind C-a send-keys C-a 
bind C-z send-keys C-z 

# These are available in iTerm by default,but need to be explicitly configured
# in Terminal.app.
# S-Up:    ^[[1;2A
# S-Down:  ^[[1;2B
# S-Right: ^[[1;2C
# S-Left:  ^[[1;2D
bind -n S-Up copy-mode
bind -n S-Down command-prompt
bind -n S-Right next-window
bind -n S-Left previous-window

#set -g base-index 1

set-window-option -g mode-keys vi

解决方法

在下面添加到.tmux.conf中,您可以像在vim中一样使用hjkl,Ctrl T / Ctrl U(PageDown / Up)在tmux滚动模式下移动.更重要的是,您可以使用/搜索.
setw -g mode-keys vi
set -g status-keys vi
bind-key -t vi-edit Up   history-up
bind-key -t vi-edit Down history-down

希望这将帮助你:)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读