vim tagbar依赖ctags
--> 最新配置可以参考
https://blog.csdn.net/ghostyusheng/article/details/84892209
1.sudo apt install ctags
2.在你的项目里执行 ctags -R ./*
3.vim ~/.vimrc
4.配置
set runtimepath^=~/.vim/bundle/ctrlp.vim
"filetype off
filetype on
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'scrooloose/nerdtree'
Bundle 'Xuyuanp/nerdtree-git-plugin'
Bundle 'majutsushi/tagbar'
filetype plugin indent on
"安装tagbar插件
""设置tagbar使用的ctags的插件,必须要设置对
let g:tagbar_ctags_bin='/usr/bin/ctags'
"设置tagbar的窗口宽度
"let g:tagbar_width=30
""设置tagbar的窗口显示的位置,为左边
let g:tagbar_right=1
"打开文件自动 打开tagbar
"autocmd BufReadPost *.cpp,*.c,*.h,*.hpp,*.cc,*.cxx call tagbar#autoopen()
""映射tagbar的快捷键
"map :TagbarToggle
map :TagbarToggle
map :NERDTreeToggle
set nu
highlight LineNr cterm=bold ctermfg=red
highlight StorageClass cterm=bold ctermfg=darkgreen
highlight Type cterm=bold ctermfg=blue
highlight LineNr cterm=bold ctermbg=black
highlight phpStructure cterm=bold ctermfg=darkred
highlight phpFunctions cterm=bold ctermfg=256
highlight Title ctermfg=blue
highlight pythonString cterm=bold ctermfg=gray
highlight pythonFunction cterm=bold
highlight pythonInclude cterm=bold ctermfg=lightblue
highlight javaScriptStringS ctermfg=gray
highlight String ctermfg=gray
hi Search cterm=NONE ctermfg=darkred ctermbg=yellow cterm=reverse
highlight Directory ctermfg=blue
set hlsearch
set backspace=2
set ruler
set showmode
syntax on
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set softtabstop=4
5. vim 底层命令行 VundleUpdate
6.Ctrl+c 启动
7.enjoy!
20170330-------------------------------------------更新代码
set rtp+=~/.vim/bundle/vundle/
set runtimepath^=~/.vim/bundle/ctrlp.vim
"call vundle#rc()
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'Chiel92/vim-autoformat'
Bundle 'scrooloose/nerdtree'
Bundle 'Xuyuanp/nerdtree-git-plugin'
Bundle 'majutsushi/tagbar'
filetype plugin indent on
call vundle#end()
let g:ycm_keep_logfiles = 1
let g:ycm_log_level = 'debug'
let g:tagbar_ctags_bin='/usr/bin/ctags'
let g:tagbar_right=1
map :TagbarToggle
map :NERDTreeToggle
let mapleader=","
nnoremap gl :YcmCompleter GoToDeclaration
nnoremap gf :YcmCompleter GoToDefinition
nnoremap gg :YcmCompleter GoToDefinitionElseDeclaration
set nu
highlight LineNr cterm=bold ctermfg=red
highlight StorageClass cterm=bold ctermfg=darkgreen
highlight Type cterm=bold ctermfg=blue
highlight LineNr cterm=bold ctermbg=black
highlight phpStructure cterm=bold ctermfg=darkred
highlight phpFunctions cterm=bold ctermfg=256
highlight Title ctermfg=blue
highlight pythonString cterm=bold ctermfg=gray
highlight pythonFunction cterm=bold
highlight pythonInclude cterm=bold ctermfg=lightblue
highlight javaScriptStringS ctermfg=gray
highlight String ctermfg=gray
hi Search cterm=NONE ctermfg=darkred ctermbg=yellow cterm=reverse
highlight Directory ctermfg=blue
set hlsearch
set ruler
set showmode
syntax on
set shiftwidth=4
set softtabstop=4
set tabstop=4
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
2017年12月28日12:53:15
追加superTab 按tab键 方便自动补全 释放双手Ctrl+n
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'ctrlp.vim'
Plugin 'gmarik/Vundle.vim'
Plugin 'Chiel92/vim-autoformat'
Plugin 'joonty/vdebug'
Plugin 'itchyny/lightline.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'majutsushi/tagbar'
Bundle 'junegunn/goyo.vim'
Plugin 'ervandew/supertab'
"Bundle 'joonty/vim-phpqa.git'
filetype plugin indent on
call vundle#end()
set runtimepath^=~/.vim/bundle/ctrlp.vim
"debug
let g:debuggerMaxDepth = 5
let g:debuggerPort = 9000
let g:tagbar_ctags_bin='/usr/bin/ctags'
let g:tagbar_right=1
map :TagbarToggle
map :NERDTreeToggle
set nu
highlight LineNr cterm=bold ctermfg=red
highlight StorageClass cterm=bold ctermfg=darkgreen
highlight Type cterm=bold ctermfg=blue
highlight LineNr cterm=bold ctermbg=black
highlight phpStructure cterm=bold ctermfg=darkred
highlight phpFunctions cterm=bold ctermfg=4
highlight Title ctermfg=blue
ighlight Directory ctermfg=blue
set hlsearch
set ruler
set showmode
syntax on
set shiftwidth=4
set softtabstop=4
set tabstop=4
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
nmap :.ccp
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
let g:ctrlp_open_multiple_files = 'ij'
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', 'undo', 'line', 'changes', 'mixed', 'bookmarkdir']
let g:SuperTabDefaultCompletionType = 'context'
set foldmethod=manual
syntax enable
colorscheme monokai
set nocompatible
set nobackup
set autochdir
set guifont=Consolas:h17
set laststatus=2
set backspace=2
2018年1月22日12:23:29
追加 tacahiroy/ctrlp-funky 按 "-" + "f" + "u" 进入快速函数筛选界面 这个插件不依赖ctags
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'ctrlp.vim'
Plugin 'gmarik/Vundle.vim'
Plugin 'Chiel92/vim-autoformat'
Plugin 'joonty/vdebug'
Plugin 'itchyny/lightline.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'majutsushi/tagbar'
Bundle 'junegunn/goyo.vim'
Plugin 'ervandew/supertab'
Plugin 'tacahiroy/ctrlp-funky'
"Bundle 'joonty/vim-phpqa.git'
filetype plugin indent on
call vundle#end()
set runtimepath^=~/.vim/bundle/ctrlp.vim
"debug
let g:debuggerMaxDepth = 5
let g:debuggerPort = 9000
let g:tagbar_ctags_bin='/usr/bin/ctags'
let g:tagbar_right=1
map :TagbarToggle
map :NERDTreeToggle
set nu
highlight LineNr cterm=bold ctermfg=red
highlight StorageClass cterm=bold ctermfg=darkgreen
highlight Type cterm=bold ctermfg=blue
highlight LineNr cterm=bold ctermbg=black
highlight phpStructure cterm=bold ctermfg=darkred
highlight phpFunctions cterm=bold ctermfg=4
highlight Title ctermfg=blue
highlight pythonString cterm=bold ctermfg=gray
highlight pythonFunction cterm=bold
highlight pythonInclude cterm=bold ctermfg=lightblue
highlight javaScriptStringS ctermfg=gray
highlight String ctermfg=gray
hi Search cterm=NONE ctermfg=blue ctermbg=black cterm=reverse
highlight Directory ctermfg=blue
set hlsearch
set ruler
set showmode
syntax on
set shiftwidth=4
set softtabstop=4
set tabstop=4
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
nmap :.ccp
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
let g:ctrlp_open_multiple_files = 'ij'
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', 'undo', 'line', 'changes', 'mixed', 'bookmarkdir']
let g:SuperTabDefaultCompletionType = 'context'
set foldmethod=manual
syntax enable
colorscheme monokai
set nocompatible
set nobackup
set autochdir
set guifont=Consolas:h17
set laststatus=2
set backspace=2
set t_ut=
let mapleader = "-"
nnoremap fu :CtrlPFunky
nnoremap fU :execute 'CtrlPFunky ' . expand('')
let g:ctrlp_funky_matchtype = 'path'
let g:ctrlp_funky_syntax_highlight = 1
20180417 整合完整的phpqa (需要安装github 提供的两个链接) 启动命令@qa
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'ctrlp.vim'
Plugin 'gmarik/Vundle.vim'
Plugin 'Chiel92/vim-autoformat'
"Plugin 'joonty/vdebug'
Plugin 'itchyny/lightline.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'majutsushi/tagbar'
Bundle 'junegunn/goyo.vim'
Plugin 'ervandew/supertab'
Plugin 'tacahiroy/ctrlp-funky'
Bundle 'joonty/vim-phpqa.git'
filetype plugin indent on
call vundle#end()
set runtimepath^=~/.vim/bundle/ctrlp.vim
"debug
"let g:debuggerMaxDepth = 5
"let g:debuggerPort = 9000
let g:tagbar_ctags_bin='/usr/bin/ctags'
let g:tagbar_right=1
map :TagbarToggle
map :NERDTreeToggle
set nu
highlight LineNr cterm=bold ctermfg=red
highlight StorageClass cterm=bold ctermfg=darkgreen
highlight Type cterm=bold ctermfg=blue
highlight LineNr cterm=bold ctermbg=black
highlight phpStructure cterm=bold ctermfg=darkred
highlight phpFunctions cterm=bold ctermfg=4
highlight Title ctermfg=blue
highlight pythonString cterm=bold ctermfg=gray
highlight pythonFunction cterm=bold
highlight pythonInclude cterm=bold ctermfg=lightblue
highlight javaScriptStringS ctermfg=gray
highlight String ctermfg=gray
hi Search cterm=NONE ctermfg=blue ctermbg=black cterm=reverse
highlight Directory ctermfg=blue
set hlsearch
set ruler
set showmode
syntax on
set shiftwidth=4
set softtabstop=4
set tabstop=4
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
nmap :.ccp
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
let g:ctrlp_open_multiple_files = 'ij'
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', 'undo', 'line', 'changes', 'mixed', 'bookmarkdir']
let g:SuperTabDefaultCompletionType = 'context'
set foldmethod=manual
syntax enable
colorscheme monokai
set nocompatible
set nobackup
set autochdir
set guifont=Consolas:h17
set laststatus=2
set backspace=2
set ts=4
set expandtab
set t_ut=
let mapleader = "-"
nnoremap fu :CtrlPFunky
nnoremap fU :execute 'CtrlPFunky ' . expand('')
"let g:ctrlp_funky_matchtype = 'path'
"let g:ctrlp_funky_syntax_highlight = 1
"ctags
set tags=./tags,./TAGS,tags;~,TAGS;~
" 把你项目中的tags文件指定!
au BufEnter /home/vagrant/.vim_cache setlocal tags+=/home/vagrant/code/lanmao/tags
"let mapleader="@"
let g:phpqa_codesniffer_args = "--standard=PSR2 -n"
20180419 for mac
fix: mac ctags tagbar无法用问题
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'ctrlp.vim'
Plugin 'gmarik/Vundle.vim'
Plugin 'Chiel92/vim-autoformat'
"Plugin 'joonty/vdebug'
Plugin 'itchyny/lightline.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'majutsushi/tagbar'
Bundle 'junegunn/goyo.vim'
Plugin 'ervandew/supertab'
Plugin 'tacahiroy/ctrlp-funky'
Bundle 'joonty/vim-phpqa.git'
filetype plugin indent on
call vundle#end()
set runtimepath^=~/.vim/bundle/ctrlp.vim
"debug
"let g:debuggerMaxDepth = 5
"let g:debuggerPort = 9000
let g:tagbar_ctags_bin='/usr/bin/ctags'
let g:tagbar_right=1
map :TagbarToggle
map :NERDTreeToggle
set nu
highlight LineNr cterm=bold ctermfg=red
highlight StorageClass cterm=bold ctermfg=darkgreen
highlight Type cterm=bold ctermfg=blue
highlight LineNr cterm=bold ctermbg=black
highlight phpStructure cterm=bold ctermfg=darkred
highlight phpFunctions cterm=bold ctermfg=4
highlight Title ctermfg=blue
highlight pythonString cterm=bold ctermfg=gray
highlight pythonFunction cterm=bold
highlight pythonInclude cterm=bold ctermfg=lightblue
highlight javaScriptStringS ctermfg=gray
highlight String ctermfg=gray
hi Search cterm=NONE ctermfg=blue ctermbg=black cterm=reverse
highlight Directory ctermfg=blue
set hlsearch
set ruler
set showmode
syntax on
set shiftwidth=4
set softtabstop=4
set tabstop=4
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
nmap :.ccp
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
let g:ctrlp_open_multiple_files = 'ij'
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', 'undo', 'line', 'changes', 'mixed', 'bookmarkdir']
let g:SuperTabDefaultCompletionType = 'context'
set foldmethod=manual
syntax enable
colorscheme monokai
set nocompatible
set nobackup
set autochdir
set guifont=Consolas:h17
set laststatus=2
set backspace=2
set ts=4
set expandtab
set t_ut=
let mapleader = "-"
nnoremap fu :CtrlPFunky
nnoremap fU :execute 'CtrlPFunky ' . expand('')
"let g:ctrlp_funky_matchtype = 'path'
"let g:ctrlp_funky_syntax_highlight = 1
"ctags
set tags=./tags,./TAGS,tags;~,TAGS;~
" 把你项目中的tags文件指定!
au BufEnter /home/vagrant/.vim_cache setlocal tags+=/home/vagrant/code/lanmao/tags
"let mapleader="@"
let g:phpqa_codesniffer_args = "--standard=PSR2 -n"
"let g:Tlist_Ctags_Cmd="/usr/local/Cellar/ctags/5.8_1/bin/ctags"
set tags=./tags,./TAGS,tags;~,TAGS;~
let g:tagbar_ctags_bin='/usr/local/bin/ctags'
let g:tagbar_width=26
2018年05月08日15:56:13 增加one-dark颜色配置 配置swp缓存目录
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'ctrlp.vim'
Plugin 'gmarik/Vundle.vim'
Plugin 'Chiel92/vim-autoformat'
"Plugin 'joonty/vdebug'
Plugin 'itchyny/lightline.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'majutsushi/tagbar'
Bundle 'junegunn/goyo.vim'
Plugin 'ervandew/supertab'
Plugin 'tacahiroy/ctrlp-funky'
"Bundle 'joonty/vim-phpqa.git'
filetype plugin indent on
call vundle#end()
set runtimepath^=~/.vim/bundle/ctrlp.vim
"debug
"let g:debuggerMaxDepth = 5
"let g:debuggerPort = 9000
let g:tagbar_ctags_bin='/usr/bin/ctags'
let g:tagbar_right=1
map :TagbarToggle
map :NERDTreeToggle
set nu
highlight LineNr cterm=bold ctermfg=red
highlight StorageClass cterm=bold ctermfg=darkgreen
highlight Type cterm=bold ctermfg=blue
highlight LineNr cterm=bold ctermbg=black
highlight phpStructure cterm=bold ctermfg=darkred
highlight phpFunctions cterm=bold ctermfg=4
highlight Title ctermfg=blue
highlight pythonString cterm=bold ctermfg=gray
highlight pythonFunction cterm=bold
highlight pythonInclude cterm=bold ctermfg=lightblue
highlight javaScriptStringS ctermfg=gray
highlight String ctermfg=gray
hi Search cterm=NONE ctermfg=blue ctermbg=black cterm=reverse
highlight Directory ctermfg=blue
set hlsearch
set ruler
set showmode
syntax on
set shiftwidth=4
set softtabstop=4
set tabstop=4
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
nmap :.ccp
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
let g:ctrlp_open_multiple_files = 'ij'
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', 'undo', 'line', 'changes', 'mixed', 'bookmarkdir']
let g:SuperTabDefaultCompletionType = 'context'
set foldmethod=manual
syntax enable
"colorscheme monokai
set nocompatible
set nobackup
set autochdir
set guifont=Consolas:h17
set laststatus=2
set backspace=2
set ts=4
set expandtab
set t_ut=
let mapleader = "-"
nnoremap fu :CtrlPFunky
nnoremap fU :execute 'CtrlPFunky ' . expand('')
"let g:ctrlp_funky_matchtype = 'path'
"let g:ctrlp_funky_syntax_highlight = 1
"ctags
set tags=./tags,./TAGS,tags;~,TAGS;~
let g:tagbar_ctags_bin='/usr/local/bin/ctags'
" 把你项目中的tags文件指定!
au BufEnter /home/vagrant/.vim_cache setlocal tags+=/home/vagrant/code/lanmao/tags
"256 color
if (empty($TMUX))
if (has("nvim"))
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
if (has("termguicolors"))
set termguicolors
endif
endif
colorscheme onedark
"swp缓存文件目录
set directory=/tmp/vim_swap
"不想产生交换文件
"set noswapfile
时间 20180717 更新配置
1.增加 vimbug E349 的解决方案
2.解决crontab -e在mac上的诡异编辑失败
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'ctrlp.vim'
"Plugin 'jaredly/vim-debug'
Plugin 'gmarik/Vundle.vim'
Plugin 'Chiel92/vim-autoformat'
Plugin 'itchyny/lightline.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'majutsushi/tagbar'
Bundle 'junegunn/goyo.vim'
Plugin 'ervandew/supertab'
Plugin 'tacahiroy/ctrlp-funky'
Plugin 'alvan/vim-php-manual'
"Bundle 'joonty/vim-phpqa.git'
filetype plugin indent on
call vundle#end()
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:tagbar_ctags_bin='/usr/bin/ctags'
let g:tagbar_right=1
map :TagbarToggle
map :NERDTreeToggle
set nu
highlight LineNr cterm=bold ctermfg=red
highlight StorageClass cterm=bold ctermfg=darkgreen
highlight Type cterm=bold ctermfg=blue
highlight LineNr cterm=bold ctermbg=black
highlight phpStructure cterm=bold ctermfg=darkred
highlight phpFunctions cterm=bold ctermfg=4
highlight Title ctermfg=blue
highlight pythonString cterm=bold ctermfg=gray
highlight pythonFunction cterm=bold
highlight pythonInclude cterm=bold ctermfg=lightblue
highlight javaScriptStringS ctermfg=gray
highlight String ctermfg=gray
hi Search cterm=NONE ctermfg=blue ctermbg=black cterm=reverse
highlight Directory ctermfg=blue
set hlsearch
set ruler
set showmode
syntax on
set shiftwidth=4
set softtabstop=4
set tabstop=4
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
nmap :.ccp
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
let g:ctrlp_open_multiple_files = 'ij'
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', 'undo', 'line', 'changes', 'mixed', 'bookmarkdir']
let g:SuperTabDefaultCompletionType = 'context'
set foldmethod=manual
syntax enable
"colorscheme monokai
set nocompatible
set nobackup
set autochdir
set guifont=Consolas:h17
set laststatus=2
set backspace=2
set ts=4
set expandtab
set t_ut=
let mapleader = "-"
nnoremap fu :CtrlPFunky
nnoremap fU :execute 'CtrlPFunky ' . expand('')
"let g:ctrlp_funky_matchtype = 'path'
"let g:ctrlp_funky_syntax_highlight = 1
"ctags
set tags=./tags,./TAGS,tags;~,TAGS;~
let g:tagbar_ctags_bin='/usr/local/bin/ctags'
" 把你项目中的tags文件指定!
au BufEnter /home/vagrant/.vim_cache setlocal tags+=/home/vagrant/code/lanmao/tags
"256 color
if (empty($TMUX))
if (has("nvim"))
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
if (has("termguicolors"))
set termguicolors
endif
endif
colorscheme onedark
"swp缓存文件目录
set directory=/tmp/vim_swap
"不想产生交换文件
set noswapfile
"vimbug E349: No identifier Under Cursor 似乎没暖用
let g:TerminusFocusReporting=0
"解决crontab -e在mac上的诡异编辑失败
autocmd filetype crontab setlocal nobackup nowritebackup
if $VIM_CRONTAB == "true"
set nobackup
set nowritebackup
endif
时间2018.09.16 因为工作原因,配置前端js的基本功能,包括但不限于eslint,auto Format。
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'ctrlp.vim'
Plugin 'gmarik/Vundle.vim'
Plugin 'Chiel92/vim-autoformat'
"Plugin 'joonty/vdebug'
Plugin 'itchyny/lightline.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'majutsushi/tagbar'
Bundle 'junegunn/goyo.vim'
Plugin 'ervandew/supertab'
Plugin 'tacahiroy/ctrlp-funky'
"js 全家桶
Plugin 'mxw/vim-jsx'
Plugin 'isRuslan/vim-es6'
Plugin 'pangloss/vim-javascript'
"js语法检测
Plugin 'scrooloose/syntastic'
"代码检测
"Bundle 'joonty/vim-phpqa.git'
"
filetype plugin indent on
call vundle#end()
set runtimepath^=~/.vim/bundle/ctrlp.vim
"debug
"let g:debuggerMaxDepth = 5
"let g:debuggerPort = 9000
let g:tagbar_ctags_bin='/usr/bin/ctags'
let g:tagbar_right=1
map :TagbarToggle
map :NERDTreeToggle
set nu
highlight LineNr cterm=bold ctermfg=red
highlight StorageClass cterm=bold ctermfg=darkgreen
highlight Type cterm=bold ctermfg=blue
highlight LineNr cterm=bold ctermbg=black
highlight phpStructure cterm=bold ctermfg=darkred
highlight phpFunctions cterm=bold ctermfg=4
highlight Title ctermfg=blue
highlight pythonString cterm=bold ctermfg=gray
highlight pythonFunction cterm=bold
highlight pythonInclude cterm=bold ctermfg=lightblue
highlight javaScriptStringS ctermfg=gray
highlight String ctermfg=gray
hi Search cterm=NONE ctermfg=blue ctermbg=black cterm=reverse
highlight Directory ctermfg=blue
set hlsearch
set ruler
set showmode
syntax on
set shiftwidth=4
set softtabstop=4
set tabstop=4
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
nmap :.ccp
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
let g:ctrlp_open_multiple_files = 'ij'
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', 'undo', 'line', 'changes', 'mixed', 'bookmarkdir']
let g:SuperTabDefaultCompletionType = 'context'
set foldmethod=manual
syntax enable
colorscheme onedark
set nocompatible
set nobackup
set autochdir
set guifont=Consolas:h17
set laststatus=2
set backspace=2
let g:jsx_ext_required = 0 " Allow JSX in normal JS files
"let mapleader = "-"
"nnoremap fu :CtrlPFunky
"nnoremap fU :execute 'CtrlPFunky ' . expand('')
"let g:ctrlp_funky_matchtype = 'path'
"let g:ctrlp_funky_syntax_highlight = 1
"js AutoFormat配置
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_always_populate_loc_list = 1
let g:formatdef_eslint = '"SRC=eslint-temp-${RANDOM}.js; cat - >$SRC; eslint --fix $SRC >/dev/null 2>&1; cat $SRC | perl -pe \"chomp if eof\"; rm -f $SRC"'
let g:formatters_javascript = ['eslint']
"上面定义的 formatter 做了这些事情:
"1将标准输入写到临时文件eslint-temp-xxx.js
"2调用 eslint --fix 来修复它
"3将 eslint-temp-xxx.js 输出到标准输出。
"4截掉文件尾的换行(\n)
"5删掉临时文件
"临时文件放在当前目录而非/tmp。否则 eslint 会根据 /tmp/eslint-temp-xxx.js 路径来读取配置文件。
"临时文件不命名为隐藏文件。否则 eslint 会忽略它。
"干掉文件尾的换行。这是因为 Vim 读入文件尾的换行后,会再来一个换行产生两个\n。
"autoformat 触发
noremap :Autoformat:w
时间 20180917 因为之前没配置emmet 写起来很累 ctags也没指定mac homebrew安装的ctags 导致 tagbar异常
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'ctrlp.vim'
Plugin 'gmarik/Vundle.vim'
Plugin 'Chiel92/vim-autoformat'
"Plugin 'joonty/vdebug'
Plugin 'itchyny/lightline.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'majutsushi/tagbar'
Bundle 'junegunn/goyo.vim'
Plugin 'ervandew/supertab'
Plugin 'tacahiroy/ctrlp-funky'
"js 全家桶
Plugin 'mxw/vim-jsx'
Plugin 'isRuslan/vim-es6'
Plugin 'pangloss/vim-javascript'
"js语法检测
Plugin 'scrooloose/syntastic'
"html emmet
Plugin 'mattn/emmet-vim'
"代码检测
"Bundle 'joonty/vim-phpqa.git'
"
filetype plugin indent on
call vundle#end()
set runtimepath^=~/.vim/bundle/ctrlp.vim
"debug
"let g:debuggerMaxDepth = 5
"let g:debuggerPort = 9000
let g:tagbar_ctags_bin='/usr/local/Cellar/ctags/5.8_1/bin/ctags'
let g:tagbar_right=1
map :TagbarToggle
map :NERDTreeToggle
set nu
highlight LineNr cterm=bold ctermfg=red
highlight StorageClass cterm=bold ctermfg=darkgreen
highlight Type cterm=bold ctermfg=blue
highlight LineNr cterm=bold ctermbg=black
highlight phpStructure cterm=bold ctermfg=darkred
highlight phpFunctions cterm=bold ctermfg=4
highlight Title ctermfg=blue
highlight pythonString cterm=bold ctermfg=gray
highlight pythonFunction cterm=bold
highlight pythonInclude cterm=bold ctermfg=lightblue
highlight javaScriptStringS ctermfg=gray
highlight String ctermfg=gray
hi Search cterm=NONE ctermfg=blue ctermbg=black cterm=reverse
highlight Directory ctermfg=blue
set hlsearch
set ruler
set showmode
syntax on
set shiftwidth=4
set softtabstop=4
set tabstop=4
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
nmap :.ccp
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
let g:ctrlp_open_multiple_files = 'ij'
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', 'undo', 'line', 'changes', 'mixed', 'bookmarkdir']
let g:SuperTabDefaultCompletionType = 'context'
set foldmethod=manual
syntax enable
colorscheme onedark
set nocompatible
set nobackup
set autochdir
set guifont=Consolas:h17
set laststatus=2
set backspace=2
let g:jsx_ext_required = 0 " Allow JSX in normal JS files
"let mapleader = "-"
"nnoremap fu :CtrlPFunky
"nnoremap fU :execute 'CtrlPFunky ' . expand('')
"let g:ctrlp_funky_matchtype = 'path'
"let g:ctrlp_funky_syntax_highlight = 1
"js AutoFormat配置
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_always_populate_loc_list = 1
let g:formatdef_eslint = '"SRC=eslint-temp-${RANDOM}.js; cat - >$SRC; eslint --fix $SRC >/dev/null 2>&1; cat $SRC | perl -pe \"chomp if eof\"; rm -f $SRC"'
let g:formatters_javascript = ['eslint']
"上面定义的 formatter 做了这些事情:
"1将标准输入写到临时文件eslint-temp-xxx.js
"2调用 eslint --fix 来修复它
"3将 eslint-temp-xxx.js 输出到标准输出。
"4截掉文件尾的换行(\n)
"5删掉临时文件
"临时文件放在当前目录而非/tmp。否则 eslint 会根据 /tmp/eslint-temp-xxx.js 路径来读取配置文件。
"临时文件不命名为隐藏文件。否则 eslint 会忽略它。
"干掉文件尾的换行。这是因为 Vim 读入文件尾的换行后,会再来一个换行产生两个\n。
"autoformat 触发
noremap :Autoformat:w
"html emmet
let g:user_emmet_mode='a' "enable all function in all mode.
let g:user_emmet_install_global = 0
autocmd FileType html,css,js,jsx EmmetInstall
au BufEnter /Users/zhangyusheng/react/my-app/* setlocal tags+=/Users/zhangyusheng/react/my-app/tags
2018年12月03日21:49:11 js 、jsx,eslint 检测 自动修正 前端组件集成版
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'ctrlp.vim'
Plugin 'gmarik/Vundle.vim'
Plugin 'Chiel92/vim-autoformat'
"Plugin 'joonty/vdebug'
Bundle 'scrooloose/nerdtree'
"needtre git 状态
Plugin 'Xuyuanp/nerdtree-git-plugin'
Bundle 'majutsushi/tagbar'
Bundle 'junegunn/goyo.vim'
Plugin 'ervandew/supertab'
Plugin 'tacahiroy/ctrlp-funky'
"js 全家桶
Plugin 'mxw/vim-jsx'
Plugin 'isRuslan/vim-es6'
Plugin 'pangloss/vim-javascript'
"js语法检测
Plugin 'scrooloose/syntastic'
"html emmet
Plugin 'mattn/emmet-vim'
"代码折叠
Plugin 'tmhedberg/SimpylFold'
"自动补全
Plugin 'Valloric/YouCompleteMe'
"
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Plugin 'tomasiser/vim-code-dark'
Plugin 'ryanoasis/vim-devicons'
"item2 设置为hack nerd font , 然后保证Non-Assii text 别勾上
"brew tap caskroom/fonts && brew cask install font-hack-nerd-font"
"
"快速检索
Plugin 'mileszs/ack.vim'
"https://beyondgrep.com/ack-2.24-single-file > /usr/local/bin/ack
"Plug 'w0rp/ale'
"代码检测
"Bundle 'joonty/vim-phpqa.git'
"
filetype plugin indent on
call vundle#end()
set runtimepath^=~/.vim/bundle/ctrlp.vim
"debug
"let g:debuggerMaxDepth = 5
"let g:debuggerPort = 9000
let g:tagbar_ctags_bin='/usr/local/Cellar/ctags/5.8_1/bin/ctags'
let g:tagbar_right=1
set tags=tags;
set autochdir
map :TagbarToggle
map :NERDTreeToggle
set nu
set hlsearch
set ruler
set showmode
syntax on
set tabstop=2
set shiftwidth=2
set expandtab
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
nmap :.ccp
""" --- ctrlp start ---
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
let g:ctrlp_open_multiple_files = 'ij'
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', 'undo', 'line', 'changes', 'mixed', 'bookmarkdir']
let g:ctrlp_working_path_mode = 'ra'
set wildignore+=*/tmp/*,*/node_modules/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = {'dir': '\v[\/]\.(git|hg|svn)$', 'file': '\v\.(exe|so|dll)$'}
""" --- ctrlp end ---
let g:SuperTabDefaultCompletionType = 'context'
syntax enable
colorscheme onedark
set nocompatible
set nobackup
set autochdir
set guifont=Consolas:h17
set laststatus=2
set backspace=2
"覆盖
highlight LineNr cterm=bold ctermfg=242
hi Search cterm=NONE ctermfg=blue ctermbg=black cterm=reverse
highlight Directory ctermfg=blue
set cursorline
let g:jsx_ext_required = 1 " Allow JSX in normal JS files
"let mapleader = "-"
"nnoremap fu :CtrlPFunky
"nnoremap fU :execute 'CtrlPFunky ' . expand('')
"let g:ctrlp_funky_matchtype = 'path'
"let g:ctrlp_funky_syntax_highlight = 1
"js AutoFormat配置
"eslint 建议用项目里面的node_modules里的eslint.js bin 文件 sudo ln -s /Users/fdd/work/agent-activity-website/node_modules/eslint/bin/eslint.js /usr/local/bin/eslint
let g:syntastic_javascript_checkers = ['eslint']
"保存检测太卡了
let g:syntastic_enable_signs=1
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list=1
let g:syntastic_enable_highlighting = 1
let g:syntastic_echo_current_error = 1
let g:syntastic_auto_jump = 1
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0
let g:syntastic_mode_map={'mode': 'passive'}
let g:syntastic_error_symbol = "\u2717"
let g:syntastic_warning_symbol = "\u26A0"
let g:formatdef_eslint = '"SRC=eslint-temp-${RANDOM}.js; cat - >$SRC; eslint --fix $SRC >/dev/null 2>&1; cat $SRC | perl -pe \"chomp if eof\"; rm -f $SRC"'
let g:formatters_javascript = ['eslint']
highlight SyntasticError ctermfg=240 ctermbg=204
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
"上面定义的 formatter 做了这些事情:
"1将标准输入写到临时文件eslint-temp-xxx.js
"2调用 eslint --fix 来修复它
"3将 eslint-temp-xxx.js 输出到标准输出。
"4截掉文件尾的换行(\n)
"5删掉临时文件
"临时文件放在当前目录而非/tmp。否则 eslint 会根据 /tmp/eslint-temp-xxx.js 路径来读取配置文件。
"临时文件不命名为隐藏文件。否则 eslint 会忽略它。
"干掉文件尾的换行。这是因为 Vim 读入文件尾的换行后,会再来一个换行产生两个\n。
"autoformat 触发
noremap :Autoformat:w
"html emmet
let g:user_emmet_mode='a' "enable all function in all mode.
let g:user_emmet_install_global = 1
autocmd FileType jsx,html,css,js EmmetInstall
set directory=$HOME/.vim/swapfiles//
"代码折叠
set foldmethod=indent
au BufWinLeave * silent mkview " 保存文件的折叠状态
au BufRead * silent loadview " 恢复文件的折叠状态
nnoremap za
" 用空格来切换折叠状态
""" --- vim copy for mac only !!! ---
set clipboard=unnamed
""" --- vim copy ---
""" --- power line ---
"先安装字体 git clone https://github.com/powerline/fonts.git --depth=1
"./install.sh
set guifont=Inconsolata\ for\ Powerline:h15
let g:Powerline_symbols = 'fancy'
set encoding=utf-8
set t_Co=256
set fillchars+=stl:\ ,stlnc:\
set term=xterm-256color
set termencoding=utf-8
""" you complate me config
"""install
"装好后去bundle里面编译,最好看文档
"https://github.com/Valloric/YouCompleteMe#mac-os-x
"install
"cd ~/.vim/bundle/YouCompleteMe
"./install.py --clang-completer
"""
" 4个字符之后自动补全
let g:ycm_min_num_of_chars_for_completion = 4
let g:ycm_min_num_identifier_candidate_chars = 4
let g:ycm_enable_diagnostic_highlighting = 0
" ycm预览窗口不显示
set completeopt-=preview
let g:ycm_add_preview_to_completeopt = 0
"""
"括号自动补全
inoremap ( ()i
inoremap [ []i
inoremap { {}O
autocmd Syntax html,vim inoremap < >i| inoremap > =ClosePair('>')
inoremap ) =ClosePair(')')
inoremap ] =ClosePair(']')
inoremap } =CloseBracket()
inoremap " =QuoteDelim('"')
inoremap ' =QuoteDelim("'")
function ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\"
else
return a:char
endif
endf
function CloseBracket()
if match(getline(line('.') + 1), '\s*}') < 0
return "\}"
else
return "\j0f}a"
endif
endf
function QuoteDelim(char)
let line = getline('.')
let col = col('.')
if line[col - 2] == "\\"
"Inserting a quoted quotation mark into the string
return a:char
elseif line[col - 1] == a:char
"Escaping out of the string
return "\"
else
"Starting a string
return a:char.a:char."\i"
endif
endf
如果配置phpqa 要配置https://github.com/jmolivas/phpqa 和 https://github.com/joonty/vim-phpqa