Vim在启动时将随机字符放入命令栏
我似乎对vim有问题,当我打开vim时(不是gvim,gvim不这样做),它会将一堆随机字符放入命令栏。例如,当我键入Vim在启动时将随机字符放入命令栏,vim,configuration,Vim,Configuration,我似乎对vim有问题,当我打开vim时(不是gvim,gvim不这样做),它会将一堆随机字符放入命令栏。例如,当我键入vim test.txt时,它将打开test.txt,但会出现一些字符形式,如.2802;0c作为命令键入 我能做些什么来解决这个问题吗 谢谢你的帮助 这是我的.vimrc: " =========== Info ============== " VimRC File " Author: Mark Asp " Purpose: Store overall Vim setting
vim test.txt
时,它将打开test.txt,但会出现一些字符形式,如.2802;0c
作为命令键入
我能做些什么来解决这个问题吗
谢谢你的帮助
这是我的.vimrc:
" =========== Info ==============
" VimRC File
" Author: Mark Asp
" Purpose: Store overall Vim settings
" that are specific to the editing
" environment.
" ===============================
" ==== Use ViM rather than Vi ====
set nocompatible
" ================================
" ========== Pathogen ============
execute pathogen#infect()
filetype indent plugin on
" ================================
" ======= General Settings =======
let mapleader="," " Set the map leader to , for ease of use
set nomodeline " Don't allow modelines as they are vim only
" --- Color Settings --
syntax on " Enable syntax coloring
set t_Co=256
colorscheme harlequin
" ---------------------
set relativenumber " Show the relative line number
set backspace=indent,eol,start " Allow backspace to transcend lines
" ================================
" ========== Mappings ============
" Load mappings from ~/.vim/mappings.vim
if filereadable(expand("~/.vim/mappings.vim"))
source ~/.vim/mappings.vim
endif
set notimeout ttimeout " Time out for key codes only
set ttimeoutlen=1000 " Wait 200 millis
" ================================
" ========== Formatting ==========
" ---- Indentation ----
set shiftwidth=4 " Set the tab width to 4 spaces
set tabstop=4 " Set the tab width to 4 spaces
set expandtab " Convert tabs to spaces
" ---------------------
" ----- Wrapping ------
set wrap " Only wrap visually
set linebreak " Don't cut a word in half while wrapping
" ---------------------
" ================================ }}}
" ======= Window Settings =======
set hidden " Allow buffers to be hidden in the background
set confirm " Always ask for confirmation
set t_vb= " Do no visual things
" ---- Bottom Bar -----
set showcmd " Show the command being typed
set cmdheight=1 " Make the command line 1 character tall
set wildmenu " Complete for commands
set laststatus=2 " Make it so that status only shows with 2 or
" more windows
" ---------------------
" ================================
" ======= Search Settings ========
set hlsearch " Highlight search results
set smartcase " If all is lower, ingore case, if there is a
" capital letter, include it.
" ================================
" ============ Movement ==========
set nostartofline " Keep cursor position when switching lines
" ================================
" ========= Persistance ==========
" Keep undo history across sessions
" by storing all changes all time
silent !mkdir ~/.vim/backups > /dev/null 2>&1
set undodir=~/.vim/backups
set undofile
" Turn off all swap files
set noswapfile
set nobackup
set nowb
" ================================
" ====== Custom File Types =======
au BufNewFile,BufRead *.frag,*.vert,*.fp,*.vp,*.glsl setf glsl
" ================================
" ======== GVim Settings =========
set guifont=Droid\ Sans\ Mono\ 10
set guioptions-=m " remove menu bar
set guioptions-=T " remove toolbar
set guioptions-=r " remove right-hand scrollbar
set guioptions-=l " remove left-hand scrollbar
" ================================
" ======== CTag Settings =========
set tags+=~/.vim/tags
" ================================
我使用您的vimrc文件并注释掉以下行。在那之后,我没有在命令栏上遇到随机字符,它工作得很好。我想可能是你的vim的一些插件引起的。(我在实验室的linux服务器上进行了测试。)
我有一个类似的问题,但我的问题是由我的.vimrc中的这个垃圾引起的,并且在我评论/删除这些行时修复了这个问题
augroup myCmds
au!
autocmd VimEnter * silent !echo -ne "\e[2 q"
autocmd VimLeave * silent !echo -ne "\e[1 q"
augroup END
这看起来像是一些无法识别的ANSI转义码。您的终端和
$TERM
的值是多少?!目前我正在使用xterm的$TERM。还安装了哪些插件?试着禁用它们,看看你是否可以改变行为。你使用ssh、screen或tmux吗?
augroup myCmds
au!
autocmd VimEnter * silent !echo -ne "\e[2 q"
autocmd VimLeave * silent !echo -ne "\e[1 q"
augroup END