Vim editor forPHP configuration

Source: Internet
Author: User
Autocmd! Bufwritepost_vimrcsource % garbled setencodingutf-8setfileencodingschine autocmd is displayed in the basic configuration processing text! Bufwritepost _ vimrc source %

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"Basic Configuration
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"Garbled characters are displayed in the processed text.
Set encoding = UTF-8
Set fileencodings = chinese
Set fileencoding = chinese

"Process menu and context menu garbled characters
Source $ vimruntime/delmenu. vim
Source $ vimruntime/menu. vim

"Handling consystemic output garbled characters
Language messages zh_cn.utf-8

"Disable VIM compatibility mode
"Set nocompatible

"File encoding format
Let & termencoding = & encoding
Set fileencodings = UTF-8, gbk, ucs-bom, cp936, gb2312

"Help files use Chinese characters
Set helplang = cn

"Disable syntax highlighting
Syntax enable

"Highlight by file type
Filetype plugin on

"Display row
Set nu

"Set the folding mode
"Set foldcolumn = 4

"The cursor is opened when it is folded.
"Set foldopen = all

"Syntax highlighting to define collapse
Set foldmethod = syntax "syntax highlighted and collapsed
"Set foldmethod = indent" more indentations indicate more advanced folds

"Hide by tag
Set foldmethod = marker

"No backup file is generated by default.
Set nobackup

"Cancel swap zone
Set nowb

"Auto scroll when you click 7 rows above and below the edge
Set so = 7

"Set VIM skin color
If has ("gui_running ")
Colorscheme candy
Endif

"Save 400 commands and 400 search history
Set history = 100

"The current cursor position is always displayed in the lower right corner of the window.
Set ruler

"Right-click
Set mouse =

"Set magic
Set magic

"Automatically switch the current directory to the directory where the current file is located
Set autochdir

"Highlight the current row
Set cursorline

"Terminal code for setting an empty wrong ringtone
Set t_vb =

"Hide toolbar
Set guioptions-= T

"Hide menu bar
Set guioptions-= m

"Jump to the matching bracket for a short time
Set matchtime = 4

"Switch the buffer when there are unsaved changes. vim is responsible for saving the changes.
Set hidden

"Maximize after startup
Au GUIEnter * simalt ~ X

"Show TAB key
Set list

"Remove the vi consistency mode to avoid bugs and limitations in earlier versions.
Set nocp

"Run the example of the. vimrc file provided by VIM by default, including the most common functions such as enabling syntax highlighting.
Source $ VIMRUNTIME/vimrc_example.vim

"Save the format Order of the file
Set fileformats = dos, unix

"Column highlight, conflicting with the function list
"Set cursorcolumn

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"File settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"Do not back up files
Set nobackup

"Do not generate a swap file. hide it when the buffer is discarded.
Set noswapfile
Set bufhidden = hide

"Number of pixel rows inserted between characters
Set linespace = 0

"The command line in enhanced mode automatically completes the operation
Set wildmenu

"The height of the command line (under the status line). The default value is 1. here is 2.
Set bytes height = 2

"Enable backspace to process indent, eol, start, and so on.
Set backspace = 2

"Allow backspace and cursor keys to span row boundaries
Set whichwrap + = <,>, h, l

"The prompt for assistance to children in Somalia is not displayed at startup.
Set shortmess = atI

"The commands command tells us which row of the file has been changed.
Set report = 0

"Don't let vim sound annoying.
Set noerrorbells

"White space is displayed between split windows for ease of reading
Set fillchars = vert: \, stl: \, stlnc :\

"Automatically load modified files
Set autoread

"The entire word is not broken at the line feed.
Set lbr

"Character width
Set tw = 0

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"Search and match
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"The time mark in the input parentheses will be placed in matching brackets temporarily, without affecting the input
Set showmatch

"Matching the time when brackets are highlighted (unit: 10 seconds)
Set matchtime = 5

"Case insensitive during search
Set ignorecase

"Do not highlight the searched sentence (phrases)
Set nohlsearch

"When searching, the entered words are highlighted by character (similar to firefox search)
Set incsearch

"Input: What should the set list command display?
"Set listchars = tab: \ | \, trail:., extends:>, precedes: <, eol: $
Set listchars = tab:>-, trail :-

"Move the cursor to the top and bottom of the buffer to keep the distance between three rows
Set scroloff = 3

"Do not flash
Set novisualbell

"Always show status line
Set laststatus = 2

"The search result is displayed when you enter the search content.
Setincsearch

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"Text Layout
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"Auto Indent
Set ai

"Enable automatic line feed
Set wrap

"Do not automatically collapse the code when starting VIM.
Set foldlevel = 100

"Indent format
Au FileType html, python, vim, javascript, tpl setlshiftwidth = 2 "html, python, vim, jsshfit indent format
Au FileType html, python, vim, javascript, tpl setltabstop = 2 "html, python, vim, js tab indent format

Au FileType java, php setl shiftwidth = 4 "java, php shift indent format
Au FileType java, php setltabstop = 4 "java, php tab indent format

"Use spaces to replace tabs
Set expandtab

"Use a tab at the beginning of a row and segment
Set smarttab

"Using C language indentation
Set cindent

"Inherits the indentation of the previous line, especially for Multiline comments.
Set autoindent

"Smart alignment
Set smartindent

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"CTags settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"Whether to highlight the current tag
Let Tlist_Auto_Highlight_Tag = 1

"Automatically enable Tlist
Let Tlist_Auto_Open = 0

"Automatically update Tlist
Let Tlist_Auto_Update = 1

"Whether to automatically close the tag list window after the tag or file is selected
Let Tlist_Close_On_Select = 0

"Compression mode
Let Tlist_Compact_Format = 1

"Whether to replace the tag name with the tag prototype in the tag list window
Let Tlist_Display_Prototype = 0

"Whether the valid tag range is displayed after the tag name
Let Tlist_Display_Tag_Scope = 1

"No folding tree is displayed
Let Tlist_Enable_Fold_Column = 0

"Disable VIM and disable Tlist.
Let Tlist_Exit_OnlyWindow = 1

"Do not close other tags
Let Tlist_File_Fold_Auto_Close = 0

If the value is 1, the focus is displayed in the tag list window using TlistToggle. if the value is 0, the focus remains in the code window after the taglist is opened.
Let Tlist_GainFocus_On_ToggleOpen = 1

"Allows/disables the expansion of the Vim window width when the label list window is displayed
Let Tlist_Inc_Winwidth = 0

"F12 switch Tlist
Nnoremap : TlistToggle

"Set the ctags running location
Let Tlist_Ctags_Cmd = 'd: \ vim \ vim73 \ ctags.exe'

"Set the tags file directory
Set tags = E: \ sys_item \ php \ tczp \ tags

"F12 generate/update the tags file
Function! UpdateTagsFile ()
Silent! Ctags-R -- fields = + ianS -- extra = + q
Endfunction
Nmap : Call UpdateTagsFile ()

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"NERDTreeToggle settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"F10 open directory tree
"Map : NERDTreeToggle

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"Buffer settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
Let g: bufExplorerDefaultHelp = 0 "Do not show default help.
Let g: bufExplorerShowRelativePath = 1 "Show relativepaths.
Letg: bufExplorerSortBy = 'mru' "Sort by most recently used.
Letg: bufExplorerSplitRight = 0 "Split left.
Let g: bufpolicersplitvertical = 1 "Splitvertically.
Let g: bufExplorerSplitVertSize = 30 "Split width
Let g: bufpolicerusecuritywindow = 1 "Open in new window.
Map : BufExplorer

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"MiniBuffer settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"Allowed And Switch
Let g: miniBufExplMapCTabSwitchBufs = 1
Let g: miniBufExplMapWindowNavVim = 1
Let g: miniBufExplMapWindowNavArrows = 1
Let g: miniBufExplModSelTarget = 1
Let g: minibufpolicermorethanone = 0 "let minibuffer only show one

Map : Bn "Switch Buffer, right switch
Map : Bp "Switch Buffer, switch left

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"WinManager settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"Set interface segmentation
Let g: winManagerWindowLayout = "TagList | FileExplorer"

"Set the winmanager width. the default value is 25.
Let g: winManagerWidth = 30

"Define enable and disable the winmanager button
Nmap wm: WMToggle

"Exit when only one window is left.
Let g: persistentBehaviour = 0

"It is automatically enabled when you enter VIM.
"Let g: AutoOpenWinManager = 1

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"Cssag settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"Cscope configuration, set to quickfix display mode
": Set cscopequickfix = s-, c-, d-, I-, t-, e-

"Add cscope to generate a file
": Cs add E: \ sys_item \ php \ tcsns \ cs.pdf. out E: \ sys_item \ php \ tcsns

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"Xdebug settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"Configure Xdebug. the content display contains arrays.
Let g: debuggerMaxDepth = 7

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"SuperTab settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"Remember the last completion location
"0-do not record the last completion method
"1-remember the last completion method until you use another completion command to change it.
"2-remember the last completion method until you press ESC to exit the insert mode.
"Let g: SuperTabRetainCompletionType = 2

"Letg: supertabdefacomplecompletiontype =" "

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"DoxygenToolkit settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"Let g: DoxygenToolkit_authorName =" figth, 023_dns@163.com"
"Let s: licenseTag =" Copyright (C )\ "
"Let s: licenseTag = s: licenseTag." For free \ "
"Let s: licenseTag = s: licenseTag." All rightreserved \ "
"Let g: DoxygenToolkit_licenseTag = s: licenseTag
"Let g: DoxygenToolkit_briefTag_funcName =" yes"
"Let g: doxygen_enhanced_color = 1

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"Load_template settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"Automatically loaded Template location
Let g: template_path = 'd: \ vim \ vimfiles \ template \'

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"Php settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"Use PHP to quickly comment CTRL + P
Source D: \ vim \ vimfiles \ plugin \ php-doc.vim
Inoremap : Call PhpDocSingle ()
Nnoremap : Call PhpDocSingle ()
Vnoremap : Call PhpDocRange ()

"Use php to complete the syntax
Autocmd FileType php set omnifunc = phpcomplete # CompletePHP

"Enable php to recognize EOT strings
Hi link phpheredoc string

"PHP supports folding
Let php_folding = 1

"Php indent
Let PHP_autoformatcomment = 1

"Php startup help shortcut key in normal mode K
Autocmd BufNewFile, Bufread *. ros, *. inc, *. php setkeywordprg = "help"

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"Javascript settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"Open javascript collapse
Let B: javascript_fold = 1

"Open javascript support for dom, html, and css
Let javascript_enable_domhtmlcss = 1

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"Other settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""

"Set dictionary ~ /. Vim/dict/file path
Autocmd filetype javascript setdictionary = D:/vim/vimfiles/dict/javascript. dict
Autocmd filetype css setdictionary = D:/vim/vimfiles/dict/css. dict
Autocmd filetype php setdictionary = D:/vim/vimfiles/dict/php. dict

"Set the project directory
Function! SET_LOCAL_TAGS ()
Let dir = expand ("%: p: h") "to obtain the source file path
If stridx (dir, "E: \ sys_item \ php \ tcsns") = 0 "path in the specified folder.
Settags = E: \ sys_item \ php \ tcsns "set the tags of the project
Endif
Endfunction

Autocmd BufEnter * call SET_LOCAL_TAGS ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.