在Mac VI编辑器中,在文件开头获取`$ p`字符

时间:2019-02-20 03:11:48

标签: regex macos unix vim

最近在我的VI编辑器中出现了一些问题,每当我在VI编辑器中打开文件时,它都会用$p字符添加/替换文件的开头字符。

这很烦人,我签入了.viminfo.vimrc文件,但此字符不存在。以下是我的.vimrc文件的内容

syntax on
set nobackup
set hidden
set hlsearch
set incsearch
if &diff
    "colorscheme desert
    highlight DiffAdd term=reverse cterm=bold ctermbg=green ctermfg=white
    highlight DiffChange term=reverse cterm=bold ctermbg=cyan ctermfg=black
    highlight DiffText term=reverse cterm=bold ctermbg=gray ctermfg=black
    highlight DiffDelete term=reverse cterm=bold ctermbg=red ctermfg=black
endif
set completeopt=longest,menuone

下面是我的.viminfo文件的内容。

# You may edit it if you're careful!

# Viminfo version
|1,4

# Value of 'encoding' when this file was written
*encoding=utf-8


# hlsearch on (H) or off (h):
~h
# Last Search Pattern:
~MSle0~/$p

# Last Substitute Search Pattern:
~MSle0&pick

# Last Substitute String:
$````

1 个答案:

答案 0 :(得分:1)

如果仅在iTerm中发生,您可以尝试将其卸载,然后安装它的较新版本。