vim의 첫 번째 열이 노란색으로 강조 표시되고 사라지지 않습니다


25

사용자 vimrc를 정의하지 않았으며 OS는 redhat 4.6이며 검색 후 편집기의 첫 번째 열을 바꾼 후 노란색으로 강조 표시되어 vim을 닫고 열 때 그대로 유지됩니다. 이것은 시스템에 제공된 / etc / vimrc입니다. 누구나 버그 나 그 이유를 알 수 있습니까?

if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
   set fileencodings=utf-8,latin1
endif

set nocompatible    " Use Vim defaults (much better!)
set bs=indent,eol,start     " allow backspacing over everything in insert mode
"set ai         " always set autoindenting on
"set backup     " keep a backup file
set viminfo='20,\"50    " read/write a .viminfo file, don't store more
            " than 50 lines of registers
set history=50      " keep 50 lines of command line history
set ruler       " show the cursor position all the time

" Only do this part when compiled with support for autocommands
if has("autocmd")
  augroup redhat
    " In text files, always limit the width of text to 78 characters
    autocmd BufRead *.txt set tw=78
    " When editing a file, always jump to the last cursor position
    autocmd BufReadPost *
    \ if line("'\"") > 0 && line ("'\"") <= line("$") |
    \   exe "normal! g'\"" |
    \ endif
  augroup END
endif

if has("cscope") && filereadable("/usr/bin/cscope")
   set csprg=/usr/bin/cscope
   set csto=0
   set cst
   set nocsverb
   " add any database in current directory
   if filereadable("cscope.out")
      cs add cscope.out
   " else add database pointed to by environment
   elseif $CSCOPE_DB != ""
      cs add $CSCOPE_DB
   endif
   set csverb
endif

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

if &term=="xterm"
     set t_Co=8
     set t_Sb=[4%dm
     set t_Sf=[3%dm
endif

답변:


45

그것이하는 이유는

set hlsearch

명령하고 분명히 검색했기 때문입니다 ^.. 다음 검색까지 강조 표시를 끄려면 다음을 실행하십시오.

:nohl

또는 무의미한 것을 검색하십시오 (예 :) /alsdfkjslk. 강조 표시를 영구적으로 끄려면 ~ / .vimrc를 직접 작성하고 여기에 넣으십시오.

set nohlsearch

1
yah 나는 :s/^/#/섹션을 주석 으로 찾기 위해 검색을 했다
— Jed Schneider

esc를 누른 후에 하이라이트가 사라지지 않는다는 것은 정말 성가신 일입니다
— Deniz

당사 사이트를 사용함과 동시에 당사의 쿠키 정책과 개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.