vim帮助产生“无法打开交换文件”错误

时间:2019-10-11 18:57:31

标签: vim

在vim中,当我经常执行':help'命令时,会出现错误。例如,当我执行':help tags'时,会看到以下错误:

"tagsrch.txt.gz" [readonly][noeol] 42L, 11288C
Error detected while processing function gzip#read:
line   51:
E303: Unable to open swap file for "/usr/share/vim/vim74/doc/tagsrch.txt.gz", recovery impossible
41 fewer lines
Press ENTER or type command to continue

当我按Enter键时,会根据需要显示帮助,但这仍然很麻烦。我做错了什么?我的google-foo显然太弱了,因为我看不到其他人对此有所抱怨。

这是因为我为交换目录设置了此设置吗?

set directory=~/.vim/swap,.

让我知道粘贴整个vimrc是否有帮助。如果有帮助,我将在vim 7.4上使用rhel7。

这是我的~/.vimrc

" vim:softtabstop=4:shiftwidth=4:et
" Tab preferences
set shiftwidth=4
set softtabstop=4
set autoindent
set expandtab

execute pathogen#infect()

" Where to store swap files.  By default, they will go into ~/.vim/swap, but
" if that doesn't work, they will go in cwd.
set directory=~/.vim/swap,.

filetype plugin indent on   " enables filetype indent specific plugins

" Instructions on how to tab complete filenames.
" set wildmode=longest,list,full
set wildmode=longest,list
set wildmenu

" In case there are vim modelines at the top of the file, as there
" is with this one.
set modeline

" Always show the status line.
set laststatus=2

" Look for a tags file.
set tags=./tags,tags;
" Also search for .git/tags files.
set tags^=./.git/tags,*/.git/tags;~

" Make Ctrl-] show the list of options by default.
nnoremap <C-]> g<C-]>
nnoremap <C-w><C-]> <C-w>g<C-]>

" Colors
" Have syntax highlighting in terminals which can display colours:
if has('syntax') && (&t_Co > 2)
  syntax on
else
  syntax off
endif
set background=dark
set hlsearch
set incsearch

" I so often type teh instead of the.
abbreviate teh the

" To help vim deal with pasting text
:map <F9> :set invpaste <CR>
set pt=<F9>

" Toggle vim's spell checker with <F5>
:map <F5> :setlocal spell! spelllang=en_us<cr>

" Shortcuts for c code.
map! ,bc /*  */^[hhi
map! ,bz #if 0^M#endif /* 0 */^[O

" Ignore whitespace when diffing files.
map ,iw :set diffopt+=iwhite<CR>
set path^=/home/bneradt/work/trafficserver/**

1 个答案:

答案 0 :(得分:0)

在我的情况下/分区已满。清理了它,现在可以使用了。