返回首頁
當前位置: 主頁 > 精通Office > Ubuntu教程 >

vim 文件備份教程及代碼

時間:2015-06-24 21:51來源:知行網www.f1globe.com 編輯:麥田守望者

set nu
syntax on
set tabstop=4

set hlsearch
set incsearch " increment search
set showmatch " when keyup the right ) the left ( bright
set background=dark

set nocompatible
filetype on
filetype off
set rtp+=~/.vim/bundle/vundle
let path='~/.vim/bundleplugins'
call vundle#rc(path)

Plugin 'gmarik/vundle'
Plugin 'Emmet.vim'
Plugin 'AutoComplPop'
Plugin 'scrooloose/nerdtree'
Plugin 'php.vim-html-enhanced'
Plugin 'bling/vim-airline'
Plugin 'fugitive.vim'
Plugin 'elzr/vim-json'
Plugin 'matchit.zip'
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'

call vundle#end()

filetype plugin indent on

set laststatus=2

map <C-n> :NERDTreeToggle<CR>

au FileType php call PHPFuncList()
function PHPFuncList()
set dictionary-=~/.vim/dict/php_funclist
set dictionary+=~/.vim/dict/php_funclist
set complete-=k complete+=k
endfunction

colorscheme solarized
"colorscheme blue
""colorscheme darkblue
""colorscheme default
""colorscheme delek
""colorscheme desert
"colorscheme elflord
""colorscheme evening
"colorscheme koehler
""colorscheme morning
""colorscheme murphy
"colorscheme pablo
""colorscheme peachpuff
"colorscheme ron
""colorscheme shine
"colorscheme slate
"colorscheme torte
""colorscheme zellner

"保存時檢測php文件的語法
autocmd BufWritePost *.php call PHPSyntaxCheck()

if !exists('g:PHP_SYNTAX_CHECK_BIN')
let g:PHP_SYNTAX_CHECK_BIN = 'php'
endif

function! PHPSyntaxCheck()
let result = system(g:PHP_SYNTAX_CHECK_BIN.' -l -n '.expand('%'))
if (stridx(result, 'No syntax errors detected') == -1)
echohl WarningMsg | echo result | echohl None
endif
endfunction

set modifiable

autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif

------分隔線----------------------------
標簽(Tag):Ubuntu Linux Android 操作系統 Unix fedora debian
------分隔線----------------------------
推薦內容
猜你感興趣
99久久免费高清热精品