Ubuntu 上的 Vim:文本渲染错误,奇怪地重复和消失 [英] Vim on Ubuntu: Text rendering bug, repeating and disappearing weirdly

查看:26
本文介绍了Ubuntu 上的 Vim:文本渲染错误,奇怪地重复和消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不久前我在 ubuntu 12.04 上安装了 vim.有时,当我在代码上运行光标(使用键盘,而不是鼠标)时,文本会消失,就好像渲染字符有问题一样.当我再次运行光标时,它通常会重新出现.

I had vim installed on ubuntu 12.04 not long ago. Sometimes when I run my cursor (using keyboard, not mouse) over code, text disappears, as though there is a problem rendering the character. When I run the cursor back again, it usually reappears.

这似乎是随机发生的,但往往足以让人恼火.

This seems to happen quite randomly but is often enough to make it irritating.

为了更清楚,这里有一个例子:

To make it clearer, here's an example:

1.原文:

嗨!你今天好吗.

2.光标经过后的文字

哈!你今天好吗.

3.再次将光标移到句子上后

3.After running the cursor over the sentence again

我!你好吗.

  1. 最后,光标在句子上运行几次后,就恢复正常了

.vimrc 文件:

set nocompatible               " be iMproved
 syntax on        "Syntax highlighting
 filetype off 
 set rtp+=~/.vim/bundle/vundle/
 call vundle#rc()

 colorscheme evening 
  
 "font
 set nu
 set guifont=Monospace\ 12
 set foldmethod=indent
 set foldlevel=99
 set lines=50 columns=80
 set ignorecase "searching is not case sensitive 
 set smartcase "if a pattern contains uppercase, searching IS case sensitive 
 set autoindent
 set tabstop=4
 
 winpos 1068 24
 " Type 'za' to open and close a fold
 " let Vundle manage Vundle
 
 Bundle 'gmarik/vundle'

 " original repos on github
 Bundle 'tpope/vim-fugitive'
 " vim-scripts repos
 Bundle 'L9'
 Bundle 'FuzzyFinder'
 " git repos on your local machine (ie. when working on your own plugin)
 
 "Bundles I install
 Bundle 'https://github.com/scrooloose/nerdtree.git' 
 Bundle 'scrooloose/syntastic'
 Bundle 'dbakker/vim-lint'
 Bundle 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'} 

 "snipmate
 Bundle "MarcWeber/vim-addon-mw-utils"
 Bundle "tomtom/tlib_vim"
 Bundle "snipmate-snippets"

"Install snipmate:
 Bundle "garbas/vim-snipmate"

 Bundle "sudar/vim-arduino-snippets"

 "PYTHON
 filetype plugin indent on
 Bundle 'klen/python-mode'
 autocmd BufRead *.py nmap <F5> :!python %<CR>
 set laststatus=2
 " :BundleList          - list configured bundles
 " :BundleInstall(!)    - install(update) bundles
 " :BundleSearch(!) foo - search(or refresh cache first) for foo
 " :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
 " see :h vundle for more details or wiki for FAQ
 " NOTE: comments after Bundle command are not allowed..
 " ARDUINO
 autocmd! BufNewFile,BufRead *.pde,*.ino  setlocal ft=arduino

我试图对问题进行截图,但意识到截图后,gvim 会有点刷新",并且丢失的字体再次出现.Alt-Tabbing 也有帮助.但是我还没有找到这个问题的永久解决方案.

I tried to take a screenshot of the problem, but realized that after taking a screenshot, gvim would sort of "refresh", and missing fonts appear again. Alt-Tabbing helps too. But I have not found a permanent solution to this problem.

此外,将光标移到缺少字符的文本行上有时会导致其他字符丢失,而旧字符出现.有时光标也会留下其他光标的静态图像.

Also, moving my cursor over the line of text with characters missing would sometimes cause other characters to go missing while old characters appear. Sometimes the cursor would also leave behind static images of other cursors.

我也在 windows 上安装了 vim,试试看是否出现同样的问题.

I've also got vim installed on windows, shall try it there to see if the same problem appears.

截图,注意左下角的空矩形:

Screenshot, notice the empty rectangle in the bottom left:

更新:所以我重新安装了 ubuntu(这次是 14.04)、gvim 和 vim.仍然存在一些令人讨厌的渲染问题,尽管它的表现有所不同(请参见屏幕截图 2).当我使用j"向下滚动时,行号和百分比会变得混乱并随着页面滚动.到目前为止只发生在 vim 上.Gvim 工作正常.

Update: So I've reinstalled ubuntu (this time to 14.04), gvim and vim. There are still some annoying rendering issues, although it manifests differently (see screenshot 2). Line numbers and percentages go haywire and scroll along with the page when I scroll down using "j". Only happens for vim so far. Gvim is working okay.

推荐答案

所以我发现了问题所在.原来在我从我的 .vimrc 中删除一行后,奇怪的视觉渲染错误消失了.

So I found out whats the problem. Turns out after I removed one line from my .vimrc, the weird visual rendering bugs are gone.

没想到这条看起来无害的线条是原因:

Did not expect this innocuous looking line to be the cause:

set lines=50 columns=100

不知道为什么会这样.

这篇关于Ubuntu 上的 Vim:文本渲染错误,奇怪地重复和消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆