第一步:下载vim插件管理工具vundle
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
第二步:copy我的vimrc到你的~/.vimrc里面(修改之前记得备份哦)
" See: http://vimdoc.sourceforge.net/htmldoc/options.html for details"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""=> General""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""设定 gvim 运行在增强模式下,不使用vi的键盘模式set nocompatible"设置支持多语言,解决乱码"设置内部编码为utf-8set encoding=utf-8set termencoding=utf-8set fileencodings=utf-8,gbk,default,latin1"解决consle输出乱码language messages zh_CN.utf-8"帮助菜单语言set helplang=cn" Sets how many lines of history VIM has to rememberset history=700" Enable filetype pluginsfiletype off "requiredfiletype plugin onfiletype indent on" Set to auto read when a file is changed from the outsideset autoread" With a map leader it's possible to do extra key combinations" like <leader>w saves the current filelet mapleader = ","let g:mapleader = ","" Fast savingnmap <leader>w :w!<cr>"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" => VIM user interface""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Set 7 lines to the cursor - when moving vertically using j/k"光标离上下边界7行时开始滚屏set so=7" Turn on the Wild menuset wildmenu" Ignore compiled filesset wildignore=*.o,*~,*.pycif has("win16") || has("win32") set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Storeelse set wildignore+=.git\*,.hg\*,.svn\*endif" Height of the command barset cmdheight=2" Configure backspace so it acts as it should actset backspace=eol,start,indentset whichwrap+=<,>,h,l" Ignore case when searchingset ignorecase" When searching try to be smart about cases set smartcase" Highlight search resultsset hlsearch" Makes search act like search in modern browsersset incsearch" Following line clears the search highlights when pressing Lbnnoremap <leader>/ :nohlsearch<CR>"Don't redraw while executing macros (good performance config)set lazyredraw" For regular expressions turn magic onset magic" Show matching brackets when text indicator is over themset showmatch" How many tenths of a second to blink when matching bracketsset mat=2" No annoying sound on errorsset noerrorbellsset novisualbellset t_vb=set tm=500"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" => Colors and Fonts"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Enable syntax highlightingsyntax enabletry colorscheme desertcatchendtryset background=dark" Set extra options when running in GUI modeif has("gui_running") set guioptions-=T set guioptions+=e set t_Co=256 set guitablabel=%M\ %tendif" Use Unix as the standard file typeset ffs=unix,dos,mac"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" => Files, backups and undo"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Turn backup off, since most stuff is in SVN, git et.c anyway...set nobackupset nowbset noswapfile"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" => Text, tab and indent related"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Use spaces instead of tabsset expandtab" Be smart when using tabs ;)set smarttabset tabstop=4set shiftwidth=4"对于不同类型的文件,进行自定义设置au FileType html,im,javascript,css set shiftwidth=2au FileType html,im,javascript,css set tabstop=2au FileType java,python,php set shiftwidth=4au FileType java,python,php set tabstop=4"设置每行的最大字符数,超过的话,将换行set textwidth=80" Linebreak on 500 charactersset lbrset tw=500set ai "Auto indentset si "Smart indentset wrap "Wrap lines""""""""""""""""""""""""""""""" => Visual mode related""""""""""""""""""""""""""""""" Visual mode pressing * or # searches for the current selection" Super useful! From an idea by Michael Naumann"vnoremap <silent> * :call VisualSelection('f')<CR>"vnoremap <silent> # :call VisualSelection('b')<CR>"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" => Moving around, tabs, windows and buffers"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Treat long lines as break lines (useful when moving around in them)map j gjmap k gk" Moving Between Windowsnnoremap <Leader>h <C-w>hnnoremap <Leader>l <C-w>lnnoremap <Leader>j <C-w>jnnoremap <Leader>k <C-w>k""""""""""""""""""""""""""""""" => Status line""""""""""""""""""""""""""""""" Always show the status lineset laststatus=2" Format the status lineset statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ \ \ \ \line:\%-14.(%l,%c%V%)\ %P"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" => Editing mappings"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Remap VIM 0 to first non-blank charactermap 0 ^" type S, then type what you're looking for, a /, and what to replace it withnmap S :%s/<C-R><C-W>\>//g<LEFT><LEFT>vmap S :s/<C-R><C-W>\>//g<LEFT><LEFT>"基本编辑器设置set number "显示行号set laststatus=2 "显示状态栏 (默认值为 1, 无法显示状态栏)set cmdheight=1 "设定命令行的行数为 1"set showtabline=2 "显示tab标签"set tabline+=%f "tab标签" Enable Code Foldingset foldenableset foldmethod=syntaxset mouse=a "任何情况都可以使用鼠标"工作目录随文件变autocmd BufEnter * cd %:p:h"不显示工具条set guioptions-=T" 配置文件.vimrc更改后自动重新载入使设置生效autocmd! bufwritepost .vimrc source ~/.vimrc "设置重新载入.vimrc快捷键map <silent> <leader>ss :source ~/.vimrc<cr>" 设置快速编辑.vimrc快捷键map <silent> <leader>ee :e ~/.vimrc<cr> "------ Replacing ------"type S, then type what you're looking for, a /, and what to replace it withnmap S :%s/<C-R><C-W>\>//g<LEFT><LEFT>vmap S :s/<C-R><C-W>\>//g<LEFT><LEFT>""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" => Scott McCoy/svn.vim" http://www.vim.org/scripts/script.php?script_id=743" cd ~/.vim" tar zxvf svn-<version>.tgz"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""更新当前目录的代码"map <F5> :!svn up<CR>"提交SVN(当前目录)"map <F7> :!svn ci -m ""<CR>"提交SVN(当前文件)"map <F8> :!svn ci -m "" %<CR> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =>Tagbar" http://www.vim.org/scripts/script.php?script_id=3465 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""noremap <silent> <Leader>y :TagbarToggle<CR>let g:tagbar_ctags_bin='/usr/bin/ctags-exuberant'let g:tagbar_width=26""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =>Exuberant Ctags" sudo apt-get install exuberant-ctags""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,ct = Builds ctags in current directorymap <Leader>ct :! /usr/bin/ctags-exuberant -R *<CR>""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" => vundle" git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set rtp+=~/.vim/bundle/vundle/call vundle#rc()"let Vundle manage Vundle"required!Bundle 'gmarik/vundle'"My Bundles here:""original repos on github" IndentBundle 'Yggdroot/indentLine'" PluginBundle 'The-NERD-tree'"------ NERDTree Options ------" 当打开vim且没有文件时自动打开NERDTreeautocmd vimenter * if !argc( ) | NERDTree | endif let NERDTreeIgnore=['CVS'] let NERDTreeChDirMode=2 "setting root dir in NT also sets VIM's cd noremap <silent> <Leader>n :NERDTreeToggle<CR> " These prevent accidentally loading files while in the NERDTree panel autocmd FileType nerdtree noremap <buffer> <c-left> <nop> autocmd FileType nerdtree noremap <buffer> <c-h> <nop> autocmd FileType nerdtree noremap <buffer> <c-right> <nop> autocmd FileType nerdtree noremap <buffer> <c-l> <nop>Bundle 'jiangmiao/auto-pairs'Bundle 'pangloss/vim-javascript'Bundle 'mattn/emmet-vim'Plugin 'mattn/jscomplete-vim'Bundle 'Shougo/neocomplcache' " Disable AutoComplPop. let g:acp_enableAtStartup = 0 " Use neocomplete. let g:neocomplete#enable_at_startup = 1 " Use smartcase. let g:neocomplete#enable_smart_case = 1 " Set minimum syntax keyword length. let g:neocomplete#sources#syntax#min_keyword_length = 3 let g:neocomplete#lock_buffer_name_pattern = '\*ku\*' " Define dictionary. let g:neocomplete#sources#dictionary#dictionaries = { \ 'default' : '', \ 'vimshell' : $HOME.'/.vimshell_hist', \ 'scheme' : $HOME.'/.gosh_completions' \ } " Define keyword. if !exists('g:neocomplete#keyword_patterns') let g:neocomplete#keyword_patterns = {} endif let g:neocomplete#keyword_patterns['default'] = '\h\w*'"Bundle 'joonty/vdebug'"<F5>: start/run (to next breakpoint/end of script)"<F2>: step over"<F3>: step into"<F4>: step out"<F6>: stop debugging"To stop debugging, press <F6>. Press it again to close the debugger interface."<F7>: detach script from debugger"<F9>: run to cursor"<F10>: set line breakpoint"<F11>: show context variables (e.g. after ""eval")"<F12>: evaluate variable under cursor":Breakpoint <type> <args>: set a breakpoint of any type (see :help VdebugBreakpoints)":VdebugEval <code>: evaluate some code and display the result"<Leader>e: evaluate the expression under visual highlight and display the result"SyntaxBundle 'scrooloose/Syntastic' let g:syntastic_check_on_open = 1 let g:syntastic_error_symbol = '?' let g:syntastic_warning_symbol = '?' let g:syntastic_auto_loc_list = 1 let g:syntastic_loc_list_height = 5 let g:syntastic_enable_highlighting = 0" 如果要对javascript进行语法检查,可以安装JSHint插件" sudo apt-get install nodejs" sudo npm install jshint" # 如果是 12.10,我发现 nodejs 可执行文件的命名不符合常规,要做个链接" sudo ln -s /usr/bin/nodejs /usr/bind/node"" :Brief help" :BundleList -list configured bundles" :BundleInstall(!) - install(update) bundles" :BundleSearch(!) foo - search(or refresh cache first) for foo" :BundleClean(!) - confirm(or auto-approve) removal of unused bundles" vundle主要就是上面这个四个命令,例如BundleInstall是全部重新安装,BundleInstall!则是更新" 一般安装插件的流程为,先BundleSearch一个插件,然后在列表中选中,按i安装" 安装完之后,在vimrc中,添加Bundle 'xxx' 使得bundle能够加载这个插件,同时如果" 需要配置这个插件,也是在vimrc中设置即可" 如果search到的安装不了,就换过来先在vimrc里添加Bundle 'xxx'" 在去vim里执行BundleInstall来安装" 卸载的话" 1. 注释掉Bundle/Plugin ×××(要删除的插件相关语句)" 2. :BundleClean" Done!" see :h vundle for more details or wiki for FAQ" ps: comments after Bundle command are not allowed.."""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" => Helper functions"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""function! HasPaste() if &paste return 'PASTE MODE ' en return ''endfunction

PHP類型提示提升代碼質量和可讀性。 1)標量類型提示:自PHP7.0起,允許在函數參數中指定基本數據類型,如int、float等。 2)返回類型提示:確保函數返回值類型的一致性。 3)聯合類型提示:自PHP8.0起,允許在函數參數或返回值中指定多個類型。 4)可空類型提示:允許包含null值,處理可能返回空值的函數。

PHP中使用clone關鍵字創建對象副本,並通過\_\_clone魔法方法定制克隆行為。 1.使用clone關鍵字進行淺拷貝,克隆對象的屬性但不克隆對象屬性內的對象。 2.通過\_\_clone方法可以深拷貝嵌套對象,避免淺拷貝問題。 3.注意避免克隆中的循環引用和性能問題,優化克隆操作以提高效率。

PHP適用於Web開發和內容管理系統,Python適合數據科學、機器學習和自動化腳本。 1.PHP在構建快速、可擴展的網站和應用程序方面表現出色,常用於WordPress等CMS。 2.Python在數據科學和機器學習領域表現卓越,擁有豐富的庫如NumPy和TensorFlow。

HTTP緩存頭的關鍵玩家包括Cache-Control、ETag和Last-Modified。 1.Cache-Control用於控制緩存策略,示例:Cache-Control:max-age=3600,public。 2.ETag通過唯一標識符驗證資源變化,示例:ETag:"686897696a7c876b7e"。 3.Last-Modified指示資源最後修改時間,示例:Last-Modified:Wed,21Oct201507:28:00GMT。

在PHP中,應使用password_hash和password_verify函數實現安全的密碼哈希處理,不應使用MD5或SHA1。1)password_hash生成包含鹽值的哈希,增強安全性。 2)password_verify驗證密碼,通過比較哈希值確保安全。 3)MD5和SHA1易受攻擊且缺乏鹽值,不適合現代密碼安全。

PHP是一種服務器端腳本語言,用於動態網頁開發和服務器端應用程序。 1.PHP是一種解釋型語言,無需編譯,適合快速開發。 2.PHP代碼嵌入HTML中,易於網頁開發。 3.PHP處理服務器端邏輯,生成HTML輸出,支持用戶交互和數據處理。 4.PHP可與數據庫交互,處理表單提交,執行服務器端任務。

PHP在過去幾十年中塑造了網絡,並將繼續在Web開發中扮演重要角色。 1)PHP起源於1994年,因其易用性和與MySQL的無縫集成成為開發者首選。 2)其核心功能包括生成動態內容和與數據庫的集成,使得網站能夠實時更新和個性化展示。 3)PHP的廣泛應用和生態系統推動了其長期影響,但也面臨版本更新和安全性挑戰。 4)近年來的性能改進,如PHP7的發布,使其能與現代語言競爭。 5)未來,PHP需應對容器化、微服務等新挑戰,但其靈活性和活躍社區使其具備適應能力。

PHP的核心優勢包括易於學習、強大的web開發支持、豐富的庫和框架、高性能和可擴展性、跨平台兼容性以及成本效益高。 1)易於學習和使用,適合初學者;2)與web服務器集成好,支持多種數據庫;3)擁有如Laravel等強大框架;4)通過優化可實現高性能;5)支持多種操作系統;6)開源,降低開發成本。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

EditPlus 中文破解版
體積小,語法高亮,不支援程式碼提示功能

mPDF
mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver Mac版
視覺化網頁開發工具