[英]How do I stop my VIM background from being transparent in tmux where there is no text?
[英]How to stop vim pane from blinking in tmux?
我在 tmux 中使用 vim,它做了一件非常煩人的事情:每當我在 vim 中進行一些編輯(無論我是否保存)然后立即切換到另一個窗格時,vim 窗格的指示燈開始閃爍,直到我返回它. 這是調試時的常見情況,當我不斷在代碼和 make/gdb output 之間跳轉時。這並不總是發生,只有當我的 I/O 速度很低時才會發生(我登錄到遠程服務器有一個 NFS 文件系統和網絡磁盤有時會變得很慢),所以我認為發生的事情是 vim 做了一些 I/O(例如寫入交換文件)並想讓我知道它已經完成了。 如果我不立即切換到另一個窗格並給它一些時間進行內務處理,就不會發生這種情況(但這顯然會適得其反)。
這是我從具有 vim 的窗格 1 切換后立即發生的情況的 gif:
這是我的 tmux 配置:
set -g default-terminal "screen-256color" # colors!
setw -g xterm-keys on
set -s escape-time 0 # fastest command sequences
set -sg repeat-time 600 # increase repeat timeout
#set -s quiet on # disable various messages
#set -s focus-events on
set -g prefix2 C-q # GNU-Screen compatible prefix
bind C-a send-prefix -2
set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
setw -q -g utf8 on
set -g history-limit 5000 # boost history
set-window-option -g mode-keys vi
# edit configuration
bind e new-window -n '~/.tmux.conf.local' "sh -c '\${EDITOR:-vim} ~/.tmux.conf.local && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\"'"
set-option -g repeat-time 0
# reload configuration
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
# -- display -------------------------------------------------------------------
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
setw -g automatic-rename on # rename window to reflect current program
set -g renumber-windows on # renumber windows when a window is closed
set -g set-titles on # set terminal title
set -g set-titles-string '#h ❐ #S ● #I #W'
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time
set -g status-interval 10 # redraw status line every 10 seconds
# clear both screen and history
bind -n C-l send-keys C-l \; run 'sleep 0.05 && tmux clear-history'
# activity
set -g monitor-activity on
set -g visual-activity off
這是我的 vim 配置:
set encoding=utf-8 " The encoding displayed.
set fileencoding=utf-8 " The encoding written to file.
set nocompatible
filetype off
syntax on
set tabstop=4
set expandtab
set shiftwidth=4
set softtabstop=4
set number
set hlsearch
set list
set listchars=tab:>-
set listchars+=eol:�
set listchars+=space:�
set splitright
set splitbelow
colorscheme molokai
" Vundle config
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
call vundle#end()
filetype plugin indent on
set laststatus=2
set updatetime=1000
au BufNewFile,BufRead * if &syntax == '' | set syntax=sh | endif
閃爍一直困擾着我,所以我搜索了更多,最后找到了這個鏈接的答案。 原來必須禁用 tmux 中的鈴聲。
為了參考,我轉載了下面的答案:
# disable in vim
set vb t_vb= " no visual bell & flash
# disable bell in tmux
# disable sound bell
set -g bell-action none
# disable visual bell
set -g visual-bell off
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.