2017-12-14 1 views
1

방금 ​​vimrc를 어떻게 고장 냈는지는 알 수 없습니다. 나는 솔라리스를 설치했지만 구문 강조는 더 이상 자동으로 작동하지 않습니다. 편집기를 열 때마다 "구문 사용 가능"을 다시 입력해야합니다."구문 사용 가능"은 vimrc가 아닌 정상 모드에서만 작동합니다.

내 vimrc가 아래와 같습니다.

" ----- BASICS ----- 
set nocompatible "compatible with vi 
if !exists("g:syntax_on") 
    syntax enable 
endif 

filetype on "QS not sure about this one ! 
set number "add line numbers 
set showcmd "show command in bottom bar 
set cursorline "highlight cursor line 
set wildmenu "commandline tab completion 
set mouse=a "make vim useable with mouse 
set backspace=indent,eol,start " make backspace work like in most editors. 
set showmatch   " highlight matching [{()}] 

" ----- COLORSCHEME ----- 
let g:solarized_termcolors = 256 
set background=light 
colorscheme solarized 

    " ------ NAVIGATION ----- 
" long line navigation in normal mode 
nnoremap j gj 
nnoremap k gk 

" ------ TABS & SPACES ----- 
set tabstop=4  "number of visual spaces per TAB 
set shiftwidth=4 "size of indent with tab 
set softtabstop=0 
set noexpandtab "if you are using tab character inside your source 
"code - these are defensive settings to avoid conversion 

" ---------Searching ---------- 
set incsearch   " search as characters are entered 
set hlsearch   " highlight matches 

" ----------Folding ----------- 
set foldenable   " enable folding 
set foldlevelstart=10 " open most folds by default 
set foldnestmax=10  " 10 nested fold max 
nnoremap <space> za  
"space open/closes folds 
set foldmethod=indent " fold based on indent level 

set smartindent   " indents your code automatically 
filetype off     " required 
+0

256 색을 지원하는 터미널 에뮬레이터를 사용하고 있고 사용자 지정 솔라 화 된 터미널 색을 사용하고 싶지 않으십니까? –

+0

': verbose set syntax '는 무슨 뜻입니까? –

답변

1

~/.vimrc의 마지막 줄은 파일 형식 감지를 비활성화합니다. Vim이 없으면 Vim은 열려있는 모든 파일을 일반 텍스트로 취급하므로 구문 플러그인을로드하지 않습니다. 그 줄을 버리면 말이되지 않습니다. 위해

filetype off     " required 

오히려 모든 켭 파일 형식에 내장 들여 쓰기 플러그인 수혜 :

filetype plugin indent on 

더 자세한 내용은 :help :filetype를 참조하십시오.

+0

고마워요 - 어떻게/왜 내가 거기 버렸어? – banbourg

+0

기꺼이 도와 드리겠습니다. 구성을 완전히 이해하지 않고 다른 곳의 구성을 통합하는 것은 항상 위험합니다. (나는 이것도 불 태워 버렸다!) –

관련 문제