【问题标题】:Jumping multiple lines at once causes weird behaviour on screen一次跳多行会导致屏幕上出现奇怪的行为
【发布时间】:2020-03-11 10:24:59
【问题描述】:

在 Vim 中,当尝试一次跳转多行时(例如使用 Ggg),如果我跳过当前在屏幕上看到的内容,屏幕上的文本将无法正确绘制。

来自旧光标位置的文本填充了新位置周围的空白。

我尝试使用<Esc>:redraw<CR> 重绘缓冲区,但无济于事。

我的.vimrc 相当简单,我认为这不会导致问题。

set nocompatible
filetype off

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
        Plugin 'VundleVim/Vundle.vim'
        Plugin 'arcticicestudio/nord-vim'
        Plugin 'preservim/nerdtree'
call vundle#end()
filetype plugin on

colorscheme nord
set relativenumber number
syntax on
set bs=2
set smartindent autoindent

nmap <silent> <F8> :call ToggleDiff()<CR>
function ToggleDiff()
        if(&diff)
                windo diffoff
        else
                windo diffthis
        endif
endfunction

我在 Konsole 上使用 tmux。

这里是.tmux.conf

unbind C-b
set-option -g prefix C-a
bind C-a send-prefix
set-window-option -g mode-keys vi

bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
bind -n C-x select-pane -t :.+
bind-key -r -T prefix C-j resize-pane -D 5
bind-key -r -T prefix C-h resize-pane -L 5
bind-key -r -T prefix C-k resize-pane -U 5
bind-key -r -T prefix C-l resize-pane -R 5

# Design changes
set -g default-terminal "xterm-256color"

# Global options
set-option -g allow-rename off

# Nord options
set -g @nord_tmux_no_patched_font "1"

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin "arcticicestudio/nord-tmux"

run -b '~/.tmux/plugins/tpm/tpm'

我也通过 etx 远程使用系统,虽然我已经使用了很长时间并且没有引起任何问题。


编辑:

刚刚观察到。当 NERDTree 在侧面打开时,不会出现此问题。这是有道理的,因为只有在我添加 NERDTree 插件时才会出现问题。

【问题讨论】:

    标签: vim tmux nerdtree konsole


    【解决方案1】:

    如果您将default-terminal 设置为tmux-256colorscreen-256color 并重新启动tmux (tmux kill-server),是否还会出现这种情况?确保 TERM 在 tmux 中是 tmux-256colorscreen-256color

    另外,您的 Konsole 几岁了?这可能是 Konsole 中的 indn 错误。在.tmux.conf 试试这个并重启 tmux:

    set -as terminal-overrides ',*:indn@'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多