剛上手的Vim,黑底白字,看起來笨死了,於是一頓狂找,終於找到了配置方法。
配置當然要去etc目錄下。
cd /etc/vim
ls -l //找到vimrc文件
sudo vim vimrc //注意要用root身份才能修改
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
"syntax on
//取消注釋可開默認的啟語法高亮
" 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//取消注釋來支持vim打開文件時,光標跳到上次編輯位置
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
" filetype plugin indent on
"endif//取消注釋讓vim執行自動縮進
比如最後一項,去掉前面的",就可以了。
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
if has("autocmd")
filetype plugin indent on
endif
最後,vim就成這個樣子了。
當然還可以用一些插件。