2013-10-12 3 views
2

저는 새로운 vim 사용자입니다. 이 질문을하기 전에 저는 다음과 같이 비슷한 질문을했습니다 : Q-1, Q-2, Q-3Q-4. 그들 중 누구도 내 겉으로는 간단한 문제를 해결하지 못했습니다. 누군가 내가 내가 여기서 빠뜨린 것을 이해하도록 도울 수 있다면 좋을 것입니다.~/.vimrc의 업데이트가 반영되지 않음

문제점 설명 : 저는 Ubuntu-12.04 32 비트 시스템에서 작업하고 있습니다. 내 ~/.vimrc 파일에서 내가 무엇을 바꿔도 vim이 내 파일을 보여주는 방식에 반영되지 않습니다. 가장 최근에는 vim의 상태 표시 줄을 좀 더 유익하고 색으로 구분 된 코드 (here에서 복사 됨)로 변경하는 몇 줄을 추가했습니다. ~/.vimrc:so ~/.vimrc을 사용하여 소싱 한 후에도 의도 한 변경 사항이 구현되지 않으며 상태 표시 줄은 기본값과 동일하게 유지됩니다. 아래는 내 ~/.vimrc 파일입니다.

제가 누락 된 부분을 이해하도록 도와주세요. Statusline에 추가 된 줄은 ~/.vimrc 파일의 끝 부분입니다.

감사

~/.vimrc 파일

는 :

" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just 
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime 
" you can find below. If you wish to change any of those settings, you should 
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten 
" everytime an upgrade of the vim packages is performed. It is recommended to 
" make changes after sourcing debian.vim since it alters the value of the 
" 'compatible' option. 

" This line should not be removed as it ensures that various options are 
" properly set to work with the Vim-related packages available in Debian. 
runtime! debian.vim 

" Uncomment the next line to make Vim more Vi-compatible 
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous 
" options, so any other options should be set AFTER setting 'compatible'. 
"set compatible 

" Vim5 and later versions support syntax highlighting. Uncommenting the 
" following enables syntax highlighting by default. 
if has("syntax") 
    syntax on 
endif 

" If using a dark background within the editing area and syntax highlighting 
" turn on this option as well 
"set background=dark 

" Uncomment the following to have Vim jump to the last position when 
" reopening a file 
"if has("autocmd") 
" au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif 
"endif 

" Uncomment the following to have Vim load indentation rules and plugins 
" according to the detected filetype. 
"if has("autocmd") 
" filetype plugin indent on 
"endif 

" The following are commented out as they cause vim to behave a lot 
" differently from regular Vi. They are highly recommended though. 
"set showcmd  " Show (partial) command in status line. 
"set showmatch  " Show matching brackets. 
"set ignorecase  " Do case insensitive matching 
"set smartcase  " Do smart case matching 
"set incsearch  " Incremental search 
"set autowrite  " Automatically save before commands like :next and :make 
"set hidden    " Hide buffers when they are abandoned 
"set mouse=a  " Enable mouse usage (all modes) 

" Source a global configuration file if available 
if filereadable("/etc/vim/vimrc.local") 
    source /etc/vim/vimrc.local 
endif 

map <F3> gT 
map <F4> gt 

syntax enable 
syntax on 
colorscheme darkblue 
"set autoindent 
set cindent 
set nu 
set nowrap 
set softtabstop=2 
set shiftwidth=2 
"set expandtab 
autocmd BufWinLeave .* mkview 
autocmd BufWinEnter .* silent loadview 
"set textwidth=60 

"Lines added to change status line 
"define 3 custom highlight groups 
hi User1 ctermbg=green ctermfg=red guibg=green guifg=red 
hi User2 ctermbg=red ctermfg=blue guibg=red guifg=blue 
hi User3 ctermbg=blue ctermfg=green guibg=blue guifg=green 

set statusline= 
set statusline+=%1* "switch to User1 highlight 
set statusline+=%F "full filename 
set statusline+=%2* "switch to User2 highlight 
set statusline+=%y "filetype 
set statusline+=%3* "switch to User3 highlight 
set statusline+=%l "line number 
set statusline+=%* "switch back to statusline highlight 
set statusline+=%P "percentage thru file 
+1

@JoachimIsaksson 감사! 그것은 작동했습니다 ... – Abhinav

+0

이것은 vim의 런타임에서 발견되는 기본 vimrc의 복사본입니다. 첫 줄에서'map gT' (모두 제외)까지 모든 것을 삭제해야합니다. – romainl

답변

1

그냥 .vimrcset laststatus=2를 추가, 항상 눈에 보이는 상태 표시 줄이십시오. 적어도 두 눈에 보이는 창문이있는 경우에만 상태 표시 줄을 표시

표준 값이 laststatus=1입니다 (AFAIK, 두 개의 버퍼 사이의 화면을 분할하는 경우에만)

관련 문제