Created
October 13, 2017 22:54
-
-
Save DArcMattr/d274356ac0d11c857fe91446752993ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if !1 | finish | endif | |
if empty(glob('~/.config/nvim/autoload/plug.vim')) | |
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs | |
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
autocmd VimEnter * PlugInstall | source $MYVIMRC | |
endif | |
if system('uname -o') =~ '^GNU/' | |
let b:make = 'make' | |
else | |
let b:make = 'gmake' | |
endif | |
if filereadable("/etc/debian_version") | |
let b:pager_install = ' install-deb' | |
else | |
let b:pager_install = ' install' | |
endif | |
call plug#begin('~/.config/nvim/plugged') | |
"Plug 'airblade/vim-gitgutter' | |
"Plug 'benmills/vimux' | |
"Plug 'bling/vim-airline' | |
"Plug 'DArcMattr/wordpress.vim', { 'branch' : 'develop' } | |
"Plug 'editorconfig/editorconfig-vim' | |
"Plug 'embear/vim-localvimrc' | |
"Plug 'equalsraf/neovim-gui-shim' | |
"Plug 'fatih/vim-go', { 'for': [ 'go' ] } | |
"Plug 'jeffkreeftmeijer/vim-numbertoggle' | |
"Plug 'jiangmiao/auto-pairs' | |
"Plug 'joonty/vdebug', { 'branch': 'v2-integration' } | |
"Plug 'joonty/vim-taggatron' | |
"Plug 'ludovicchabant/vim-lawrencium' | |
"Plug 'reedes/vim-wheel' | |
"Plug 'rkitover/vimpager', { 'do': 'sudo ' . b:make . b:pager_install } | |
"Plug 'shawncplus/phpcomplete.vim', { 'for': [ 'php', 'php.wordpress' ] } | |
"Plug 'sheerun/vim-polyglot' | |
Plug 'Shougo/denite.nvim', { 'do' : ':UpdateRemotePlugins' } | |
"Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' | |
"Plug 'tpope/vim-fugitive' | |
"Plug 'tpope/vim-git' | |
"Plug 'tpope/vim-surround' | |
Plug 'tpope/vim-vividchalk' | |
"Plug 'tristen/vim-sparkup', { 'for': [ 'html', 'php' ] } | |
"Plug 'Valloric/MatchTagAlways' | |
"Plug 'Valloric/YouCompleteMe', { 'do' : './install.py --system-libclang --clang-completer --tern-completer --gocode-completer' } | |
"Plug 'vim-scripts/csv.vim' | |
"Plug 'vim-scripts/DirDiff.vim' | |
"Plug 'vim-scripts/matchit.zip' | |
Plug 'w0rp/ale' | |
call plug#end() | |
set autoindent | |
set autoread | |
set backspace=indent,eol,start | |
set colorcolumn=+1 | |
set complete-=i | |
set completeopt=menuone,longest | |
set diffopt=filler,vertical | |
set display+=lastline | |
set encoding=utf-8 | |
set expandtab | |
set fillchars+=stl:\ ,stlnc:\ | |
set formatoptions=nqr12 | |
set gdefault | |
if executable("ag") | |
set grepprg=ag\ --nogroup\ --nocolor | |
elseif executable("ack") | |
set grepprg=ack\ -H\ --nogroup\ --nocolor | |
else | |
set grepprg=grep\ -nH\ $* | |
endif | |
set hidden | |
set hlsearch | |
set ignorecase | |
set incsearch | |
set iskeyword+=- | |
set laststatus=2 | |
set lazyredraw | |
set list | |
set listchars=eol:↲,precedes:«,extends:»,trail:·,tab:▸·,nbsp:¯ | |
set matchtime=5 | |
set modeline | |
set mouse=a | |
set nobomb | |
set nojoinspaces | |
set nostartofline | |
set noswapfile | |
set nowrap | |
set nrformats-=octal | |
set number | |
set path+=** | |
set previewheight=20 | |
set printheader=%<%f%h%m\ %40 | |
set printheader=+{strftime(\"%c\"getftime(expand(\"%%\")))}%=Page\ %N | |
set printoptions=formfeed:y,paper:letter,portrait:n,number:y,syntax:7 | |
set printoptions+=left:5mm,right:5mm,top:10mm,bottom:5mm | |
set pumheight=15 | |
set relativenumber | |
set scrolloff=3 | |
set sessionoptions=blank,buffers,curdir,folds,help,tabpages,winsize | |
set shiftround | |
set shiftwidth=2 | |
set shortmess=atIAoO | |
set showbreak=> | |
set showcmd | |
set showmatch | |
set sidescrolloff=5 | |
set smartcase | |
set smartindent | |
set smarttab | |
set softtabstop=2 | |
set splitbelow | |
set synmaxcol=512 | |
set tabstop=2 | |
set termguicolors | |
set textwidth=80 | |
set title | |
set titlestring=%t%(\ [%R%M]%) | |
set timeout | |
set timeoutlen=750 | |
set ttimeout | |
set ttimeoutlen=0 | |
set undofile | |
set virtualedit=all | |
set visualbell | |
set wildmenu | |
set wildmode=list:longest,list:full | |
set wildignore+=.svn,CVS,.git,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg | |
set wildignore+=*.png,*.xpm,*.gif,*.pdf,*.bak,*.beam,*.pyc | |
set wildignore+=vendor/*,docs/*,node_modules/*,components/*,build/*,dist/* | |
colorscheme vividchalk | |
highlight Comment ctermfg=105 guifg=#8787ff | |
highlight CursorColumn cterm=NONE ctermbg=237 guibg=#3a3a3a | |
highlight CursorLine term=underline cterm=underline ctermbg=NONE gui=underline guibg=NONE | |
highlight LineNr gui=bold guifg=#c6c6c6 guibg=#00005f | |
highlight LineNr term=reverse cterm=bold ctermfg=251 ctermbg=17 | |
highlight NonText ctermfg=235 guifg=#262626 | |
highlight OverLength ctermbg=234 ctermfg=249 | |
highlight OverLength guibg=#1c1c1c guifg=#b2b2b2 | |
highlight Search ctermfg=222 guifg=#ffdf87 | |
highlight SpecialKey ctermfg=235 guifg=#262626 | |
highlight clear SpellBad | |
highlight clear SpellCap | |
highlight clear SpellLocal | |
highlight clear SpellRare | |
highlight SpellBad term=standout ctermfg=1 term=underline cterm=underline guifg=#800000 gui=underline | |
highlight SpellCap term=underline cterm=underline gui=undercurl | |
highlight SpellLocal term=underline cterm=underline gui=undercurl | |
highlight SpellRare term=underline cterm=underline gui=undercurl | |
match OverLength /\%81v.\+/ | |
match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' | |
let mapleader = "," | |
let maplocalleader = " " | |
let c_space_errors = 1 | |
let php_sync_method = 1 | |
let $GIT_SSL_NO_VERIFY = 'true' | |
let g:airline#extensions#branch#enabled = 1 | |
let g:airline#extensions#quickfix#location_text = 'Location' | |
let g:airline#extensions#quickfix#quickfix_text = 'Quickfix' | |
let g:airline#extensions#ale#enabled = 1 | |
let g:airline#extensions#tabline#buffer_nr_show = 1 | |
let g:airline#extensions#tabline#enabled = 1 | |
let g:airline#extensions#tabline#fnamemod = ':t' | |
let g:airline#extensions#whitespace#mixed_indent_algo = 1 | |
let g:airline#extensions#ycm#enabled = 1 | |
let g:airline_powerline_fonts = 1 | |
let g:ale_lint_on_save = 1 | |
let g:ale_lint_on_text_changed = 0 | |
let g:ale_linters = { | |
\ 'php': ['php -l', 'phpcs'], | |
\} | |
let g:ale_open_list = 1 | |
let g:ale_sign_error = '⨉' | |
let g:ale_sign_warning = '⚠' | |
let g:ale_set_loclist = 1 | |
let g:ale_set_quickfix = 0 | |
let g:AutoPairsShortcutToggle = '<Leader>ap' | |
let g:AutoPairsShortcutFastWrap = '<Leader>ae' | |
let g:AutoPairsShortcutJump = '<Leader>an' | |
let g:AutoPairsShortcutBackInsert = '<Leader>ab' | |
let g:go_term_mode = "split" | |
let g:less = { 'enabled' : 0, } | |
let g:localvimrc_persistent = 1 | |
let g:localvimrc_event = ['BufNewFile', 'BufRead'] | |
let g:localvimrc_reverse = 1 | |
let g:localvimrc_sandbox = 0 | |
let g:mta_filetypes = { | |
\ 'html' : 1, | |
\ 'xhtml' : 1, | |
\ 'xml' : 1, | |
\ 'php' : 1, | |
\} | |
let g:netrw_silent = 1 | |
let g:NumberToggleTrigger = '<Leader>l' | |
let g:session_autoload = 'no' | |
let g:session_autosave = 'no' | |
let g:sparkupExecuteMapping = '<Leader>se' | |
let g:sparkupNextMapping = '<Leader>sn' | |
let g:tagcommands = { 'php': { 'args': '-R' } } | |
let g:UltiSnipsExpandTrigger = "<Leader>u" | |
let g:UltiSnipsJumpBackwardTrigger = "<C-j>" | |
let g:UltiSnipsJumpForwardTrigger = "<C-k>" | |
let g:VCSCommandSplit = 'vertical' | |
let g:vimpager = {} | |
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>'] | |
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>'] | |
let g:ycm_filetype_blacklist = { 'markdown': 1, 'text': 1, } | |
imap <C-c> <CR><ESC>O | |
map <Leader>gs :Gstatus<CR> | |
map <Leader>gd :Gdiff<CR> | |
map <Leader>gc :Gcommit<CR> | |
map <Leader>gl :Glog<CR> | |
map <Leader>gp :Gpush<CR> | |
map <C-PageUp> :bn<CR> | |
map <C-PageDown> :bp<CR> | |
map <Leader><F7> :setlocal spell! spell? spelllang=en_us<CR> | |
nmap . .'[ | |
nmap <C-i> i<SPACE><ESC> | |
noremap n nzz | |
noremap N Nzz | |
noremap <C-d> <C-d>zz | |
noremap <C-u> <C-u>zz | |
noremap <Leader>t :enew<CR> | |
nnoremap <C-e> 3<C-e> | |
nnoremap <C-p> :Denite file_rec<CR> | |
nnoremap <C-y> 3<C-y> | |
nnoremap <Leader>/ :Denite grep:.<CR> | |
nnoremap <Leader>o :Denite outline<CR> | |
nnoremap <Leader>q :nohlsearch<CR> | |
nnoremap H ^ | |
nnoremap J mzJ`z | |
nnoremap L $ | |
nnoremap Q gq | |
nnoremap Y y$ | |
nnoremap c "xc | |
nnoremap gj j | |
nnoremap gk k | |
nnoremap <expr> k (v:count == 0 ? 'gk' : 'k') | |
nnoremap <expr> j (v:count == 0 ? 'gj' : 'j') | |
nnoremap { {zz | |
nnoremap } }zz | |
nnoremap ' ` | |
nnoremap ` ' | |
nnoremap ; : | |
nnoremap : ; | |
inoremap <C-u> <C-g>u<C-u> | |
inoremap <C-x><C-k> <nop> | |
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" | |
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" | |
vnoremap y y`] | |
vnoremap p "_dP`] | |
xnoremap c "xc | |
" in case of derp-sudo | |
cmap w!! w !sudo tee % >/dev/null | |
command! W w !sudo tee % >/dev/null | |
" Denite | |
call denite#custom#option( 'default', { | |
\ 'prompt': '>', | |
\ 'short_source_names': 1, | |
\ 'split': 'vertical', | |
\ 'vertical_preview': 1, | |
\ 'winwidth': 40, | |
\}) | |
call denite#custom#option( 'list', { 'mode': 'normal' } ) | |
call denite#custom#option( 'grep', { 'vertical_preview': 1 } ) | |
if executable('ag') | |
" Use ag in denite grep source. | |
call denite#custom#var( 'grep', 'command', ['ag'] ) | |
call denite#custom#var( 'grep', 'default_opts', ['-i', '--vimgrep'] ) | |
call denite#custom#var( 'grep', 'recursive_opts', [] ) | |
call denite#custom#var( 'grep', 'pattern_opt', [] ) | |
call denite#custom#var( 'grep', 'separator', ['--'] ) | |
call denite#custom#var( 'grep', 'final_opts', [] ) | |
elseif executable('ack-grep') | |
" Use ack in denite grep source. | |
call denite#custom#var( 'grep', 'command', ['ack'] ) | |
call denite#custom#var( 'grep', 'default_opts', | |
\ ['--ackrc', $HOME.'/.ackrc', '-H', | |
\ '--nopager', '--nocolor', '--nogroup', '--column'] ) | |
call denite#custom#var( 'grep', 'recursive_opts', [] ) | |
call denite#custom#var( 'grep', 'pattern_opt', ['--match'] ) | |
call denite#custom#var( 'grep', 'separator', ['--'] ) | |
call denite#custom#var( 'grep', 'final_opts', [] ) | |
endif | |
command! -nargs=1 Silent | | |
\ execute ':silent !'.<q-args> | | |
\ execute ':redraw!' | |
command! -nargs=* -complete=help Help vertical belowright help <args> | |
" Convenient command to see the difference between the current buffer and the | |
" file it was loaded from, thus the changes you made. | |
" Only define it when not defined already. | |
if !exists(":DiffOrig") | |
command DiffOrig vert new | set buftype=nofile | read ++edit # | 0d_ | diffthis | |
\ | wincmd p | diffthis | |
endif | |
" from https://gist.github.com/tarruda/5158535 | |
if $TMUX != '' | |
function! TmuxMove(direction) | |
" Check if we are currently focusing on a edge window. | |
" To achieve that, move to/from the requested window and | |
" see if the window number changed | |
let oldw = winnr() | |
silent! exe 'wincmd ' . a:direction | |
let neww = winnr() | |
silent! exe oldw . 'wincmd' | |
if oldw == neww | |
" The focused window is at an edge, so ask tmux to switch panes | |
if a:direction == 'j' | |
call system("tmux select-pane -D") | |
elseif a:direction == 'k' | |
call system("tmux select-pane -U") | |
elseif a:direction == 'h' | |
call system("tmux select-pane -L") | |
elseif a:direction == 'l' | |
call system("tmux select-pane -R") | |
endif | |
else | |
exe 'wincmd ' . a:direction | |
end | |
endfunction | |
function! TmuxSharedYank() | |
" Send the contents of the 't' register to a temporary file, invoke | |
" copy to tmux using load-buffer, and then to xclip | |
" FIXME for some reason, the 'tmux load-buffer -' form will hang | |
" when used with 'system()' which takes a second argument as stdin. | |
let tmpfile = tempname() | |
call writefile(split(@t, '\n'), tmpfile, 'b') | |
call system('tmux load-buffer '.shellescape(tmpfile).';tmux show-buffer | xclip -i -selection clipboard') | |
call delete(tmpfile) | |
endfunction | |
function! TmuxSharedPaste() | |
" put tmux copy buffer into the t register, the mapping will handle | |
" pasting into the buffer | |
let @t = system('xclip -o -selection clipboard | tmux load-buffer -;tmux show-buffer') | |
endfunction | |
vnoremap <silent> <ESC>y "ty:call TmuxSharedYank()<cr> | |
vnoremap <silent> <ESC>d "td:call TmuxSharedYank()<cr> | |
nnoremap <silent> <ESC>p :call TmuxSharedPaste()<cr>"tp | |
vnoremap <silent> <ESC>p d:call TmuxSharedPaste()<cr>h"tp | |
set clipboard= " Use this or vim will automatically put deleted text into x11 selection('*' register) which breaks the above map | |
nnoremap <silent> <C-w>j :silent call TmuxMove('j')<cr> | |
nnoremap <silent> <C-w>j :silent call TmuxMove('j')<cr> | |
nnoremap <silent> <C-w>k :silent call TmuxMove('k')<cr> | |
nnoremap <silent> <C-w>h :silent call TmuxMove('h')<cr> | |
nnoremap <silent> <C-w>l :silent call TmuxMove('l')<cr> | |
nnoremap <silent> <C-w><down> :silent call TmuxMove('j')<cr> | |
nnoremap <silent> <C-w><up> :silent call TmuxMove('k')<cr> | |
nnoremap <silent> <C-w><left> :silent call TmuxMove('h')<cr> | |
nnoremap <silent> <C-w><right> :silent call TmuxMove('l')<cr> | |
endif | |
function! SetDiffColors() | |
highlight DiffAdd cterm=bold ctermfg=white ctermbg=DarkGreen | |
highlight DiffDelete cterm=bold ctermfg=white ctermbg=DarkGrey | |
highlight DiffChange cterm=bold ctermfg=white ctermbg=DarkBlue | |
highlight DiffText cterm=bold ctermfg=white ctermbg=DarkRed | |
endfunction | |
autocmd FilterWritePre * call SetDiffColors() | |
augroup OmniFunc | |
autocmd! | |
autocmd FileType * | |
\ if &omnifunc == "" | | |
\ setlocal omnifunc=syntaxcomplete#Complete | | |
\ endif | |
augroup END | |
augroup FastEscape | |
autocmd! | |
autocmd InsertEnter * set timeoutlen=0 | |
autocmd InsertLeave * set timeoutlen=200 | |
augroup END | |
augroup TrimWhitespace | |
autocmd! | |
autocmd BufRead,BufWrite * | |
\ if ! &bin | | |
\ silent! %s/\s\+$//ge | | |
\ endif | |
augroup END | |
" update diffs aggressively | |
" https://groups.google.com/forum/?fromgroups=#!topic/vim_use/ZNZcBAABDgE | |
augroup AutoDiffUpdate | |
autocmd! | |
autocmd InsertLeave * | |
\ if &diff | | |
\ diffupdate | | |
\ let b:old_changedtick = b:changedtick | | |
\ endif | |
autocmd CursorHold * | |
\ if &diff && | |
\ (!exists('b:old_changedtick') || b:old_changedtick != b:changedtick) | | |
\ let b:old_changedtick = b:changedtick | diffupdate | | |
\ endif | |
augroup END | |
augroup CursorColumn | |
autocmd! | |
autocmd VimEnter,WinEnter,BufWinEnter * setlocal cursorcolumn | |
autocmd WinLeave * setlocal nocursorcolumn | |
set cursorcolumn | |
augroup END | |
augroup CursorLine | |
autocmd! | |
autocmd VimEnter,WinEnter,BufWinEnter * setlocal cursorline | |
autocmd WinLeave * setlocal nocursorline | |
set cursorline | |
augroup END | |
augroup ShowListChars | |
autocmd! | |
autocmd InsertEnter * set nolist | |
autocmd InsertLeave * set list | |
augroup END | |
augroup cursor_position | |
autocmd! | |
autocmd BufReadPost * | |
\ if line("'\"") > 1 && line("'\"") <= line("$") | | |
\ execute "normal! g`\"" | | |
\ endif | | |
augroup END | |
augroup CenteringReadOnly | |
autocmd! | |
autocmd BufEnter * if !&modifiable | setl scrolloff=999 | endif | |
augroup END | |
autocmd BufRead * try | execute "compiler ".&FileType | catch /./ | endtry | |
" common FileTypes below | |
" any project-specific settings should be included in the .lvimrc file placed | |
" in the root folder of that project | |
" Apache | |
autocmd BufNewFile,BufRead,BufEnter httpd.conf setfiletype apache | |
" C | |
autocmd FileType c set cinoptions=t0,+4,(4,u4,w1 shiftwidth=8 softtabstop=8 | |
autocmd FileType c set keywordprg=man | |
" COBOL | |
autocmd BufNewFile *.cob 0r ~/dotfiles/lang/cobol/header.cob | |
" CSS | |
autocmd FileType css setlocal iskeyword+=.,# | |
" Git commit messages | |
autocmd BufRead,BufNewFile COMMIT_EDITMSG :DiffGitCached | |
" HTML | |
autocmd BufNewFile *.html 0r ~/dotfiles/lang/html/index.html | |
" JavaScript | |
autocmd FileType javascript setlocal iskeyword+=$ | |
" JSON | |
autocmd FileType json setlocal foldmarker={,} foldmethod=marker foldlevelstart=2 | |
" LaTeX | |
autocmd BufNewFile *.tex 0r ~/dotfiles/lang/latex/template.tex | |
" Lisp | |
autocmd FileType lisp,scheme,art setlocal equalprg=~/dotfiles/helpers/scmindent.rkt | |
" Lua | |
autocmd FileType lua setlocal shiftwidth=4 tabstop=4 softtabstop=4 smarttab | |
\ noexpandtab formatoptions=croql | |
" Markdown | |
autocmd BufNewFile,BufRead,BufEnter *.md,*.markdown setfiletype markdown | |
" Mercurial commit messages | |
autocmd BufNewFile,BufRead,BufEnter msg setfiletype hgcommit | |
autocmd FileType hgcommit setlocal textwidth=72 | |
autocmd FileType hgcommit match OverLength /\%73v.\+/ | |
" MySQL | |
autocmd BufNewFile,BufRead,BufEnter *.mysql setfiletype mysql | |
" Perl | |
autocmd FileType perl setlocal makeprg=perl keywordprg=perldoc\ -f | | |
\ compiler perl | |
" PHP | |
autocmd FileType php setlocal keywordprg=pman | | |
\ setlocal iskeyword+=$ | |
" \ setlocal foldmarker={,} foldmethod=marker foldlevelstart=1 | | |
" autocmd BufWritePost *.php silent !phpcbf --standard=WordPress % | |
" PostgreSQL | |
autocmd BufNewFile,BufRead,BufEnter *.psql setfiletype postgresql | |
" Python | |
autocmd FileType python setlocal shiftwidth=4 tabstop=4 softtabstop=4 smarttab | |
\ expandtab formatoptions=croql keywordprg=pydoc | |
" Ruby | |
autocmd BufNewFile,BufRead Vagrantfile setfiletype ruby | |
autocmd FileType ruby setlocal keywordprg=ri | |
" SCSS | |
autocmd FileType scss setlocal iskeyword+=.,# | |
" tmux | |
autocmd BufNewFile,BufRead,BufEnter .tmux.*,.tmux.conf* setfiletype tmux | |
" WordPress | |
autocmd FileType php.wordpress setlocal shiftwidth=4 tabstop=4 softtabstop=4 | |
\ smarttab noexpandtab smartindent textwidth=85 | |
autocmd FileType javascript.wordpress setlocal shiftwidth=4 tabstop=4 | |
\ softtabstop=4 smarttab noexpandtab smartindent textwidth=85 | |
autocmd FileType css.wordpress setlocal shiftwidth=2 tabstop=2 softtabstop=2 | |
\ smarttab noexpandtab smartindent textwidth=85 | |
autocmd FileType scss.wordpress setlocal shiftwidth=2 tabstop=2 softtabstop=2 | |
\ smarttab noexpandtab smartindent textwidth=85 | |
autocmd FileType php.wordpress match OverLength /%86v.\+/ | | |
\ let g:ale_php_phpcs_standard = 'WordPress' | |
autocmd FileType javascript.wordpress match OverLength /%86v.\+/ | |
autocmd FileType css.wordpress match OverLength /%86v.\+/ | |
autocmd FileType scss.wordpress match OverLength /%86v.\+/ | |
" Vim | |
autocmd FileType vim setlocal keywordprg=:Help | |
profile start ~/profile.log | |
profile func * | |
profile file * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SCRIPT /home/vagrant/.config/nvim/plugged/denite.nvim/plugin/denite.vim | |
Sourced 1 time | |
Total time: 0.000082 | |
Self time: 0.000082 | |
count total (s) self (s) | |
"============================================================================= | |
" FILE: denite.vim | |
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com> | |
" License: MIT license | |
"============================================================================= | |
1 0.000009 if exists('g:loaded_denite') | |
finish | |
endif | |
1 0.000004 let g:loaded_denite = 1 | |
1 0.000018 command! -nargs=+ -range -complete=customlist,denite#helper#complete | |
\ Denite | |
\ call denite#helper#call_denite('Denite', | |
\ <q-args>, <line1>, <line2>) | |
1 0.000015 command! -nargs=+ -range -complete=customlist,denite#helper#complete | |
\ DeniteCursorWord | |
\ call denite#helper#call_denite('DeniteCursorWord', | |
\ <q-args>, <line1>, <line2>) | |
1 0.000013 command! -nargs=+ -range -complete=customlist,denite#helper#complete | |
\ DeniteBufferDir | |
\ call denite#helper#call_denite('DeniteBufferDir', | |
\ <q-args>, <line1>, <line2>) | |
1 0.000014 command! -nargs=+ -range -complete=customlist,denite#helper#complete | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/plugin/ale.vim | |
Sourced 1 time | |
Total time: 0.005305 | |
Self time: 0.004014 | |
count total (s) self (s) | |
" Author: w0rp <devw0rp@gmail.com> | |
" Description: Main entry point for the plugin: sets up prefs and autocommands | |
" Preferences can be set in vimrc files and so on to configure ale | |
" Sanity Checks | |
1 0.000012 if exists('g:loaded_ale_dont_use_this_in_other_plugins_please') | |
finish | |
endif | |
" Set a special flag used only by this plugin for preventing doubly | |
" loading the script. | |
1 0.000006 let g:loaded_ale_dont_use_this_in_other_plugins_please = 1 | |
" A flag for detecting if the required features are set. | |
1 0.000006 if has('nvim') | |
1 0.000005 let s:has_features = has('timers') | |
1 0.000001 else | |
" Check if Job and Channel functions are available, instead of the | |
" features. This works better on old MacVim versions. | |
let s:has_features = has('timers') && exists('*job_start') && exists('*ch_close_in') | |
endif | |
1 0.000002 if !s:has_features | |
" Only output a warning if editing some special files. | |
if index(['', 'gitcommit'], &filetype) == -1 | |
echoerr 'ALE requires NeoVim >= 0.1.5 or Vim 8 with +timers +job +channel' | |
echoerr 'Please update your editor appropriately.' | |
endif | |
" Stop here, as it won't work. | |
finish | |
endif | |
" Add the after directory to the runtimepath | |
1 0.000025 let &runtimepath .= ',' . expand('<sfile>:p:h:h') . '/after' | |
" Set this flag so that other plugins can use it, like airline. | |
1 0.000004 let g:loaded_ale = 1 | |
" Set the TMPDIR environment variable if it is not set automatically. | |
" This can automatically fix some environments. | |
1 0.000006 if has('unix') && empty($TMPDIR) | |
let $TMPDIR = '/tmp' | |
endif | |
" This flag can be set to 0 to disable emitting conflict warnings. | |
1 0.000006 let g:ale_emit_conflict_warnings = get(g:, 'ale_emit_conflict_warnings', 1) | |
" This global variable is used internally by ALE for tracking information for | |
" each buffer which linters are being run against. | |
1 0.000005 let g:ale_buffer_info = {} | |
" User Configuration | |
" This option prevents ALE autocmd commands from being run for particular | |
" filetypes which can cause issues. | |
1 0.000007 let g:ale_filetype_blacklist = [ | |
\ 'dirvish', | |
\ 'nerdtree', | |
\ 'qf', | |
\ 'tags', | |
\ 'unite', | |
\] | |
" This Dictionary configures which linters are enabled for which languages. | |
1 0.000006 let g:ale_linters = get(g:, 'ale_linters', {}) | |
" This Dictionary configures which functions will be used for fixing problems. | |
1 0.000004 let g:ale_fixers = get(g:, 'ale_fixers', {}) | |
" This Dictionary allows users to set up filetype aliases for new filetypes. | |
1 0.000006 let g:ale_linter_aliases = get(g:, 'ale_linter_aliases', {}) | |
" This flag can be set with a number of milliseconds for delaying the | |
" execution of a linter when text is changed. The timeout will be set and | |
" cleared each time text is changed, so repeated edits won't trigger the | |
" jobs for linting until enough time has passed after editing is done. | |
1 0.000004 let g:ale_lint_delay = get(g:, 'ale_lint_delay', 200) | |
" This flag can be set to 'never' to disable linting when text is changed. | |
" This flag can also be set to 'insert' or 'normal' to lint when text is | |
" changed only in insert or normal mode respectively. | |
1 0.000103 let g:ale_lint_on_text_changed = get(g:, 'ale_lint_on_text_changed', 'always') | |
" This flag can be set to 1 to enable linting when leaving insert mode. | |
1 0.000006 let g:ale_lint_on_insert_leave = get(g:, 'ale_lint_on_insert_leave', 0) | |
" This flag can be set to 0 to disable linting when the buffer is entered. | |
1 0.000004 let g:ale_lint_on_enter = get(g:, 'ale_lint_on_enter', 1) | |
" This flag can be set to 1 to enable linting when a buffer is written. | |
1 0.000004 let g:ale_lint_on_save = get(g:, 'ale_lint_on_save', 1) | |
" This flag can be set to 1 to enable linting when the filetype is changed. | |
1 0.000004 let g:ale_lint_on_filetype_changed = get(g:, 'ale_lint_on_filetype_changed', 1) | |
1 0.002156 call ale#Set('fix_on_save', 0) | |
" This flag may be set to 0 to disable ale. After ale is loaded, :ALEToggle | |
" should be used instead. | |
1 0.000005 let g:ale_enabled = get(g:, 'ale_enabled', 1) | |
" These flags dictates if ale uses the quickfix or the loclist (loclist is the | |
" default, quickfix overrides loclist). | |
1 0.000004 let g:ale_set_loclist = get(g:, 'ale_set_loclist', 1) | |
1 0.000004 let g:ale_set_quickfix = get(g:, 'ale_set_quickfix', 0) | |
" This flag dictates if ale open the configured loclist | |
1 0.000004 let g:ale_open_list = get(g:, 'ale_open_list', 0) | |
" This flag dictates if ale keeps open loclist even if there is no error in loclist | |
1 0.000005 let g:ale_keep_list_window_open = get(g:, 'ale_keep_list_window_open', 0) | |
" The window size to set for the quickfix and loclist windows | |
1 0.000102 0.000082 call ale#Set('list_window_size', 10) | |
" This flag can be set to 0 to disable setting signs. | |
" This is enabled by default only if the 'signs' feature exists. | |
1 0.000012 let g:ale_set_signs = get(g:, 'ale_set_signs', has('signs')) | |
" This flag can be set to some integer to control the maximum number of signs | |
" that ALE will set. | |
1 0.000004 let g:ale_max_signs = get(g:, 'ale_max_signs', -1) | |
" This flag can be set to 1 to enable changing the sign column colors when | |
" there are errors. | |
1 0.000021 0.000006 call ale#Set('change_sign_column_color', 0) | |
" This flag can be set to 0 to disable setting error highlights. | |
1 0.000104 let g:ale_set_highlights = get(g:, 'ale_set_highlights', has('syntax')) | |
" These variables dictate what sign is used to indicate errors and warnings. | |
1 0.000028 0.000009 call ale#Set('sign_error', '>>') | |
1 0.000022 0.000007 call ale#Set('sign_style_error', g:ale_sign_error) | |
1 0.000099 0.000082 call ale#Set('sign_warning', '--') | |
1 0.000023 0.000009 call ale#Set('sign_style_warning', g:ale_sign_warning) | |
1 0.000018 0.000005 call ale#Set('sign_info', g:ale_sign_warning) | |
" This variable sets an offset which can be set for sign IDs. | |
" This ID can be changed depending on what IDs are set for other plugins. | |
" The dummy sign will use the ID exactly equal to the offset. | |
1 0.000005 let g:ale_sign_offset = get(g:, 'ale_sign_offset', 1000000) | |
" This flag can be set to 1 to keep sign gutter always open | |
1 0.000004 let g:ale_sign_column_always = get(g:, 'ale_sign_column_always', 0) | |
" String format for the echoed message | |
" A %s is mandatory | |
" It can contain 2 handlers: %linter%, %severity% | |
1 0.000005 let g:ale_echo_msg_format = get(g:, 'ale_echo_msg_format', '%s') | |
" Strings used for severity in the echoed message | |
1 0.000005 let g:ale_echo_msg_error_str = get(g:, 'ale_echo_msg_error_str', 'Error') | |
1 0.000069 let g:ale_echo_msg_warning_str = get(g:, 'ale_echo_msg_warning_str', 'Warning') | |
" This flag can be set to 0 to disable echoing when the cursor moves. | |
1 0.000005 let g:ale_echo_cursor = get(g:, 'ale_echo_cursor', 1) | |
" Controls the milliseconds delay before echoing a message. | |
1 0.000004 let g:ale_echo_delay = get(g:, 'ale_echo_delay', 10) | |
" This flag can be set to 0 to disable balloon support. | |
1 0.000038 0.000010 call ale#Set('set_balloons', has('balloon_eval')) | |
" A deprecated setting for ale#statusline#Status() | |
" See :help ale#statusline#Count() for getting status reports. | |
1 0.000008 let g:ale_statusline_format = get(g:, 'ale_statusline_format', | |
\ ['%d error(s)', '%d warning(s)', 'OK'] | |
\) | |
" This flag can be set to 0 to disable warnings for trailing whitespace | |
1 0.000006 let g:ale_warn_about_trailing_whitespace = | |
\ get(g:, 'ale_warn_about_trailing_whitespace', 1) | |
" A flag for controlling the maximum size of the command history to store. | |
1 0.000005 let g:ale_max_buffer_history_size = get(g:, 'ale_max_buffer_history_size', 20) | |
" A flag for enabling or disabling the command history. | |
1 0.000004 let g:ale_history_enabled = get(g:, 'ale_history_enabled', 1) | |
" A flag for storing the full output of commands in the history. | |
1 0.000004 let g:ale_history_log_output = get(g:, 'ale_history_log_output', 1) | |
" A dictionary mapping regular expression patterns to arbitrary buffer | |
" variables to be set. Useful for configuration ALE based on filename | |
" patterns. | |
1 0.000106 0.000006 call ale#Set('pattern_options', {}) | |
1 0.000022 0.000009 call ale#Set('pattern_options_enabled', !empty(g:ale_pattern_options)) | |
" A maximum file size for checking for errors. | |
1 0.000017 0.000005 call ale#Set('maximum_file_size', 0) | |
" Remapping of linter problems. | |
1 0.000077 0.000062 call ale#Set('type_map', {}) | |
" Enable automatic completion with LSP servers and tsserver | |
1 0.000016 0.000005 call ale#Set('completion_enabled', 0) | |
1 0.000062 0.000004 call ale#Set('completion_delay', 100) | |
1 0.000018 0.000006 call ale#Set('completion_max_suggestions', 50) | |
1 0.000003 function! ALEInitAuGroups() abort | |
" This value used to be a Boolean as a Number, and is now a String. | |
let l:text_changed = '' . g:ale_lint_on_text_changed | |
augroup ALEPatternOptionsGroup | |
autocmd! | |
if g:ale_enabled && g:ale_pattern_options_enabled | |
autocmd BufEnter,BufRead * call ale#pattern_options#SetOptions() | |
endif | |
augroup END | |
augroup ALERunOnTextChangedGroup | |
autocmd! | |
if g:ale_enabled | |
if l:text_changed is? 'always' || l:text_changed is# '1' | |
autocmd TextChanged,TextChangedI * call ale#Queue(g:ale_lint_delay) | |
elseif l:text_changed is? 'normal' | |
autocmd TextChanged * call ale#Queue(g:ale_lint_delay) | |
elseif l:text_changed is? 'insert' | |
autocmd TextChangedI * call ale#Queue(g:ale_lint_delay) | |
endif | |
endif | |
augroup END | |
augroup ALERunOnEnterGroup | |
autocmd! | |
if g:ale_enabled | |
" Handle everything that needs to happen when buffers are entered. | |
autocmd BufEnter * call ale#events#EnterEvent(str2nr(expand('<abuf>'))) | |
endif | |
if g:ale_enabled && g:ale_lint_on_enter | |
autocmd BufWinEnter,BufRead * call ale#Queue(0, 'lint_file', str2nr(expand('<abuf>'))) | |
" Track when the file is changed outside of Vim. | |
autocmd FileChangedShellPost * call ale#events#FileChangedEvent(str2nr(expand('<abuf>'))) | |
endif | |
augroup END | |
augroup ALERunOnFiletypeChangeGroup | |
autocmd! | |
if g:ale_enabled && g:ale_lint_on_filetype_changed | |
" Only start linting if the FileType actually changes after | |
" opening a buffer. The FileType will fire when buffers are opened. | |
autocmd FileType * call ale#events#FileTypeEvent( | |
\ str2nr(expand('<abuf>')), | |
\ expand('<amatch>') | |
\) | |
endif | |
augroup END | |
augroup ALERunOnSaveGroup | |
autocmd! | |
if (g:ale_enabled && g:ale_lint_on_save) || g:ale_fix_on_save | |
autocmd BufWritePost * call ale#events#SaveEvent(str2nr(expand('<abuf>'))) | |
endif | |
augroup END | |
augroup ALERunOnInsertLeave | |
autocmd! | |
if g:ale_enabled && g:ale_lint_on_insert_leave | |
autocmd InsertLeave * call ale#Queue(0) | |
endif | |
augroup END | |
augroup ALECursorGroup | |
autocmd! | |
if g:ale_enabled && g:ale_echo_cursor | |
autocmd CursorMoved,CursorHold * call ale#cursor#EchoCursorWarningWithDelay() | |
" Look for a warning to echo as soon as we leave Insert mode. | |
" The script's position variable used when moving the cursor will | |
" not be changed here. | |
autocmd InsertLeave * call ale#cursor#EchoCursorWarning() | |
endif | |
augroup END | |
if !g:ale_enabled | |
if !g:ale_fix_on_save | |
augroup! ALERunOnSaveGroup | |
endif | |
augroup! ALEPatternOptionsGroup | |
augroup! ALERunOnTextChangedGroup | |
augroup! ALERunOnEnterGroup | |
augroup! ALERunOnInsertLeave | |
augroup! ALECursorGroup | |
endif | |
endfunction | |
1 0.000006 function! s:ALEToggle() abort | |
let g:ale_enabled = !get(g:, 'ale_enabled') | |
if g:ale_enabled | |
" Set pattern options again, if enabled. | |
if g:ale_pattern_options_enabled | |
call ale#pattern_options#SetOptions() | |
endif | |
" Lint immediately, including running linters against the file. | |
call ale#Queue(0, 'lint_file') | |
if g:ale_set_balloons | |
call ale#balloon#Enable() | |
endif | |
else | |
for l:key in keys(g:ale_buffer_info) | |
" The key could be a filename or a buffer number, so try and | |
" convert it to a number. We need a number for the other | |
" functions. | |
let l:buffer = str2nr(l:key) | |
if l:buffer > 0 | |
" Stop all jobs and clear the results for everything, and delete | |
" all of the data we stored for the buffer. | |
call ale#engine#Cleanup(l:buffer) | |
endif | |
endfor | |
" Remove highlights for the current buffer now. | |
if g:ale_set_highlights | |
call ale#highlight#UpdateHighlights() | |
endif | |
if g:ale_set_balloons | |
call ale#balloon#Disable() | |
endif | |
endif | |
call ALEInitAuGroups() | |
endfunction | |
1 0.000414 0.000013 call ALEInitAuGroups() | |
1 0.000002 if g:ale_set_balloons | |
call ale#balloon#Enable() | |
endif | |
1 0.000002 if g:ale_completion_enabled | |
call ale#completion#Enable() | |
endif | |
" Define commands for moving through warnings and errors. | |
1 0.000014 command! -bar ALEPrevious :call ale#loclist_jumping#Jump('before', 0) | |
1 0.000038 command! -bar ALEPreviousWrap :call ale#loclist_jumping#Jump('before', 1) | |
1 0.000007 command! -bar ALENext :call ale#loclist_jumping#Jump('after', 0) | |
1 0.000005 command! -bar ALENextWrap :call ale#loclist_jumping#Jump('after', 1) | |
1 0.000006 command! -bar ALEFirst :call ale#loclist_jumping#JumpToIndex(0) | |
1 0.000048 command! -bar ALELast :call ale#loclist_jumping#JumpToIndex(-1) | |
" A command for showing error details. | |
1 0.000005 command! -bar ALEDetail :call ale#cursor#ShowCursorDetail() | |
" Define commands for turning ALE on or off. | |
1 0.000004 command! -bar ALEToggle :call s:ALEToggle() | |
1 0.000006 command! -bar ALEEnable :if !g:ale_enabled | ALEToggle | endif | |
1 0.000005 command! -bar ALEDisable :if g:ale_enabled | ALEToggle | endif | |
" A command for linting manually. | |
1 0.000005 command! -bar ALELint :call ale#Queue(0, 'lint_file') | |
" Define a command to get information about current filetype. | |
1 0.000005 command! -bar ALEInfo :call ale#debugging#Info() | |
" The same, but copy output to your clipboard. | |
1 0.000005 command! -bar ALEInfoToClipboard :call ale#debugging#InfoToClipboard() | |
" Fix problems in files. | |
1 0.000004 command! -bar ALEFix :call ale#fix#Fix() | |
" Suggest registered functions to use for fixing problems. | |
1 0.000006 command! -bar ALEFixSuggest :call ale#fix#registry#Suggest(&filetype) | |
" <Plug> mappings for commands | |
1 0.000118 nnoremap <silent> <Plug>(ale_previous) :ALEPrevious<Return> | |
1 0.000012 nnoremap <silent> <Plug>(ale_previous_wrap) :ALEPreviousWrap<Return> | |
1 0.000008 nnoremap <silent> <Plug>(ale_next) :ALENext<Return> | |
1 0.000008 nnoremap <silent> <Plug>(ale_next_wrap) :ALENextWrap<Return> | |
1 0.000007 nnoremap <silent> <Plug>(ale_first) :ALEFirst<Return> | |
1 0.000006 nnoremap <silent> <Plug>(ale_last) :ALELast<Return> | |
1 0.000007 nnoremap <silent> <Plug>(ale_toggle) :ALEToggle<Return> | |
1 0.000007 nnoremap <silent> <Plug>(ale_lint) :ALELint<Return> | |
1 0.000007 nnoremap <silent> <Plug>(ale_detail) :ALEDetail<Return> | |
1 0.000007 nnoremap <silent> <Plug>(ale_fix) :ALEFix<Return> | |
" Housekeeping | |
1 0.000104 augroup ALECleanupGroup | |
1 0.000022 autocmd! | |
" Clean up buffers automatically when they are unloaded. | |
1 0.000008 autocmd BufUnload * call ale#engine#Cleanup(str2nr(expand('<abuf>'))) | |
1 0.000002 augroup END | |
" Backwards Compatibility | |
1 0.000004 function! ALELint(delay) abort | |
call ale#Queue(a:delay) | |
endfunction | |
1 0.000002 function! ALEGetStatusLine() abort | |
return ale#statusline#Status() | |
endfunction | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale.vim | |
Sourced 1 time | |
Total time: 0.000488 | |
Self time: 0.000488 | |
count total (s) self (s) | |
" Author: w0rp <devw0rp@gmail.com>, David Alexander <opensource@thelonelyghost.com> | |
" Description: Primary code path for the plugin | |
" Manages execution of linters when requested by autocommands | |
1 0.000009 let s:lint_timer = -1 | |
1 0.000003 let s:queued_buffer_number = -1 | |
1 0.000003 let s:should_lint_file_for_buffer = {} | |
1 0.000004 let s:error_delay_ms = 1000 * 60 * 2 | |
1 0.000003 let s:timestamp_map = {} | |
" Given a key for a script variable for tracking the time to wait until | |
" a given function should be called, a funcref for a function to call, and | |
" a List of arguments, call the function and return whatever value it returns. | |
" | |
" If the function throws an exception, then the function will not be called | |
" for a while, and 0 will be returned instead. | |
1 0.000006 function! ale#CallWithCooldown(timestamp_key, func, arglist) abort | |
let l:now = ale#util#ClockMilliseconds() | |
if l:now < get(s:timestamp_map, a:timestamp_key, -1) | |
return 0 | |
endif | |
let s:timestamp_map[a:timestamp_key] = l:now + s:error_delay_ms | |
let l:return_value = call(a:func, a:arglist) | |
let s:timestamp_map[a:timestamp_key] = -1 | |
return l:return_value | |
endfunction | |
" Return 1 if a file is too large for ALE to handle. | |
1 0.000005 function! ale#FileTooLarge() abort | |
let l:max = ale#Var(bufnr(''), 'maximum_file_size') | |
return l:max > 0 ? (line2byte(line('$') + 1) > l:max) : 0 | |
endfunction | |
" A function for checking various conditions whereby ALE just shouldn't | |
" attempt to do anything, say if particular buffer types are open in Vim. | |
1 0.000004 function! ale#ShouldDoNothing(buffer) abort | |
" Do nothing for blacklisted files | |
" OR if ALE is running in the sandbox | |
return index(g:ale_filetype_blacklist, &filetype) >= 0 | |
\ || (exists('*getcmdwintype') && !empty(getcmdwintype())) | |
\ || ale#util#InSandbox() | |
\ || !ale#Var(a:buffer, 'enabled') | |
\ || ale#FileTooLarge() | |
\ || getbufvar(a:buffer, '&l:statusline') =~# 'CtrlPMode.*funky' | |
endfunction | |
" (delay, [linting_flag, buffer_number]) | |
1 0.000003 function! ale#Queue(delay, ...) abort | |
if a:0 > 2 | |
throw 'too many arguments!' | |
endif | |
" Default linting_flag to '' | |
let l:linting_flag = get(a:000, 0, '') | |
let l:buffer = get(a:000, 1, bufnr('')) | |
return ale#CallWithCooldown( | |
\ 'dont_queue_until', | |
\ function('s:ALEQueueImpl'), | |
\ [a:delay, l:linting_flag, l:buffer], | |
\) | |
endfunction | |
1 0.000006 function! s:ALEQueueImpl(delay, linting_flag, buffer) abort | |
if a:linting_flag isnot# '' && a:linting_flag isnot# 'lint_file' | |
throw "linting_flag must be either '' or 'lint_file'" | |
endif | |
if type(a:buffer) != type(0) | |
throw 'buffer_number must be a Number' | |
endif | |
if ale#ShouldDoNothing(a:buffer) | |
return | |
endif | |
" Remember that we want to check files for this buffer. | |
" We will remember this until we finally run the linters, via any event. | |
if a:linting_flag is# 'lint_file' | |
let s:should_lint_file_for_buffer[bufnr('%')] = 1 | |
endif | |
if s:lint_timer != -1 | |
call timer_stop(s:lint_timer) | |
let s:lint_timer = -1 | |
endif | |
let l:linters = ale#linter#Get(getbufvar(a:buffer, '&filetype')) | |
" Don't set up buffer data and so on if there are no linters to run. | |
if empty(l:linters) | |
" If we have some previous buffer data, then stop any jobs currently | |
" running and clear everything. | |
if has_key(g:ale_buffer_info, a:buffer) | |
call ale#engine#RunLinters(a:buffer, [], 1) | |
endif | |
return | |
endif | |
if a:delay > 0 | |
let s:queued_buffer_number = a:buffer | |
let s:lint_timer = timer_start(a:delay, function('ale#Lint')) | |
else | |
call ale#Lint(-1, a:buffer) | |
endif | |
endfunction | |
1 0.000004 function! ale#Lint(...) abort | |
if a:0 > 1 | |
" Use the buffer number given as the optional second argument. | |
let l:buffer = a:2 | |
elseif a:0 > 0 && a:1 == s:lint_timer | |
" Use the buffer number for the buffer linting was queued for. | |
let l:buffer = s:queued_buffer_number | |
else | |
" Use the current buffer number. | |
let l:buffer = bufnr('') | |
endif | |
return ale#CallWithCooldown( | |
\ 'dont_lint_until', | |
\ function('s:ALELintImpl'), | |
\ [l:buffer], | |
\) | |
endfunction | |
1 0.000004 function! s:ALELintImpl(buffer) abort | |
if ale#ShouldDoNothing(a:buffer) | |
return | |
endif | |
" Use the filetype from the buffer | |
let l:linters = ale#linter#Get(getbufvar(a:buffer, '&filetype')) | |
let l:should_lint_file = 0 | |
" Check if we previously requested checking the file. | |
if has_key(s:should_lint_file_for_buffer, a:buffer) | |
unlet s:should_lint_file_for_buffer[a:buffer] | |
" Lint files if they exist. | |
let l:should_lint_file = filereadable(expand('#' . a:buffer . ':p')) | |
endif | |
call ale#engine#RunLinters(a:buffer, l:linters, l:should_lint_file) | |
endfunction | |
" Reset flags indicating that files should be checked for all buffers. | |
1 0.000003 function! ale#ResetLintFileMarkers() abort | |
let s:should_lint_file_for_buffer = {} | |
endfunction | |
1 0.000003 function! ale#ResetErrorDelays() abort | |
let s:timestamp_map = {} | |
endfunction | |
1 0.000009 let g:ale_has_override = get(g:, 'ale_has_override', {}) | |
" Call has(), but check a global Dictionary so we can force flags on or off | |
" for testing purposes. | |
1 0.000003 function! ale#Has(feature) abort | |
return get(g:ale_has_override, a:feature, has(a:feature)) | |
endfunction | |
" Given a buffer number and a variable name, look for that variable in the | |
" buffer scope, then in global scope. If the name does not exist in the global | |
" scope, an exception will be thrown. | |
" | |
" Every variable name will be prefixed with 'ale_'. | |
1 0.000003 function! ale#Var(buffer, variable_name) abort | |
let l:nr = str2nr(a:buffer) | |
let l:full_name = 'ale_' . a:variable_name | |
if bufexists(l:nr) | |
let l:vars = getbufvar(l:nr, '') | |
elseif has_key(g:, 'ale_fix_buffer_data') | |
let l:vars = get(g:ale_fix_buffer_data, l:nr, {'vars': {}}).vars | |
else | |
let l:vars = {} | |
endif | |
return get(l:vars, l:full_name, g:[l:full_name]) | |
endfunction | |
" Initialize a variable with a default value, if it isn't already set. | |
" | |
" Every variable name will be prefixed with 'ale_'. | |
1 0.000003 function! ale#Set(variable_name, default) abort | |
let l:full_name = 'ale_' . a:variable_name | |
let l:value = get(g:, l:full_name, a:default) | |
let g:[l:full_name] = l:value | |
return l:value | |
endfunction | |
" Escape a string suitably for each platform. | |
" shellescape does not work on Windows. | |
1 0.000005 function! ale#Escape(str) abort | |
if fnamemodify(&shell, ':t') is? 'cmd.exe' | |
" If the string contains spaces, it will be surrounded by quotes. | |
" Otherwise, special characters will be escaped with carets (^). | |
return substitute( | |
\ a:str =~# ' ' | |
\ ? '"' . substitute(a:str, '"', '""', 'g') . '"' | |
\ : substitute(a:str, '\v([&|<>^])', '^\1', 'g'), | |
\ '%', | |
\ '%%', | |
\ 'g', | |
\) | |
endif | |
return shellescape (a:str) | |
endfunction | |
SCRIPT /usr/share/nvim/runtime/plugin/gui_shim.vim | |
Sourced 1 time | |
Total time: 0.000025 | |
Self time: 0.000025 | |
count total (s) self (s) | |
" A Neovim plugin that implements GUI helper commands | |
1 0.000017 if !has('win32') || !has('nvim') || exists('g:GuiLoaded') | |
1 0.000002 finish | |
SCRIPT /usr/share/nvim/runtime/plugin/gzip.vim | |
Sourced 1 time | |
Total time: 0.000438 | |
Self time: 0.000438 | |
count total (s) self (s) | |
" Vim plugin for editing compressed files. | |
" Maintainer: Bram Moolenaar <Bram@vim.org> | |
" Last Change: 2016 Oct 30 | |
" Exit quickly when: | |
" - this plugin was already loaded | |
" - when 'compatible' is set | |
" - some autocommands are already taking care of compressed files | |
1 0.000025 if exists("loaded_gzip") || &cp || exists("#BufReadPre#*.gz") | |
finish | |
endif | |
1 0.000005 let loaded_gzip = 1 | |
1 0.000003 augroup gzip | |
" Remove all gzip autocommands | |
1 0.000072 au! | |
" Enable editing of gzipped files. | |
" The functions are defined in autoload/gzip.vim. | |
" | |
" Set binary mode before reading the file. | |
" Use "gzip -d", gunzip isn't always available. | |
1 0.000036 autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z,*.lzma,*.xz,*.lz,*.zst setlocal bin | |
1 0.000012 autocmd BufReadPost,FileReadPost *.gz call gzip#read("gzip -dn") | |
1 0.000012 autocmd BufReadPost,FileReadPost *.bz2 call gzip#read("bzip2 -d") | |
1 0.000012 autocmd BufReadPost,FileReadPost *.Z call gzip#read("uncompress") | |
1 0.000024 autocmd BufReadPost,FileReadPost *.lzma call gzip#read("lzma -d") | |
1 0.000011 autocmd BufReadPost,FileReadPost *.xz call gzip#read("xz -d") | |
1 0.000049 autocmd BufReadPost,FileReadPost *.lz call gzip#read("lzip -d") | |
1 0.000016 autocmd BufReadPost,FileReadPost *.zst call gzip#read("zstd -d --rm") | |
1 0.000006 autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip") | |
1 0.000006 autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2") | |
1 0.000005 autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f") | |
1 0.000006 autocmd BufWritePost,FileWritePost *.lzma call gzip#write("lzma -z") | |
1 0.000005 autocmd BufWritePost,FileWritePost *.xz call gzip#write("xz -z") | |
1 0.000005 autocmd BufWritePost,FileWritePost *.lz call gzip#write("lzip") | |
1 0.000005 autocmd BufWritePost,FileWritePost *.zst call gzip#write("zstd --rm") | |
1 0.000004 autocmd FileAppendPre *.gz call gzip#appre("gzip -dn") | |
1 0.000003 autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d") | |
1 0.000003 autocmd FileAppendPre *.Z call gzip#appre("uncompress") | |
1 0.000004 autocmd FileAppendPre *.lzma call gzip#appre("lzma -d") | |
1 0.000004 autocmd FileAppendPre *.xz call gzip#appre("xz -d") | |
1 0.000007 autocmd FileAppendPre *.lz call gzip#appre("lzip -d") | |
1 0.000004 autocmd FileAppendPre *.zst call gzip#appre("zstd -d --rm") | |
1 0.000003 autocmd FileAppendPost *.gz call gzip#write("gzip") | |
1 0.000003 autocmd FileAppendPost *.bz2 call gzip#write("bzip2") | |
1 0.000044 autocmd FileAppendPost *.Z call gzip#write("compress -f") | |
1 0.000006 autocmd FileAppendPost *.lzma call gzip#write("lzma -z") | |
1 0.000004 autocmd FileAppendPost *.xz call gzip#write("xz -z") | |
1 0.000003 autocmd FileAppendPost *.lz call gzip#write("lzip") | |
1 0.000004 autocmd FileAppendPost *.zst call gzip#write("zstd --rm") | |
1 0.000005 augroup END | |
SCRIPT /usr/share/nvim/runtime/plugin/health.vim | |
Sourced 1 time | |
Total time: 0.000041 | |
Self time: 0.000041 | |
count total (s) self (s) | |
function! s:complete(lead, _line, _pos) abort | |
return sort(filter(map(globpath(&runtimepath, 'autoload/health/*', 1, 1), | |
\ 'fnamemodify(v:val, ":t:r")'), | |
\ 'empty(a:lead) || v:val[:strlen(a:lead)-1] ==# a:lead')) | |
endfunction | |
1 0.000016 command! -nargs=* -complete=customlist,s:complete CheckHealth | |
SCRIPT /usr/share/nvim/runtime/plugin/man.vim | |
Sourced 1 time | |
Total time: 0.000166 | |
Self time: 0.000166 | |
count total (s) self (s) | |
" Maintainer: Anmol Sethi <anmol@aubble.com> | |
1 0.000016 if exists('g:loaded_man') | |
finish | |
endif | |
1 0.000005 let g:loaded_man = 1 | |
1 0.000019 command! -range=0 -complete=customlist,man#complete -nargs=* Man call man#open_page(v:count, v:count1, <q-mods>, <f-args>) | |
1 0.000004 augroup man | |
1 0.000029 autocmd! | |
1 0.000014 autocmd BufReadCmd man://* call man#read_page(matchstr(expand('<amatch>'), 'man://\zs.*')) | |
1 0.000005 augroup END | |
SCRIPT /usr/share/nvim/runtime/plugin/matchit.vim | |
Sourced 1 time | |
Total time: 0.001567 | |
Self time: 0.001567 | |
count total (s) self (s) | |
" matchit.vim: (global plugin) Extended "%" matching | |
" Last Change: 2016 Aug 21 | |
" Maintainer: Benji Fisher PhD <benji@member.AMS.org> | |
" Version: 1.13.2, for Vim 6.3+ | |
" Fix from Tommy Allen included. | |
" Fix from Fernando Torres included. | |
" Improvement from Ken Takata included. | |
" URL: http://www.vim.org/script.php?script_id=39 | |
" Documentation: | |
" The documentation is in a separate file, matchit.txt . | |
" Credits: | |
" Vim editor by Bram Moolenaar (Thanks, Bram!) | |
" Original script and design by Raul Segura Acevedo | |
" Support for comments by Douglas Potts | |
" Support for back references and other improvements by Benji Fisher | |
" Support for many languages by Johannes Zellner | |
" Suggestions for improvement, bug reports, and support for additional | |
" languages by Jordi-Albert Batalla, Neil Bird, Servatius Brandt, Mark | |
" Collett, Stephen Wall, Dany St-Amant, Yuheng Xie, and Johannes Zellner. | |
" Debugging: | |
" If you'd like to try the built-in debugging commands... | |
" :MatchDebug to activate debugging for the current buffer | |
" This saves the values of several key script variables as buffer-local | |
" variables. See the MatchDebug() function, below, for details. | |
" TODO: I should think about multi-line patterns for b:match_words. | |
" This would require an option: how many lines to scan (default 1). | |
" This would be useful for Python, maybe also for *ML. | |
" TODO: Maybe I should add a menu so that people will actually use some of | |
" the features that I have implemented. | |
" TODO: Eliminate the MultiMatch function. Add yet another argument to | |
" Match_wrapper() instead. | |
" TODO: Allow :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1' | |
" TODO: Make backrefs safer by using '\V' (very no-magic). | |
" TODO: Add a level of indirection, so that custom % scripts can use my | |
" work but extend it. | |
" allow user to prevent loading | |
" and prevent duplicate loading | |
1 0.000039 if exists("loaded_matchit") || &cp | |
finish | |
endif | |
1 0.000064 let loaded_matchit = 1 | |
1 0.000006 let s:last_mps = "" | |
1 0.000003 let s:last_words = ":" | |
1 0.000002 let s:patBR = "" | |
1 0.000009 let s:save_cpo = &cpo | |
1 0.000011 set cpo&vim | |
1 0.000038 nnoremap <silent> % :<C-U>call <SID>Match_wrapper('',1,'n') <CR> | |
1 0.000067 nnoremap <silent> g% :<C-U>call <SID>Match_wrapper('',0,'n') <CR> | |
1 0.000016 vnoremap <silent> % :<C-U>call <SID>Match_wrapper('',1,'v') <CR>m'gv`` | |
1 0.000009 vnoremap <silent> g% :<C-U>call <SID>Match_wrapper('',0,'v') <CR>m'gv`` | |
1 0.000008 onoremap <silent> % v:<C-U>call <SID>Match_wrapper('',1,'o') <CR> | |
1 0.000007 onoremap <silent> g% v:<C-U>call <SID>Match_wrapper('',0,'o') <CR> | |
" Analogues of [{ and ]} using matching patterns: | |
1 0.000008 nnoremap <silent> [% :<C-U>call <SID>MultiMatch("bW", "n") <CR> | |
1 0.000007 nnoremap <silent> ]% :<C-U>call <SID>MultiMatch("W", "n") <CR> | |
1 0.000005 vmap [% <Esc>[%m'gv`` | |
1 0.000004 vmap ]% <Esc>]%m'gv`` | |
" vnoremap <silent> [% :<C-U>call <SID>MultiMatch("bW", "v") <CR>m'gv`` | |
" vnoremap <silent> ]% :<C-U>call <SID>MultiMatch("W", "v") <CR>m'gv`` | |
1 0.000007 onoremap <silent> [% v:<C-U>call <SID>MultiMatch("bW", "o") <CR> | |
1 0.000006 onoremap <silent> ]% v:<C-U>call <SID>MultiMatch("W", "o") <CR> | |
" text object: | |
1 0.000087 vmap a% <Esc>[%v]% | |
" Auto-complete mappings: (not yet "ready for prime time") | |
" TODO Read :help write-plugin for the "right" way to let the user | |
" specify a key binding. | |
" let g:match_auto = '<C-]>' | |
" let g:match_autoCR = '<C-CR>' | |
" if exists("g:match_auto") | |
" execute "inoremap " . g:match_auto . ' x<Esc>"=<SID>Autocomplete()<CR>Pls' | |
" endif | |
" if exists("g:match_autoCR") | |
" execute "inoremap " . g:match_autoCR . ' <CR><C-R>=<SID>Autocomplete()<CR>' | |
" endif | |
" if exists("g:match_gthhoh") | |
" execute "inoremap " . g:match_gthhoh . ' <C-O>:call <SID>Gthhoh()<CR>' | |
" endif " gthhoh = "Get the heck out of here!" | |
1 0.000006 let s:notslash = '\\\@<!\%(\\\\\)*' | |
1 0.000006 function! s:Match_wrapper(word, forward, mode) range | |
" In s:CleanUp(), :execute "set" restore_options . | |
let restore_options = (&ic ? " " : " no") . "ignorecase" | |
if exists("b:match_ignorecase") | |
let &ignorecase = b:match_ignorecase | |
endif | |
let restore_options = " ve=" . &ve . restore_options | |
set ve= | |
" If this function was called from Visual mode, make sure that the cursor | |
" is at the correct end of the Visual range: | |
if a:mode == "v" | |
execute "normal! gv\<Esc>" | |
endif | |
" In s:CleanUp(), we may need to check whether the cursor moved forward. | |
let startline = line(".") | |
let startcol = col(".") | |
" Use default behavior if called with a count. | |
if v:count | |
exe "normal! " . v:count . "%" | |
return s:CleanUp(restore_options, a:mode, startline, startcol) | |
end | |
" First step: if not already done, set the script variables | |
" s:do_BR flag for whether there are backrefs | |
" s:pat parsed version of b:match_words | |
" s:all regexp based on s:pat and the default groups | |
" | |
if !exists("b:match_words") || b:match_words == "" | |
let match_words = "" | |
" Allow b:match_words = "GetVimMatchWords()" . | |
elseif b:match_words =~ ":" | |
let match_words = b:match_words | |
else | |
execute "let match_words =" b:match_words | |
endif | |
" Thanks to Preben "Peppe" Guldberg and Bram Moolenaar for this suggestion! | |
if (match_words != s:last_words) || (&mps != s:last_mps) | |
\ || exists("b:match_debug") | |
let s:last_mps = &mps | |
" The next several lines were here before | |
" BF started messing with this script. | |
" quote the special chars in 'matchpairs', replace [,:] with \| and then | |
" append the builtin pairs (/*, */, #if, #ifdef, #else, #elif, #endif) | |
" let default = substitute(escape(&mps, '[$^.*~\\/?]'), '[,:]\+', | |
" \ '\\|', 'g').'\|\/\*\|\*\/\|#if\>\|#ifdef\>\|#else\>\|#elif\>\|#endif\>' | |
let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") . | |
\ '\/\*:\*\/,#\s*if\%(def\)\=:#\s*else\>:#\s*elif\>:#\s*endif\>' | |
" s:all = pattern with all the keywords | |
let match_words = match_words . (strlen(match_words) ? "," : "") . default | |
let s:last_words = match_words | |
if match_words !~ s:notslash . '\\\d' | |
let s:do_BR = 0 | |
let s:pat = match_words | |
else | |
let s:do_BR = 1 | |
let s:pat = s:ParseWords(match_words) | |
endif | |
let s:all = substitute(s:pat, s:notslash . '\zs[,:]\+', '\\|', 'g') | |
let s:all = '\%(' . s:all . '\)' | |
" let s:all = '\%(' . substitute(s:all, '\\\ze[,:]', '', 'g') . '\)' | |
if exists("b:match_debug") | |
let b:match_pat = s:pat | |
endif | |
" Reconstruct the version with unresolved backrefs. | |
let s:patBR = substitute(match_words.',', | |
\ s:notslash.'\zs[,:]*,[,:]*', ',', 'g') | |
let s:patBR = substitute(s:patBR, s:notslash.'\zs:\{2,}', ':', 'g') | |
endif | |
" Second step: set the following local variables: | |
" matchline = line on which the cursor started | |
" curcol = number of characters before match | |
" prefix = regexp for start of line to start of match | |
" suffix = regexp for end of match to end of line | |
" Require match to end on or after the cursor and prefer it to | |
" start on or before the cursor. | |
let matchline = getline(startline) | |
if a:word != '' | |
" word given | |
if a:word !~ s:all | |
echohl WarningMsg|echo 'Missing rule for word:"'.a:word.'"'|echohl NONE | |
return s:CleanUp(restore_options, a:mode, startline, startcol) | |
endif | |
let matchline = a:word | |
let curcol = 0 | |
let prefix = '^\%(' | |
let suffix = '\)$' | |
" Now the case when "word" is not given | |
else " Find the match that ends on or after the cursor and set curcol. | |
let regexp = s:Wholematch(matchline, s:all, startcol-1) | |
let curcol = match(matchline, regexp) | |
" If there is no match, give up. | |
if curcol == -1 | |
return s:CleanUp(restore_options, a:mode, startline, startcol) | |
endif | |
let endcol = matchend(matchline, regexp) | |
let suf = strlen(matchline) - endcol | |
let prefix = (curcol ? '^.*\%' . (curcol + 1) . 'c\%(' : '^\%(') | |
let suffix = (suf ? '\)\%' . (endcol + 1) . 'c.*$' : '\)$') | |
endif | |
if exists("b:match_debug") | |
let b:match_match = matchstr(matchline, regexp) | |
let b:match_col = curcol+1 | |
endif | |
" Third step: Find the group and single word that match, and the original | |
" (backref) versions of these. Then, resolve the backrefs. | |
" Set the following local variable: | |
" group = colon-separated list of patterns, one of which matches | |
" = ini:mid:fin or ini:fin | |
" | |
" Now, set group and groupBR to the matching group: 'if:endif' or | |
" 'while:endwhile' or whatever. A bit of a kluge: s:Choose() returns | |
" group . "," . groupBR, and we pick it apart. | |
let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, s:patBR) | |
let i = matchend(group, s:notslash . ",") | |
let groupBR = strpart(group, i) | |
let group = strpart(group, 0, i-1) | |
" Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix | |
if s:do_BR " Do the hard part: resolve those backrefs! | |
let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline) | |
endif | |
if exists("b:match_debug") | |
let b:match_wholeBR = groupBR | |
let i = matchend(groupBR, s:notslash . ":") | |
let b:match_iniBR = strpart(groupBR, 0, i-1) | |
endif | |
" Fourth step: Set the arguments for searchpair(). | |
let i = matchend(group, s:notslash . ":") | |
let j = matchend(group, '.*' . s:notslash . ":") | |
let ini = strpart(group, 0, i-1) | |
let mid = substitute(strpart(group, i,j-i-1), s:notslash.'\zs:', '\\|', 'g') | |
let fin = strpart(group, j) | |
"Un-escape the remaining , and : characters. | |
let ini = substitute(ini, s:notslash . '\zs\\\(:\|,\)', '\1', 'g') | |
let mid = substitute(mid, s:notslash . '\zs\\\(:\|,\)', '\1', 'g') | |
let fin = substitute(fin, s:notslash . '\zs\\\(:\|,\)', '\1', 'g') | |
" searchpair() requires that these patterns avoid \(\) groups. | |
let ini = substitute(ini, s:notslash . '\zs\\(', '\\%(', 'g') | |
let mid = substitute(mid, s:notslash . '\zs\\(', '\\%(', 'g') | |
let fin = substitute(fin, s:notslash . '\zs\\(', '\\%(', 'g') | |
" Set mid. This is optimized for readability, not micro-efficiency! | |
if a:forward && matchline =~ prefix . fin . suffix | |
\ || !a:forward && matchline =~ prefix . ini . suffix | |
let mid = "" | |
endif | |
" Set flag. This is optimized for readability, not micro-efficiency! | |
if a:forward && matchline =~ prefix . fin . suffix | |
\ || !a:forward && matchline !~ prefix . ini . suffix | |
let flag = "bW" | |
else | |
let flag = "W" | |
endif | |
" Set skip. | |
if exists("b:match_skip") | |
let skip = b:match_skip | |
elseif exists("b:match_comment") " backwards compatibility and testing! | |
let skip = "r:" . b:match_comment | |
else | |
let skip = 's:comment\|string' | |
endif | |
let skip = s:ParseSkip(skip) | |
if exists("b:match_debug") | |
let b:match_ini = ini | |
let b:match_tail = (strlen(mid) ? mid.'\|' : '') . fin | |
endif | |
" Fifth step: actually start moving the cursor and call searchpair(). | |
" Later, :execute restore_cursor to get to the original screen. | |
let view = winsaveview() | |
call cursor(0, curcol + 1) | |
" normal! 0 | |
" if curcol | |
" execute "normal!" . curcol . "l" | |
" endif | |
if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on")) | |
let skip = "0" | |
else | |
execute "if " . skip . "| let skip = '0' | endif" | |
endif | |
let sp_return = searchpair(ini, mid, fin, flag, skip) | |
let final_position = "call cursor(" . line(".") . "," . col(".") . ")" | |
" Restore cursor position and original screen. | |
call winrestview(view) | |
normal! m' | |
if sp_return > 0 | |
execute final_position | |
endif | |
return s:CleanUp(restore_options, a:mode, startline, startcol, mid.'\|'.fin) | |
endfun | |
" Restore options and do some special handling for Operator-pending mode. | |
" The optional argument is the tail of the matching group. | |
1 0.000006 fun! s:CleanUp(options, mode, startline, startcol, ...) | |
execute "set" a:options | |
" Open folds, if appropriate. | |
if a:mode != "o" | |
if &foldopen =~ "percent" | |
normal! zv | |
endif | |
" In Operator-pending mode, we want to include the whole match | |
" (for example, d%). | |
" This is only a problem if we end up moving in the forward direction. | |
elseif (a:startline < line(".")) || | |
\ (a:startline == line(".") && a:startcol < col(".")) | |
if a:0 | |
" Check whether the match is a single character. If not, move to the | |
" end of the match. | |
let matchline = getline(".") | |
let currcol = col(".") | |
let regexp = s:Wholematch(matchline, a:1, currcol-1) | |
let endcol = matchend(matchline, regexp) | |
if endcol > currcol " This is NOT off by one! | |
call cursor(0, endcol) | |
endif | |
endif " a:0 | |
endif " a:mode != "o" && etc. | |
return 0 | |
endfun | |
" Example (simplified HTML patterns): if | |
" a:groupBR = '<\(\k\+\)>:</\1>' | |
" a:prefix = '^.\{3}\(' | |
" a:group = '<\(\k\+\)>:</\(\k\+\)>' | |
" a:suffix = '\).\{2}$' | |
" a:matchline = "123<tag>12" or "123</tag>12" | |
" then extract "tag" from a:matchline and return "<tag>:</tag>" . | |
1 0.000004 fun! s:InsertRefs(groupBR, prefix, group, suffix, matchline) | |
if a:matchline !~ a:prefix . | |
\ substitute(a:group, s:notslash . '\zs:', '\\|', 'g') . a:suffix | |
return a:group | |
endif | |
let i = matchend(a:groupBR, s:notslash . ':') | |
let ini = strpart(a:groupBR, 0, i-1) | |
let tailBR = strpart(a:groupBR, i) | |
let word = s:Choose(a:group, a:matchline, ":", "", a:prefix, a:suffix, | |
\ a:groupBR) | |
let i = matchend(word, s:notslash . ":") | |
let wordBR = strpart(word, i) | |
let word = strpart(word, 0, i-1) | |
" Now, a:matchline =~ a:prefix . word . a:suffix | |
if wordBR != ini | |
let table = s:Resolve(ini, wordBR, "table") | |
else | |
" let table = "----------" | |
let table = "" | |
let d = 0 | |
while d < 10 | |
if tailBR =~ s:notslash . '\\' . d | |
" let table[d] = d | |
let table = table . d | |
else | |
let table = table . "-" | |
endif | |
let d = d + 1 | |
endwhile | |
endif | |
let d = 9 | |
while d | |
if table[d] != "-" | |
let backref = substitute(a:matchline, a:prefix.word.a:suffix, | |
\ '\'.table[d], "") | |
" Are there any other characters that should be escaped? | |
let backref = escape(backref, '*,:') | |
execute s:Ref(ini, d, "start", "len") | |
let ini = strpart(ini, 0, start) . backref . strpart(ini, start+len) | |
let tailBR = substitute(tailBR, s:notslash . '\zs\\' . d, | |
\ escape(backref, '\\&'), 'g') | |
endif | |
let d = d-1 | |
endwhile | |
if exists("b:match_debug") | |
if s:do_BR | |
let b:match_table = table | |
let b:match_word = word | |
else | |
let b:match_table = "" | |
let b:match_word = "" | |
endif | |
endif | |
return ini . ":" . tailBR | |
endfun | |
" Input a comma-separated list of groups with backrefs, such as | |
" a:groups = '\(foo\):end\1,\(bar\):end\1' | |
" and return a comma-separated list of groups with backrefs replaced: | |
" return '\(foo\):end\(foo\),\(bar\):end\(bar\)' | |
1 0.000005 fun! s:ParseWords(groups) | |
let groups = substitute(a:groups.",", s:notslash.'\zs[,:]*,[,:]*', ',', 'g') | |
let groups = substitute(groups, s:notslash . '\zs:\{2,}', ':', 'g') | |
let parsed = "" | |
while groups =~ '[^,:]' | |
let i = matchend(groups, s:notslash . ':') | |
let j = matchend(groups, s:notslash . ',') | |
let ini = strpart(groups, 0, i-1) | |
let tail = strpart(groups, i, j-i-1) . ":" | |
let groups = strpart(groups, j) | |
let parsed = parsed . ini | |
let i = matchend(tail, s:notslash . ':') | |
while i != -1 | |
" In 'if:else:endif', ini='if' and word='else' and then word='endif'. | |
let word = strpart(tail, 0, i-1) | |
let tail = strpart(tail, i) | |
let i = matchend(tail, s:notslash . ':') | |
let parsed = parsed . ":" . s:Resolve(ini, word, "word") | |
endwhile " Now, tail has been used up. | |
let parsed = parsed . "," | |
endwhile " groups =~ '[^,:]' | |
let parsed = substitute(parsed, ',$', '', '') | |
return parsed | |
endfun | |
" TODO I think this can be simplified and/or made more efficient. | |
" TODO What should I do if a:start is out of range? | |
" Return a regexp that matches all of a:string, such that | |
" matchstr(a:string, regexp) represents the match for a:pat that starts | |
" as close to a:start as possible, before being preferred to after, and | |
" ends after a:start . | |
" Usage: | |
" let regexp = s:Wholematch(getline("."), 'foo\|bar', col(".")-1) | |
" let i = match(getline("."), regexp) | |
" let j = matchend(getline("."), regexp) | |
" let match = matchstr(getline("."), regexp) | |
1 0.000004 fun! s:Wholematch(string, pat, start) | |
let group = '\%(' . a:pat . '\)' | |
let prefix = (a:start ? '\(^.*\%<' . (a:start + 2) . 'c\)\zs' : '^') | |
let len = strlen(a:string) | |
let suffix = (a:start+1 < len ? '\(\%>'.(a:start+1).'c.*$\)\@=' : '$') | |
if a:string !~ prefix . group . suffix | |
let prefix = '' | |
endif | |
return prefix . group . suffix | |
endfun | |
" No extra arguments: s:Ref(string, d) will | |
" find the d'th occurrence of '\(' and return it, along with everything up | |
" to and including the matching '\)'. | |
" One argument: s:Ref(string, d, "start") returns the index of the start | |
" of the d'th '\(' and any other argument returns the length of the group. | |
" Two arguments: s:Ref(string, d, "foo", "bar") returns a string to be | |
" executed, having the effect of | |
" :let foo = s:Ref(string, d, "start") | |
" :let bar = s:Ref(string, d, "len") | |
1 0.000003 fun! s:Ref(string, d, ...) | |
let len = strlen(a:string) | |
if a:d == 0 | |
let start = 0 | |
else | |
let cnt = a:d | |
let match = a:string | |
while cnt | |
let cnt = cnt - 1 | |
let index = matchend(match, s:notslash . '\\(') | |
if index == -1 | |
return "" | |
endif | |
let match = strpart(match, index) | |
endwhile | |
let start = len - strlen(match) | |
if a:0 == 1 && a:1 == "start" | |
return start - 2 | |
endif | |
let cnt = 1 | |
while cnt | |
let index = matchend(match, s:notslash . '\\(\|\\)') - 1 | |
if index == -2 | |
return "" | |
endif | |
" Increment if an open, decrement if a ')': | |
let cnt = cnt + (match[index]=="(" ? 1 : -1) " ')' | |
" let cnt = stridx('0(', match[index]) + cnt | |
let match = strpart(match, index+1) | |
endwhile | |
let start = start - 2 | |
let len = len - start - strlen(match) | |
endif | |
if a:0 == 1 | |
return len | |
elseif a:0 == 2 | |
return "let " . a:1 . "=" . start . "| let " . a:2 . "=" . len | |
else | |
return strpart(a:string, start, len) | |
endif | |
endfun | |
" Count the number of disjoint copies of pattern in string. | |
" If the pattern is a literal string and contains no '0' or '1' characters | |
" then s:Count(string, pattern, '0', '1') should be faster than | |
" s:Count(string, pattern). | |
1 0.000003 fun! s:Count(string, pattern, ...) | |
let pat = escape(a:pattern, '\\') | |
if a:0 > 1 | |
let foo = substitute(a:string, '[^'.a:pattern.']', "a:1", "g") | |
let foo = substitute(a:string, pat, a:2, "g") | |
let foo = substitute(foo, '[^' . a:2 . ']', "", "g") | |
return strlen(foo) | |
endif | |
let result = 0 | |
let foo = a:string | |
let index = matchend(foo, pat) | |
while index != -1 | |
let result = result + 1 | |
let foo = strpart(foo, index) | |
let index = matchend(foo, pat) | |
endwhile | |
return result | |
endfun | |
" s:Resolve('\(a\)\(b\)', '\(c\)\2\1\1\2') should return table.word, where | |
" word = '\(c\)\(b\)\(a\)\3\2' and table = '-32-------'. That is, the first | |
" '\1' in target is replaced by '\(a\)' in word, table[1] = 3, and this | |
" indicates that all other instances of '\1' in target are to be replaced | |
" by '\3'. The hard part is dealing with nesting... | |
" Note that ":" is an illegal character for source and target, | |
" unless it is preceded by "\". | |
1 0.000003 fun! s:Resolve(source, target, output) | |
let word = a:target | |
let i = matchend(word, s:notslash . '\\\d') - 1 | |
let table = "----------" | |
while i != -2 " There are back references to be replaced. | |
let d = word[i] | |
let backref = s:Ref(a:source, d) | |
" The idea is to replace '\d' with backref. Before we do this, | |
" replace any \(\) groups in backref with :1, :2, ... if they | |
" correspond to the first, second, ... group already inserted | |
" into backref. Later, replace :1 with \1 and so on. The group | |
" number w+b within backref corresponds to the group number | |
" s within a:source. | |
" w = number of '\(' in word before the current one | |
let w = s:Count( | |
\ substitute(strpart(word, 0, i-1), '\\\\', '', 'g'), '\(', '1') | |
let b = 1 " number of the current '\(' in backref | |
let s = d " number of the current '\(' in a:source | |
while b <= s:Count(substitute(backref, '\\\\', '', 'g'), '\(', '1') | |
\ && s < 10 | |
if table[s] == "-" | |
if w + b < 10 | |
" let table[s] = w + b | |
let table = strpart(table, 0, s) . (w+b) . strpart(table, s+1) | |
endif | |
let b = b + 1 | |
let s = s + 1 | |
else | |
execute s:Ref(backref, b, "start", "len") | |
let ref = strpart(backref, start, len) | |
let backref = strpart(backref, 0, start) . ":". table[s] | |
\ . strpart(backref, start+len) | |
let s = s + s:Count(substitute(ref, '\\\\', '', 'g'), '\(', '1') | |
endif | |
endwhile | |
let word = strpart(word, 0, i-1) . backref . strpart(word, i+1) | |
let i = matchend(word, s:notslash . '\\\d') - 1 | |
endwhile | |
let word = substitute(word, s:notslash . '\zs:', '\\', 'g') | |
if a:output == "table" | |
return table | |
elseif a:output == "word" | |
return word | |
else | |
return table . word | |
endif | |
endfun | |
" Assume a:comma = ",". Then the format for a:patterns and a:1 is | |
" a:patterns = "<pat1>,<pat2>,..." | |
" a:1 = "<alt1>,<alt2>,..." | |
" If <patn> is the first pattern that matches a:string then return <patn> | |
" if no optional arguments are given; return <patn>,<altn> if a:1 is given. | |
1 0.000006 fun! s:Choose(patterns, string, comma, branch, prefix, suffix, ...) | |
let tail = (a:patterns =~ a:comma."$" ? a:patterns : a:patterns . a:comma) | |
let i = matchend(tail, s:notslash . a:comma) | |
if a:0 | |
let alttail = (a:1 =~ a:comma."$" ? a:1 : a:1 . a:comma) | |
let j = matchend(alttail, s:notslash . a:comma) | |
endif | |
let current = strpart(tail, 0, i-1) | |
if a:branch == "" | |
let currpat = current | |
else | |
let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g') | |
endif | |
while a:string !~ a:prefix . currpat . a:suffix | |
let tail = strpart(tail, i) | |
let i = matchend(tail, s:notslash . a:comma) | |
if i == -1 | |
return -1 | |
endif | |
let current = strpart(tail, 0, i-1) | |
if a:branch == "" | |
let currpat = current | |
else | |
let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g') | |
endif | |
if a:0 | |
let alttail = strpart(alttail, j) | |
let j = matchend(alttail, s:notslash . a:comma) | |
endif | |
endwhile | |
if a:0 | |
let current = current . a:comma . strpart(alttail, 0, j-1) | |
endif | |
return current | |
endfun | |
" Call this function to turn on debugging information. Every time the main | |
" script is run, buffer variables will be saved. These can be used directly | |
" or viewed using the menu items below. | |
1 0.000009 if !exists(":MatchDebug") | |
1 0.000008 command! -nargs=0 MatchDebug call s:Match_debug() | |
1 0.000002 endif | |
1 0.000004 fun! s:Match_debug() | |
let b:match_debug = 1 " Save debugging information. | |
" pat = all of b:match_words with backrefs parsed | |
amenu &Matchit.&pat :echo b:match_pat<CR> | |
" match = bit of text that is recognized as a match | |
amenu &Matchit.&match :echo b:match_match<CR> | |
" curcol = cursor column of the start of the matching text | |
amenu &Matchit.&curcol :echo b:match_col<CR> | |
" wholeBR = matching group, original version | |
amenu &Matchit.wh&oleBR :echo b:match_wholeBR<CR> | |
" iniBR = 'if' piece, original version | |
amenu &Matchit.ini&BR :echo b:match_iniBR<CR> | |
" ini = 'if' piece, with all backrefs resolved from match | |
amenu &Matchit.&ini :echo b:match_ini<CR> | |
" tail = 'else\|endif' piece, with all backrefs resolved from match | |
amenu &Matchit.&tail :echo b:match_tail<CR> | |
" fin = 'endif' piece, with all backrefs resolved from match | |
amenu &Matchit.&word :echo b:match_word<CR> | |
" '\'.d in ini refers to the same thing as '\'.table[d] in word. | |
amenu &Matchit.t&able :echo '0:' . b:match_table . ':9'<CR> | |
endfun | |
" Jump to the nearest unmatched "(" or "if" or "<tag>" if a:spflag == "bW" | |
" or the nearest unmatched "</tag>" or "endif" or ")" if a:spflag == "W". | |
" Return a "mark" for the original position, so that | |
" let m = MultiMatch("bW", "n") ... execute m | |
" will return to the original position. If there is a problem, do not | |
" move the cursor and return "", unless a count is given, in which case | |
" go up or down as many levels as possible and again return "". | |
" TODO This relies on the same patterns as % matching. It might be a good | |
" idea to give it its own matching patterns. | |
1 0.000003 fun! s:MultiMatch(spflag, mode) | |
if !exists("b:match_words") || b:match_words == "" | |
return {} | |
end | |
let restore_options = (&ic ? "" : "no") . "ignorecase" | |
if exists("b:match_ignorecase") | |
let &ignorecase = b:match_ignorecase | |
endif | |
let startline = line(".") | |
let startcol = col(".") | |
" First step: if not already done, set the script variables | |
" s:do_BR flag for whether there are backrefs | |
" s:pat parsed version of b:match_words | |
" s:all regexp based on s:pat and the default groups | |
" This part is copied and slightly modified from s:Match_wrapper(). | |
let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") . | |
\ '\/\*:\*\/,#\s*if\%(def\)\=:#\s*else\>:#\s*elif\>:#\s*endif\>' | |
" Allow b:match_words = "GetVimMatchWords()" . | |
if b:match_words =~ ":" | |
let match_words = b:match_words | |
else | |
execute "let match_words =" b:match_words | |
endif | |
if (match_words != s:last_words) || (&mps != s:last_mps) || | |
\ exists("b:match_debug") | |
let s:last_words = match_words | |
let s:last_mps = &mps | |
let match_words = match_words . (strlen(match_words) ? "," : "") . default | |
if match_words !~ s:notslash . '\\\d' | |
let s:do_BR = 0 | |
let s:pat = match_words | |
else | |
let s:do_BR = 1 | |
let s:pat = s:ParseWords(match_words) | |
endif | |
let s:all = '\%(' . substitute(s:pat . (strlen(s:pat) ? "," : "") . default, | |
\ '[,:]\+', '\\|', 'g') . '\)' | |
if exists("b:match_debug") | |
let b:match_pat = s:pat | |
endif | |
endif | |
" Second step: figure out the patterns for searchpair() | |
" and save the screen, cursor position, and 'ignorecase'. | |
" - TODO: A lot of this is copied from s:Match_wrapper(). | |
" - maybe even more functionality should be split off | |
" - into separate functions! | |
let cdefault = (s:pat =~ '[^,]$' ? "," : "") . default | |
let open = substitute(s:pat . cdefault, | |
\ s:notslash . '\zs:.\{-}' . s:notslash . ',', '\\),\\(', 'g') | |
let open = '\(' . substitute(open, s:notslash . '\zs:.*$', '\\)', '') | |
let close = substitute(s:pat . cdefault, | |
\ s:notslash . '\zs,.\{-}' . s:notslash . ':', '\\),\\(', 'g') | |
let close = substitute(close, '^.\{-}' . s:notslash . ':', '\\(', '') . '\)' | |
if exists("b:match_skip") | |
let skip = b:match_skip | |
elseif exists("b:match_comment") " backwards compatibility and testing! | |
let skip = "r:" . b:match_comment | |
else | |
let skip = 's:comment\|string' | |
endif | |
let skip = s:ParseSkip(skip) | |
let view = winsaveview() | |
" Third step: call searchpair(). | |
" Replace '\('--but not '\\('--with '\%(' and ',' with '\|'. | |
let openpat = substitute(open, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g') | |
let openpat = substitute(openpat, ',', '\\|', 'g') | |
let closepat = substitute(close, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g') | |
let closepat = substitute(closepat, ',', '\\|', 'g') | |
if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on")) | |
let skip = '0' | |
else | |
execute "if " . skip . "| let skip = '0' | endif" | |
endif | |
mark ' | |
let level = v:count1 | |
while level | |
if searchpair(openpat, '', closepat, a:spflag, skip) < 1 | |
call s:CleanUp(restore_options, a:mode, startline, startcol) | |
return {} | |
endif | |
let level = level - 1 | |
endwhile | |
" Restore options and return view dict to restore the original position. | |
call s:CleanUp(restore_options, a:mode, startline, startcol) | |
return view | |
endfun | |
" Search backwards for "if" or "while" or "<tag>" or ... | |
" and return "endif" or "endwhile" or "</tag>" or ... . | |
" For now, this uses b:match_words and the same script variables | |
" as s:Match_wrapper() . Later, it may get its own patterns, | |
" either from a buffer variable or passed as arguments. | |
" fun! s:Autocomplete() | |
" echo "autocomplete not yet implemented :-(" | |
" if !exists("b:match_words") || b:match_words == "" | |
" return "" | |
" end | |
" let startpos = s:MultiMatch("bW") | |
" | |
" if startpos == "" | |
" return "" | |
" endif | |
" " - TODO: figure out whether 'if' or '<tag>' matched, and construct | |
" " - the appropriate closing. | |
" let matchline = getline(".") | |
" let curcol = col(".") - 1 | |
" " - TODO: Change the s:all argument if there is a new set of match pats. | |
" let regexp = s:Wholematch(matchline, s:all, curcol) | |
" let suf = strlen(matchline) - matchend(matchline, regexp) | |
" let prefix = (curcol ? '^.\{' . curcol . '}\%(' : '^\%(') | |
" let suffix = (suf ? '\).\{' . suf . '}$' : '\)$') | |
" " Reconstruct the version with unresolved backrefs. | |
" let patBR = substitute(b:match_words.',', '[,:]*,[,:]*', ',', 'g') | |
" let patBR = substitute(patBR, ':\{2,}', ':', "g") | |
" " Now, set group and groupBR to the matching group: 'if:endif' or | |
" " 'while:endwhile' or whatever. | |
" let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR) | |
" let i = matchend(group, s:notslash . ",") | |
" let groupBR = strpart(group, i) | |
" let group = strpart(group, 0, i-1) | |
" " Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix | |
" if s:do_BR | |
" let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline) | |
" endif | |
" " let g:group = group | |
" | |
" " - TODO: Construct the closing from group. | |
" let fake = "end" . expand("<cword>") | |
" execute startpos | |
" return fake | |
" endfun | |
" Close all open structures. "Get the heck out of here!" | |
" fun! s:Gthhoh() | |
" let close = s:Autocomplete() | |
" while strlen(close) | |
" put=close | |
" let close = s:Autocomplete() | |
" endwhile | |
" endfun | |
" Parse special strings as typical skip arguments for searchpair(): | |
" s:foo becomes (current syntax item) =~ foo | |
" S:foo becomes (current syntax item) !~ foo | |
" r:foo becomes (line before cursor) =~ foo | |
" R:foo becomes (line before cursor) !~ foo | |
1 0.000005 fun! s:ParseSkip(str) | |
let skip = a:str | |
if skip[1] == ":" | |
if skip[0] == "s" | |
let skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '" . | |
\ strpart(skip,2) . "'" | |
elseif skip[0] == "S" | |
let skip = "synIDattr(synID(line('.'),col('.'),1),'name') !~? '" . | |
\ strpart(skip,2) . "'" | |
elseif skip[0] == "r" | |
let skip = "strpart(getline('.'),0,col('.'))=~'" . strpart(skip,2). "'" | |
elseif skip[0] == "R" | |
let skip = "strpart(getline('.'),0,col('.'))!~'" . strpart(skip,2). "'" | |
endif | |
endif | |
return skip | |
endfun | |
1 0.000033 let &cpo = s:save_cpo | |
1 0.000004 unlet s:save_cpo | |
" vim:sts=2:sw=2: | |
SCRIPT /usr/share/nvim/runtime/plugin/matchparen.vim | |
Sourced 1 time | |
Total time: 0.000521 | |
Self time: 0.000521 | |
count total (s) self (s) | |
" Vim plugin for showing matching parens | |
" Maintainer: Bram Moolenaar <Bram@vim.org> | |
" Last Change: 2016 Feb 16 | |
" Exit quickly when: | |
" - this plugin was already loaded (or disabled) | |
" - when 'compatible' is set | |
" - the "CursorMoved" autocmd event is not available. | |
1 0.000024 if exists("g:loaded_matchparen") || &cp || !exists("##CursorMoved") | |
finish | |
endif | |
1 0.000005 let g:loaded_matchparen = 1 | |
1 0.000004 if !exists("g:matchparen_timeout") | |
1 0.000003 let g:matchparen_timeout = 300 | |
1 0.000001 endif | |
1 0.000003 if !exists("g:matchparen_insert_timeout") | |
1 0.000003 let g:matchparen_insert_timeout = 60 | |
1 0.000002 endif | |
1 0.000060 augroup matchparen | |
" Replace all matchparen autocommands | |
1 0.000019 autocmd! CursorMoved,CursorMovedI,WinEnter * call s:Highlight_Matching_Pair() | |
1 0.000006 if exists('##TextChanged') | |
1 0.000008 autocmd! TextChanged,TextChangedI * call s:Highlight_Matching_Pair() | |
1 0.000001 endif | |
1 0.000002 augroup END | |
" Skip the rest if it was already done. | |
1 0.000007 if exists("*s:Highlight_Matching_Pair") | |
finish | |
endif | |
1 0.000009 let s:cpo_save = &cpo | |
1 0.000012 set cpo-=C | |
" The function that is invoked (very often) to define a ":match" highlighting | |
" for any matching paren. | |
1 0.000004 function! s:Highlight_Matching_Pair() | |
" Remove any previous match. | |
if exists('w:paren_hl_on') && w:paren_hl_on | |
silent! call matchdelete(3) | |
let w:paren_hl_on = 0 | |
endif | |
" Avoid that we remove the popup menu. | |
" Return when there are no colors (looks like the cursor jumps). | |
if pumvisible() || (&t_Co < 8 && !has("gui_running")) | |
return | |
endif | |
" Get the character under the cursor and check if it's in 'matchpairs'. | |
let c_lnum = line('.') | |
let c_col = col('.') | |
let before = 0 | |
let text = getline(c_lnum) | |
let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)') | |
if empty(matches) | |
let [c_before, c] = ['', ''] | |
else | |
let [c_before, c] = matches[1:2] | |
endif | |
let plist = split(&matchpairs, '.\zs[:,]') | |
let i = index(plist, c) | |
if i < 0 | |
" not found, in Insert mode try character before the cursor | |
if c_col > 1 && (mode() == 'i' || mode() == 'R') | |
let before = strlen(c_before) | |
let c = c_before | |
let i = index(plist, c) | |
endif | |
if i < 0 | |
" not found, nothing to do | |
return | |
endif | |
endif | |
" Figure out the arguments for searchpairpos(). | |
if i % 2 == 0 | |
let s_flags = 'nW' | |
let c2 = plist[i + 1] | |
else | |
let s_flags = 'nbW' | |
let c2 = c | |
let c = plist[i - 1] | |
endif | |
if c == '[' | |
let c = '\[' | |
let c2 = '\]' | |
endif | |
" Find the match. When it was just before the cursor move it there for a | |
" moment. | |
if before > 0 | |
let has_getcurpos = exists("*getcurpos") | |
if has_getcurpos | |
" getcurpos() is more efficient but doesn't exist before 7.4.313. | |
let save_cursor = getcurpos() | |
else | |
let save_cursor = winsaveview() | |
endif | |
call cursor(c_lnum, c_col - before) | |
endif | |
" Build an expression that detects whether the current cursor position is in | |
" certain syntax types (string, comment, etc.), for use as searchpairpos()'s | |
" skip argument. | |
" We match "escape" for special items, such as lispEscapeSpecial. | |
let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . | |
\ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))' | |
" If executing the expression determines that the cursor is currently in | |
" one of the syntax types, then we want searchpairpos() to find the pair | |
" within those syntax types (i.e., not skip). Otherwise, the cursor is | |
" outside of the syntax types and s_skip should keep its value so we skip any | |
" matching pair inside the syntax types. | |
execute 'if' s_skip '| let s_skip = 0 | endif' | |
" Limit the search to lines visible in the window. | |
let stoplinebottom = line('w$') | |
let stoplinetop = line('w0') | |
if i % 2 == 0 | |
let stopline = stoplinebottom | |
else | |
let stopline = stoplinetop | |
endif | |
" Limit the search time to 300 msec to avoid a hang on very long lines. | |
" This fails when a timeout is not supported. | |
if mode() == 'i' || mode() == 'R' | |
let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout | |
else | |
let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout | |
endif | |
try | |
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout) | |
catch /E118/ | |
" Can't use the timeout, restrict the stopline a bit more to avoid taking | |
" a long time on closed folds and long lines. | |
" The "viewable" variables give a range in which we can scroll while | |
" keeping the cursor at the same position. | |
" adjustedScrolloff accounts for very large numbers of scrolloff. | |
let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2]) | |
let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2]) | |
let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2]) | |
" one of these stoplines will be adjusted below, but the current values are | |
" minimal boundaries within the current window | |
if i % 2 == 0 | |
if has("byte_offset") && has("syntax_items") && &smc > 0 | |
let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2]) | |
let stopline = min([bottom_viewable, byte2line(stopbyte)]) | |
else | |
let stopline = min([bottom_viewable, c_lnum + 100]) | |
endif | |
let stoplinebottom = stopline | |
else | |
if has("byte_offset") && has("syntax_items") && &smc > 0 | |
let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2]) | |
let stopline = max([top_viewable, byte2line(stopbyte)]) | |
else | |
let stopline = max([top_viewable, c_lnum - 100]) | |
endif | |
let stoplinetop = stopline | |
endif | |
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline) | |
endtry | |
if before > 0 | |
if has_getcurpos | |
call setpos('.', save_cursor) | |
else | |
call winrestview(save_cursor) | |
endif | |
endif | |
" If a match is found setup match highlighting. | |
if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom | |
if exists('*matchaddpos') | |
call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3) | |
else | |
exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . | |
\ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' | |
endif | |
let w:paren_hl_on = 1 | |
endif | |
endfunction | |
" Define commands that will disable and enable the plugin. | |
1 0.000016 command! NoMatchParen windo silent! call matchdelete(3) | unlet! g:loaded_matchparen | | |
\ au! matchparen | |
1 0.000009 command! DoMatchParen runtime plugin/matchparen.vim | windo doau CursorMoved | |
1 0.000012 let &cpo = s:cpo_save | |
1 0.000006 unlet s:cpo_save | |
SCRIPT /usr/share/nvim/runtime/plugin/netrwPlugin.vim | |
Sourced 1 time | |
Total time: 0.001274 | |
Self time: 0.001274 | |
count total (s) self (s) | |
" netrwPlugin.vim: Handles file transfer and remote directory listing across a network | |
" PLUGIN SECTION | |
" Date: Feb 08, 2016 | |
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> | |
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim | |
" Copyright: Copyright (C) 1999-2013 Charles E. Campbell {{{1 | |
" Permission is hereby granted to use and distribute this code, | |
" with or without modifications, provided that this copyright | |
" notice is copied with it. Like anything else that's free, | |
" netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided | |
" *as is* and comes with no warranty of any kind, either | |
" expressed or implied. By using this plugin, you agree that | |
" in no event will the copyright holder be liable for any damages | |
" resulting from the use of this software. | |
" | |
" But be doers of the Word, and not only hearers, deluding your own selves {{{1 | |
" (James 1:22 RSV) | |
" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | |
" Load Once: {{{1 | |
1 0.000023 if &cp || exists("g:loaded_netrwPlugin") | |
finish | |
endif | |
1 0.000010 let g:loaded_netrwPlugin = "v156" | |
1 0.000100 let s:keepcpo = &cpo | |
1 0.000011 set cpo&vim | |
"DechoRemOn | |
" --------------------------------------------------------------------- | |
" Public Interface: {{{1 | |
" Local Browsing Autocmds: {{{2 | |
1 0.000004 augroup FileExplorer | |
1 0.000025 au! | |
1 0.000012 au BufLeave * if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif | |
1 0.000005 au BufEnter * sil call s:LocalBrowse(expand("<amatch>")) | |
1 0.000004 au VimEnter * sil call s:VimEnter(expand("<amatch>")) | |
1 0.000064 if has("win32") || has("win95") || has("win64") || has("win16") | |
au BufEnter .* sil call s:LocalBrowse(expand("<amatch>")) | |
endif | |
1 0.000002 augroup END | |
" Network Browsing Reading Writing: {{{2 | |
1 0.000002 augroup Network | |
1 0.000035 au! | |
1 0.000011 au BufReadCmd file://* call netrw#FileUrlRead(expand("<amatch>")) | |
1 0.000031 au BufReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "sil doau BufReadPost ".fnameescape(expand("<amatch>")) | |
1 0.000115 au FileReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "sil doau FileReadPost ".fnameescape(expand("<amatch>")) | |
1 0.000026 au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau BufWritePost ".fnameescape(expand("<amatch>")) | |
1 0.000073 au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand("<amatch>"))|exe "'[,']".'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau FileWritePost ".fnameescape(expand("<amatch>")) | |
1 0.000008 try | |
1 0.000024 au SourceCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>")) | |
1 0.000003 catch /^Vim\%((\a\+)\)\=:E216/ | |
au SourcePre ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>")) | |
endtry | |
1 0.000002 augroup END | |
" Commands: :Nread, :Nwrite, :NetUserPass {{{2 | |
1 0.000021 com! -count=1 -nargs=* Nread let s:svpos= winsaveview()<bar>call netrw#NetRead(<count>,<f-args>)<bar>call winrestview(s:svpos) | |
1 0.000018 com! -range=% -nargs=* Nwrite let s:svpos= winsaveview()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call winrestview(s:svpos) | |
1 0.000006 com! -nargs=* NetUserPass call NetUserPass(<f-args>) | |
1 0.000060 com! -nargs=* Nsource let s:svpos= winsaveview()<bar>call netrw#NetSource(<f-args>)<bar>call winrestview(s:svpos) | |
1 0.000008 com! -nargs=? Ntree call netrw#SetTreetop(<q-args>) | |
" Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{2 | |
1 0.000013 com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(<count>,0,0+<bang>0,<q-args>) | |
1 0.000015 com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(<count>,1,0+<bang>0,<q-args>) | |
1 0.000011 com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(<count>,1,2+<bang>0,<q-args>) | |
1 0.000012 com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(<count>,1,4+<bang>0,<q-args>) | |
1 0.000010 com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(<count>,0,6 ,<q-args>) | |
1 0.000007 com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,<q-args>) | |
1 0.000020 com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,<q-args>) | |
1 0.000064 com! -nargs=* -bar -bang -count=0 -complete=dir Lexplore call netrw#Lexplore(<count>,<bang>0,<q-args>) | |
" Commands: NetrwSettings {{{2 | |
1 0.000009 com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings() | |
1 0.000007 com! -bang NetrwClean call netrw#Clean(<bang>0) | |
" Maps: | |
1 0.000006 if !exists("g:netrw_nogx") | |
1 0.000009 if maparg('gx','n') == "" | |
1 0.000011 if !hasmapto('<Plug>NetrwBrowseX') | |
1 0.000009 nmap <unique> gx <Plug>NetrwBrowseX | |
1 0.000002 endif | |
1 0.000017 nno <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())<cr> | |
1 0.000002 endif | |
1 0.000008 if maparg('gx','v') == "" | |
1 0.000009 if !hasmapto('<Plug>NetrwBrowseXVis') | |
1 0.000008 vmap <unique> gx <Plug>NetrwBrowseXVis | |
1 0.000001 endif | |
1 0.000010 vno <silent> <Plug>NetrwBrowseXVis :<c-u>call netrw#BrowseXVis()<cr> | |
1 0.000001 endif | |
1 0.000001 endif | |
1 0.000004 if exists("g:netrw_usetab") && g:netrw_usetab | |
if maparg('<c-tab>','n') == "" | |
nmap <unique> <c-tab> <Plug>NetrwShrink | |
endif | |
nno <silent> <Plug>NetrwShrink :call netrw#Shrink()<cr> | |
endif | |
" --------------------------------------------------------------------- | |
" LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{2 | |
1 0.000006 fun! s:LocalBrowse(dirname) | |
" Unfortunate interaction -- only DechoMsg debugging calls can be safely used here. | |
" Otherwise, the BufEnter event gets triggered when attempts to write to | |
" the DBG buffer are made. | |
if !exists("s:vimentered") | |
" If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will, | |
" and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined. | |
" call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered doesn't exist)") | |
" call Dret("s:LocalBrowse") | |
return | |
endif | |
" call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered=".s:vimentered.")") | |
if has("amiga") | |
" The check against '' is made for the Amiga, where the empty | |
" string is the current directory and not checking would break | |
" things such as the help command. | |
" call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)") | |
if a:dirname != '' && isdirectory(a:dirname) | |
sil! call netrw#LocalBrowseCheck(a:dirname) | |
if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt | |
exe w:netrw_bannercnt | |
endif | |
endif | |
elseif isdirectory(a:dirname) | |
" call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)") | |
" call Dredir("LocalBrowse ft last set: ","verbose set ft") | |
" call Decho("(s:LocalBrowse) COMBAK#23: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) | |
sil! call netrw#LocalBrowseCheck(a:dirname) | |
" call Decho("(s:LocalBrowse) COMBAK#24: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) | |
if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt | |
exe w:netrw_bannercnt | |
" call Decho("(s:LocalBrowse) COMBAK#25: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) | |
endif | |
else | |
" not a directory, ignore it | |
" call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...") | |
endif | |
" call Decho("(s:LocalBrowse) COMBAK#26: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) | |
" call Dret("s:LocalBrowse") | |
endfun | |
" --------------------------------------------------------------------- | |
" s:VimEnter: after all vim startup stuff is done, this function is called. {{{2 | |
" Its purpose: to look over all windows and run s:LocalBrowse() on | |
" them, which checks if they're directories and will create a directory | |
" listing when appropriate. | |
" It also sets s:vimentered, letting s:LocalBrowse() know that s:VimEnter() | |
" has already been called. | |
1 0.000005 fun! s:VimEnter(dirname) | |
" call Dfunc("s:VimEnter(dirname<".a:dirname.">) expand(%)<".expand("%").">") | |
let curwin = winnr() | |
let s:vimentered = 1 | |
windo call s:LocalBrowse(expand("%:p")) | |
exe curwin."wincmd w" | |
" call Dret("s:VimEnter") | |
endfun | |
" --------------------------------------------------------------------- | |
" NetrwStatusLine: {{{1 | |
1 0.000003 fun! NetrwStatusLine() | |
" let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".") | |
if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list") | |
let &stl= s:netrw_explore_stl | |
if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif | |
if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif | |
return "" | |
else | |
return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen | |
endif | |
endfun | |
" ------------------------------------------------------------------------ | |
" NetUserPass: set username and password for subsequent ftp transfer {{{1 | |
" Usage: :call NetUserPass() -- will prompt for userid and password | |
" :call NetUserPass("uid") -- will prompt for password | |
" :call NetUserPass("uid","password") -- sets global userid and password | |
1 0.000004 fun! NetUserPass(...) | |
" get/set userid | |
if a:0 == 0 | |
" call Dfunc("NetUserPass(a:0<".a:0.">)") | |
if !exists("g:netrw_uid") || g:netrw_uid == "" | |
" via prompt | |
let g:netrw_uid= input('Enter username: ') | |
endif | |
else " from command line | |
" call Dfunc("NetUserPass(a:1<".a:1.">) {") | |
let g:netrw_uid= a:1 | |
endif | |
" get password | |
if a:0 <= 1 " via prompt | |
" call Decho("a:0=".a:0." case <=1:") | |
let g:netrw_passwd= inputsecret("Enter Password: ") | |
else " from command line | |
" call Decho("a:0=".a:0." case >1: a:2<".a:2.">") | |
let g:netrw_passwd=a:2 | |
endif | |
" call Dret("NetUserPass") | |
endfun | |
" ------------------------------------------------------------------------ | |
" Modelines And Restoration: {{{1 | |
1 0.000014 let &cpo= s:keepcpo | |
1 0.000017 unlet s:keepcpo | |
" vim:ts=8 fdm=marker | |
SCRIPT /usr/share/nvim/runtime/plugin/rplugin.vim | |
Sourced 1 time | |
Total time: 0.008979 | |
Self time: 0.000170 | |
count total (s) self (s) | |
if exists('g:loaded_remote_plugins') | |
finish | |
endif | |
1 0.000006 let g:loaded_remote_plugins = '/path/to/manifest' | |
" Get the path to the rplugin manifest file. | |
1 0.000006 function! s:GetManifestPath() abort | |
let manifest_base = '' | |
if exists('$NVIM_RPLUGIN_MANIFEST') | |
return fnamemodify($NVIM_RPLUGIN_MANIFEST, ':p') | |
endif | |
let dest = has('win32') ? '$LOCALAPPDATA' : '$XDG_DATA_HOME' | |
if !exists(dest) | |
let dest = has('win32') ? '~/AppData/Local' : '~/.local/share' | |
endif | |
let dest = fnamemodify(expand(dest), ':p') | |
if !empty(dest) | |
let dest .= ('/' ==# dest[-1:] ? '' : '/') . 'nvim' | |
if !isdirectory(dest) | |
call mkdir(dest, 'p', 0700) | |
endif | |
let manifest_base = dest | |
endif | |
return manifest_base.'/rplugin.vim' | |
endfunction | |
" Old manifest file based on known script locations. | |
1 0.000005 function! s:GetOldManifestPath() abort | |
let prefix = exists('$MYVIMRC') | |
\ ? $MYVIMRC | |
\ : matchstr(get(split(execute('scriptnames'), '\n'), 0, ''), '\f\+$') | |
return fnamemodify(expand(prefix, 1), ':h') | |
\.'/.'.fnamemodify(prefix, ':t').'-rplugin~' | |
endfunction | |
1 0.000003 function! s:GetManifest() abort | |
let manifest = s:GetManifestPath() | |
if !filereadable(manifest) | |
" Check if an old manifest file exists and move it to the new location. | |
let old_manifest = s:GetOldManifestPath() | |
if filereadable(old_manifest) | |
call rename(old_manifest, manifest) | |
endif | |
endif | |
return manifest | |
endfunction | |
1 0.000002 function! s:LoadRemotePlugins() abort | |
let g:loaded_remote_plugins = s:GetManifest() | |
if filereadable(g:loaded_remote_plugins) | |
execute 'source' fnameescape(g:loaded_remote_plugins) | |
endif | |
endfunction | |
1 0.000016 command! UpdateRemotePlugins call remote#host#UpdateRemotePlugins() | |
1 0.002474 call s:LoadRemotePlugins() | |
SCRIPT /home/vagrant/.local/share/nvim/rplugin.vim | |
Sourced 1 time | |
Total time: 0.006324 | |
Self time: 0.001964 | |
count total (s) self (s) | |
" python3 plugins | |
1 0.001914 call remote#host#RegisterPlugin('python3', '/home/vagrant/.config/nvim/plugged/denite.nvim/rplugin/python3/denite', [ | |
\ {'sync': v:true, 'name': '_denite_init', 'opts': {}, 'type': 'function'}, | |
\ {'sync': v:true, 'name': '_denite_start', 'opts': {}, 'type': 'function'}, | |
\ {'sync': v:true, 'name': '_denite_do_action', 'opts': {}, 'type': 'function'}, | |
\ ]) | |
" ruby plugins | |
" python plugins | |
SCRIPT /usr/share/nvim/runtime/autoload/remote/host.vim | |
Sourced 1 time | |
Total time: 0.000572 | |
Self time: 0.000455 | |
count total (s) self (s) | |
let s:hosts = {} | |
1 0.000005 let s:plugin_patterns = {} | |
1 0.000003 let s:plugins_for_host = {} | |
" Register a host by associating it with a factory(funcref) | |
1 0.000006 function! remote#host#Register(name, pattern, factory) abort | |
let s:hosts[a:name] = {'factory': a:factory, 'channel': 0, 'initialized': 0} | |
let s:plugin_patterns[a:name] = a:pattern | |
if type(a:factory) == type(1) && a:factory | |
" Passed a channel directly | |
let s:hosts[a:name].channel = a:factory | |
endif | |
endfunction | |
" Register a clone to an existing host. The new host will use the same factory | |
" as `source`, but it will run as a different process. This can be used by | |
" plugins that should run isolated from other plugins created for the same host | |
" type | |
1 0.000004 function! remote#host#RegisterClone(name, orig_name) abort | |
if !has_key(s:hosts, a:orig_name) | |
throw 'No host named "'.a:orig_name.'" is registered' | |
endif | |
let Factory = s:hosts[a:orig_name].factory | |
let s:hosts[a:name] = { | |
\ 'factory': Factory, | |
\ 'channel': 0, | |
\ 'initialized': 0, | |
\ 'orig_name': a:orig_name | |
\ } | |
endfunction | |
" Get a host channel, bootstrapping it if necessary | |
1 0.000005 function! remote#host#Require(name) abort | |
if !has_key(s:hosts, a:name) | |
throw 'No host named "'.a:name.'" is registered' | |
endif | |
let host = s:hosts[a:name] | |
if !host.channel && !host.initialized | |
let host_info = { | |
\ 'name': a:name, | |
\ 'orig_name': get(host, 'orig_name', a:name) | |
\ } | |
let host.channel = call(host.factory, [host_info]) | |
let host.initialized = 1 | |
endif | |
return host.channel | |
endfunction | |
1 0.000003 function! remote#host#IsRunning(name) abort | |
if !has_key(s:hosts, a:name) | |
throw 'No host named "'.a:name.'" is registered' | |
endif | |
return s:hosts[a:name].channel != 0 | |
endfunction | |
" Example of registering a Python plugin with two commands (one async), one | |
" autocmd (async) and one function (sync): | |
" | |
" let s:plugin_path = expand('<sfile>:p:h').'/nvim_plugin.py' | |
" call remote#host#RegisterPlugin('python', s:plugin_path, [ | |
" \ {'type': 'command', 'name': 'PyCmd', 'sync': 1, 'opts': {}}, | |
" \ {'type': 'command', 'name': 'PyAsyncCmd', 'sync': 0, 'opts': {'eval': 'cursor()'}}, | |
" \ {'type': 'autocmd', 'name': 'BufEnter', 'sync': 0, 'opts': {'eval': 'expand("<afile>")'}}, | |
" \ {'type': 'function', 'name': 'PyFunc', 'sync': 1, 'opts': {}} | |
" \ ]) | |
" | |
" The third item in a declaration is a boolean: non zero means the command, | |
" autocommand or function will be executed synchronously with rpcrequest. | |
1 0.000004 function! remote#host#RegisterPlugin(host, path, specs) abort | |
let plugins = remote#host#PluginsForHost(a:host) | |
for plugin in plugins | |
if plugin.path == a:path | |
throw 'Plugin "'.a:path.'" is already registered' | |
endif | |
endfor | |
if has_key(s:hosts, a:host) && remote#host#IsRunning(a:host) | |
" For now we won't allow registration of plugins when the host is already | |
" running. | |
throw 'Host "'.a:host.'" is already running' | |
endif | |
for spec in a:specs | |
let type = spec.type | |
let name = spec.name | |
let sync = spec.sync | |
let opts = spec.opts | |
let rpc_method = a:path | |
if type == 'command' | |
let rpc_method .= ':command:'.name | |
call remote#define#CommandOnHost(a:host, rpc_method, sync, name, opts) | |
elseif type == 'autocmd' | |
" Since multiple handlers can be attached to the same autocmd event by a | |
" single plugin, we need a way to uniquely identify the rpc method to | |
" call. The solution is to append the autocmd pattern to the method | |
" name(This still has a limit: one handler per event/pattern combo, but | |
" there's no need to allow plugins define multiple handlers in that case) | |
let rpc_method .= ':autocmd:'.name.':'.get(opts, 'pattern', '*') | |
call remote#define#AutocmdOnHost(a:host, rpc_method, sync, name, opts) | |
elseif type == 'function' | |
let rpc_method .= ':function:'.name | |
call remote#define#FunctionOnHost(a:host, rpc_method, sync, name, opts) | |
else | |
echoerr 'Invalid declaration type: '.type | |
endif | |
endfor | |
call add(plugins, {'path': a:path, 'specs': a:specs}) | |
endfunction | |
1 0.000007 function! s:RegistrationCommands(host) abort | |
" Register a temporary host clone for discovering specs | |
let host_id = a:host.'-registration-clone' | |
call remote#host#RegisterClone(host_id, a:host) | |
let pattern = s:plugin_patterns[a:host] | |
let paths = globpath(&rtp, 'rplugin/'.a:host.'/'.pattern, 0, 1) | |
let paths = map(paths, 'tr(resolve(v:val),"\\","/")') " Normalize slashes #4795 | |
let paths = uniq(sort(paths)) | |
if empty(paths) | |
return [] | |
endif | |
for path in paths | |
call remote#host#RegisterPlugin(host_id, path, []) | |
endfor | |
let channel = remote#host#Require(host_id) | |
let lines = [] | |
let registered = [] | |
for path in paths | |
unlet! specs | |
let specs = rpcrequest(channel, 'specs', path) | |
if type(specs) != type([]) | |
" host didn't return a spec list, indicates a failure while loading a | |
" plugin | |
continue | |
endif | |
call add(lines, "call remote#host#RegisterPlugin('".a:host | |
\ ."', '".path."', [") | |
for spec in specs | |
call add(lines, " \\ ".string(spec).",") | |
endfor | |
call add(lines, " \\ ])") | |
call add(registered, path) | |
endfor | |
echomsg printf("remote/host: %s host registered plugins %s", | |
\ a:host, string(map(registered, "fnamemodify(v:val, ':t')"))) | |
" Delete the temporary host clone | |
call rpcstop(s:hosts[host_id].channel) | |
call remove(s:hosts, host_id) | |
call remove(s:plugins_for_host, host_id) | |
return lines | |
endfunction | |
1 0.000004 function! remote#host#UpdateRemotePlugins() abort | |
let commands = [] | |
let hosts = keys(s:hosts) | |
for host in hosts | |
if has_key(s:plugin_patterns, host) | |
try | |
let commands += | |
\ ['" '.host.' plugins'] | |
\ + s:RegistrationCommands(host) | |
\ + ['', ''] | |
catch | |
echomsg v:throwpoint | |
echomsg v:exception | |
endtry | |
endif | |
endfor | |
call writefile(commands, g:loaded_remote_plugins) | |
echomsg printf('remote/host: generated rplugin manifest: %s', | |
\ g:loaded_remote_plugins) | |
endfunction | |
1 0.000005 function! remote#host#PluginsForHost(host) abort | |
if !has_key(s:plugins_for_host, a:host) | |
let s:plugins_for_host[a:host] = [] | |
end | |
return s:plugins_for_host[a:host] | |
endfunction | |
1 0.000003 function! remote#host#LoadErrorForHost(host, log) abort | |
return 'Failed to load '. a:host . ' host. '. | |
\ 'You can try to see what happened by starting nvim with '. | |
\ a:log . ' set and opening the generated log file.'. | |
\ ' Also, the host stderr is available in messages.' | |
endfunction | |
" Registration of standard hosts | |
" Python/Python3 | |
1 0.000098 0.000021 call remote#host#Register('python', '*', | |
\ function('provider#pythonx#Require')) | |
1 0.000034 0.000012 call remote#host#Register('python3', '*', | |
\ function('provider#pythonx#Require')) | |
" Ruby | |
1 0.000027 0.000010 call remote#host#Register('ruby', '*.rb', | |
SCRIPT /usr/share/nvim/runtime/autoload/remote/define.vim | |
Sourced 1 time | |
Total time: 0.000321 | |
Self time: 0.000321 | |
count total (s) self (s) | |
function! remote#define#CommandOnHost(host, method, sync, name, opts) | |
let prefix = '' | |
if has_key(a:opts, 'range') | |
if a:opts.range == '' || a:opts.range == '%' | |
" -range or -range=%, pass the line range in a list | |
let prefix = '<line1>,<line2>' | |
elseif matchstr(a:opts.range, '\d') != '' | |
" -range=N, pass the count | |
let prefix = '<count>' | |
endif | |
elseif has_key(a:opts, 'count') | |
let prefix = '<count>' | |
endif | |
let forward_args = [prefix.a:name] | |
if has_key(a:opts, 'bang') | |
call add(forward_args, '<bang>') | |
endif | |
if has_key(a:opts, 'register') | |
call add(forward_args, ' <register>') | |
endif | |
if has_key(a:opts, 'nargs') | |
call add(forward_args, ' <args>') | |
endif | |
exe s:GetCommandPrefix(a:name, a:opts) | |
\ .' call remote#define#CommandBootstrap("'.a:host.'"' | |
\ . ', "'.a:method.'"' | |
\ . ', '.string(a:sync) | |
\ . ', "'.a:name.'"' | |
\ . ', '.string(a:opts).'' | |
\ . ', "'.join(forward_args, '').'"' | |
\ . ')' | |
endfunction | |
1 0.000005 function! remote#define#CommandBootstrap(host, method, sync, name, opts, forward) | |
let channel = remote#host#Require(a:host) | |
if channel | |
call remote#define#CommandOnChannel(channel, a:method, a:sync, a:name, a:opts) | |
exe a:forward | |
else | |
exe 'delcommand '.a:name | |
echoerr 'Host "'a:host.'" is not available, deleting command "'.a:name.'"' | |
endif | |
endfunction | |
1 0.000004 function! remote#define#CommandOnChannel(channel, method, sync, name, opts) | |
let rpcargs = [a:channel, '"'.a:method.'"'] | |
if has_key(a:opts, 'nargs') | |
" -nargs, pass arguments in a list | |
call add(rpcargs, '[<f-args>]') | |
endif | |
if has_key(a:opts, 'range') | |
if a:opts.range == '' || a:opts.range == '%' | |
" -range or -range=%, pass the line range in a list | |
call add(rpcargs, '[<line1>, <line2>]') | |
elseif matchstr(a:opts.range, '\d') != '' | |
" -range=N, pass the count | |
call add(rpcargs, '<count>') | |
endif | |
elseif has_key(a:opts, 'count') | |
" count | |
call add(rpcargs, '<count>') | |
endif | |
if has_key(a:opts, 'bang') | |
" bang | |
call add(rpcargs, '<q-bang> == "!"') | |
endif | |
if has_key(a:opts, 'register') | |
" register | |
call add(rpcargs, '<q-reg>') | |
endif | |
call s:AddEval(rpcargs, a:opts) | |
exe s:GetCommandPrefix(a:name, a:opts) | |
\ . ' call '.s:GetRpcFunction(a:sync).'('.join(rpcargs, ', ').')' | |
endfunction | |
1 0.000004 function! remote#define#AutocmdOnHost(host, method, sync, name, opts) | |
let group = s:GetNextAutocmdGroup() | |
let forward = '"doau '.group.' '.a:name.' ".' | |
\ . 'fnameescape(expand("<amatch>"))' | |
let a:opts.group = group | |
let bootstrap_def = s:GetAutocmdPrefix(a:name, a:opts) | |
\ .' call remote#define#AutocmdBootstrap("'.a:host.'"' | |
\ . ', "'.a:method.'"' | |
\ . ', '.string(a:sync) | |
\ . ', "'.a:name.'"' | |
\ . ', '.string(a:opts).'' | |
\ . ', "'.escape(forward, '"').'"' | |
\ . ')' | |
exe bootstrap_def | |
endfunction | |
1 0.000067 function! remote#define#AutocmdBootstrap(host, method, sync, name, opts, forward) | |
let channel = remote#host#Require(a:host) | |
exe 'autocmd! '.a:opts.group | |
if channel | |
call remote#define#AutocmdOnChannel(channel, a:method, a:sync, a:name, | |
\ a:opts) | |
exe eval(a:forward) | |
else | |
exe 'augroup! '.a:opts.group | |
echoerr 'Host "'a:host.'" for "'.a:name.'" autocmd is not available' | |
endif | |
endfunction | |
1 0.000005 function! remote#define#AutocmdOnChannel(channel, method, sync, name, opts) | |
let rpcargs = [a:channel, '"'.a:method.'"'] | |
call s:AddEval(rpcargs, a:opts) | |
let autocmd_def = s:GetAutocmdPrefix(a:name, a:opts) | |
\ . ' call '.s:GetRpcFunction(a:sync).'('.join(rpcargs, ', ').')' | |
exe autocmd_def | |
endfunction | |
1 0.000004 function! remote#define#FunctionOnHost(host, method, sync, name, opts) | |
let group = s:GetNextAutocmdGroup() | |
exe 'autocmd! '.group.' FuncUndefined '.a:name | |
\ .' call remote#define#FunctionBootstrap("'.a:host.'"' | |
\ . ', "'.a:method.'"' | |
\ . ', '.string(a:sync) | |
\ . ', "'.a:name.'"' | |
\ . ', '.string(a:opts) | |
\ . ', "'.group.'"' | |
\ . ')' | |
endfunction | |
1 0.000005 function! remote#define#FunctionBootstrap(host, method, sync, name, opts, group) | |
let channel = remote#host#Require(a:host) | |
exe 'autocmd! '.a:group | |
exe 'augroup! '.a:group | |
if channel | |
call remote#define#FunctionOnChannel(channel, a:method, a:sync, a:name, | |
\ a:opts) | |
else | |
echoerr 'Host "'a:host.'" for "'.a:name.'" function is not available' | |
endif | |
endfunction | |
1 0.000004 function! remote#define#FunctionOnChannel(channel, method, sync, name, opts) | |
let rpcargs = [a:channel, '"'.a:method.'"', 'a:000'] | |
if has_key(a:opts, 'range') | |
call add(rpcargs, '[a:firstline, a:lastline]') | |
endif | |
call s:AddEval(rpcargs, a:opts) | |
let function_def = s:GetFunctionPrefix(a:name, a:opts) | |
\ . 'return '.s:GetRpcFunction(a:sync).'('.join(rpcargs, ', ').')' | |
\ . "\nendfunction" | |
exe function_def | |
endfunction | |
1 0.000005 function! s:GetRpcFunction(sync) | |
if a:sync | |
return 'rpcrequest' | |
endif | |
return 'rpcnotify' | |
endfunction | |
1 0.000003 function! s:GetCommandPrefix(name, opts) | |
return 'command!'.s:StringifyOpts(a:opts, ['nargs', 'complete', 'range', | |
\ 'count', 'bang', 'bar', 'register']).' '.a:name | |
endfunction | |
" Each msgpack-rpc autocommand has it's own unique group, which is derived | |
" from an autoincrementing gid(group id). This is required for replacing the | |
" autocmd implementation with the lazy-load mechanism | |
1 0.000006 let s:next_gid = 1 | |
1 0.000003 function! s:GetNextAutocmdGroup() | |
let gid = s:next_gid | |
let s:next_gid += 1 | |
let group_name = 'RPC_DEFINE_AUTOCMD_GROUP_'.gid | |
" Ensure the group is defined | |
exe 'augroup '.group_name.' | augroup END' | |
return group_name | |
endfunction | |
1 0.000002 function! s:GetAutocmdPrefix(name, opts) | |
if has_key(a:opts, 'group') | |
let group = a:opts.group | |
else | |
let group = s:GetNextAutocmdGroup() | |
endif | |
let rv = ['autocmd!', group, a:name] | |
if has_key(a:opts, 'pattern') | |
call add(rv, a:opts.pattern) | |
else | |
call add(rv, '*') | |
endif | |
if has_key(a:opts, 'nested') && a:opts.nested | |
call add(rv, 'nested') | |
endif | |
return join(rv, ' ') | |
endfunction | |
1 0.000003 function! s:GetFunctionPrefix(name, opts) | |
let res = "function! ".a:name."(...)" | |
if has_key(a:opts, 'range') | |
let res = res." range" | |
endif | |
return res."\n" | |
endfunction | |
1 0.000002 function! s:StringifyOpts(opts, keys) | |
let rv = [] | |
for key in a:keys | |
if has_key(a:opts, key) | |
call add(rv, ' -'.key) | |
let val = a:opts[key] | |
if type(val) != type('') || val != '' | |
call add(rv, '='.val) | |
endif | |
endif | |
endfor | |
return join(rv, '') | |
endfunction | |
1 0.000004 function! s:AddEval(rpcargs, opts) | |
if has_key(a:opts, 'eval') | |
if type(a:opts.eval) != type('') || a:opts.eval == '' | |
throw "Eval option must be a non-empty string" | |
endif | |
" evaluate an expression and pass as argument | |
call add(a:rpcargs, 'eval("'.escape(a:opts.eval, '"').'")') | |
endif | |
endfunction | |
SCRIPT /usr/share/nvim/runtime/plugin/rrhelper.vim | |
Sourced 1 time | |
Total time: 0.000025 | |
Self time: 0.000025 | |
count total (s) self (s) | |
" Vim plugin with helper function(s) for --remote-wait | |
" Maintainer: Flemming Madsen <fma@cci.dk> | |
" Last Change: 2008 May 29 | |
" Has this already been loaded? | |
1 0.000017 if exists("loaded_rrhelper") || !has("clientserver") | |
1 0.000002 finish | |
SCRIPT /usr/share/nvim/runtime/plugin/shada.vim | |
Sourced 1 time | |
Total time: 0.000651 | |
Self time: 0.000651 | |
count total (s) self (s) | |
if exists('g:loaded_shada_plugin') | |
finish | |
endif | |
1 0.000005 let g:loaded_shada_plugin = 1 | |
1 0.000005 augroup ShaDaCommands | |
1 0.000108 autocmd! | |
1 0.000029 autocmd BufReadCmd *.shada,*.shada.tmp.[a-z] | |
\ :if !empty(v:cmdarg)|throw '++opt not supported'|endif | |
\ |call setline('.', shada#get_strings(readfile(expand('<afile>'),'b'))) | |
\ |setlocal filetype=shada | |
1 0.000013 autocmd FileReadCmd *.shada,*.shada.tmp.[a-z] | |
\ :if !empty(v:cmdarg)|throw '++opt not supported'|endif | |
\ |call append("'[", shada#get_strings(readfile(expand('<afile>'), 'b'))) | |
1 0.000417 autocmd BufWriteCmd *.shada,*.shada.tmp.[a-z] | |
\ :if !empty(v:cmdarg)|throw '++opt not supported'|endif | |
\ |if writefile(shada#get_binstrings(getline(1, '$')), | |
\expand('<afile>'), 'b') == 0 | |
\ | let &l:modified = (expand('<afile>') is# bufname(+expand('<abuf>')) | |
\? 0 | |
\: stridx(&cpoptions, '+') != -1) | |
\ |endif | |
1 0.000020 autocmd FileWriteCmd *.shada,*.shada.tmp.[a-z] | |
\ :if !empty(v:cmdarg)|throw '++opt not supported'|endif | |
\ |call writefile( | |
\shada#get_binstrings(getline(min([line("'["), line("']")]), | |
\max([line("'["), line("']")]))), | |
\expand('<afile>'), | |
\'b') | |
1 0.000013 autocmd FileAppendCmd *.shada,*.shada.tmp.[a-z] | |
\ :if !empty(v:cmdarg)|throw '++opt not supported'|endif | |
\ |call writefile( | |
\shada#get_binstrings(getline(min([line("'["), line("']")]), | |
\max([line("'["), line("']")]))), | |
\expand('<afile>'), | |
\'ab') | |
1 0.000011 autocmd SourceCmd *.shada,*.shada.tmp.[a-z] | |
\ :execute 'rshada' fnameescape(expand('<afile>')) | |
1 0.000004 augroup END | |
SCRIPT /usr/share/nvim/runtime/plugin/spellfile.vim | |
Sourced 1 time | |
Total time: 0.000331 | |
Self time: 0.000331 | |
count total (s) self (s) | |
" Vim plugin for downloading spell files | |
1 0.000250 if exists("loaded_spellfile_plugin") || &cp || exists("#SpellFileMissing") | |
finish | |
endif | |
1 0.000006 let loaded_spellfile_plugin = 1 | |
1 0.000057 autocmd SpellFileMissing * call spellfile#LoadFile(expand('<amatch>')) | |
SCRIPT /usr/share/nvim/runtime/plugin/tarPlugin.vim | |
Sourced 1 time | |
Total time: 0.000443 | |
Self time: 0.000443 | |
count total (s) self (s) | |
" tarPlugin.vim -- a Vim plugin for browsing tarfiles | |
" Original was copyright (c) 2002, Michael C. Toren <mct@toren.net> | |
" Modified by Charles E. Campbell | |
" Distributed under the GNU General Public License. | |
" | |
" Updates are available from <http://michael.toren.net/code/>. If you | |
" find this script useful, or have suggestions for improvements, please | |
" let me know. | |
" Also look there for further comments and documentation. | |
" | |
" This part only sets the autocommands. The functions are in autoload/tar.vim. | |
" --------------------------------------------------------------------- | |
" Load Once: {{{1 | |
1 0.000022 if &cp || exists("g:loaded_tarPlugin") | |
finish | |
endif | |
1 0.000005 let g:loaded_tarPlugin = "v29" | |
1 0.000008 let s:keepcpo = &cpo | |
1 0.000068 set cpo&vim | |
" --------------------------------------------------------------------- | |
" Public Interface: {{{1 | |
1 0.000006 augroup tar | |
1 0.000026 au! | |
1 0.000081 au BufReadCmd tarfile::* call tar#Read(expand("<amatch>"), 1) | |
1 0.000011 au FileReadCmd tarfile::* call tar#Read(expand("<amatch>"), 0) | |
1 0.000006 au BufWriteCmd tarfile::* call tar#Write(expand("<amatch>")) | |
1 0.000006 au FileWriteCmd tarfile::* call tar#Write(expand("<amatch>")) | |
1 0.000005 if has("unix") | |
1 0.000007 au BufReadCmd tarfile::*/* call tar#Read(expand("<amatch>"), 1) | |
1 0.000006 au FileReadCmd tarfile::*/* call tar#Read(expand("<amatch>"), 0) | |
1 0.000005 au BufWriteCmd tarfile::*/* call tar#Write(expand("<amatch>")) | |
1 0.000005 au FileWriteCmd tarfile::*/* call tar#Write(expand("<amatch>")) | |
1 0.000001 endif | |
1 0.000006 au BufReadCmd *.tar.gz call tar#Browse(expand("<amatch>")) | |
1 0.000005 au BufReadCmd *.tar call tar#Browse(expand("<amatch>")) | |
1 0.000004 au BufReadCmd *.lrp call tar#Browse(expand("<amatch>")) | |
1 0.000068 au BufReadCmd *.tar.bz2 call tar#Browse(expand("<amatch>")) | |
1 0.000006 au BufReadCmd *.tar.Z call tar#Browse(expand("<amatch>")) | |
1 0.000004 au BufReadCmd *.tgz call tar#Browse(expand("<amatch>")) | |
1 0.000005 au BufReadCmd *.tar.lzma call tar#Browse(expand("<amatch>")) | |
1 0.000005 au BufReadCmd *.tar.xz call tar#Browse(expand("<amatch>")) | |
1 0.000004 au BufReadCmd *.txz call tar#Browse(expand("<amatch>")) | |
1 0.000002 augroup END | |
1 0.000015 com! -nargs=? -complete=file Vimuntar call tar#Vimuntar(<q-args>) | |
" --------------------------------------------------------------------- | |
" Restoration And Modelines: {{{1 | |
" vim: fdm=marker | |
1 0.000012 let &cpo= s:keepcpo | |
1 0.000007 unlet s:keepcpo | |
SCRIPT /usr/share/nvim/runtime/plugin/tohtml.vim | |
Sourced 1 time | |
Total time: 0.000215 | |
Self time: 0.000215 | |
count total (s) self (s) | |
" Vim plugin for converting a syntax highlighted file to HTML. | |
" Maintainer: Ben Fritz <fritzophrenic@gmail.com> | |
" Last Change: 2015 Sep 08 | |
" | |
" The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and | |
" $VIMRUNTIME/syntax/2html.vim | |
" | |
" TODO: {{{ | |
" * Options for generating the CSS in external style sheets. New :TOcss | |
" command to convert the current color scheme into a (mostly) generic CSS | |
" stylesheet which can be re-used. Alternate stylesheet support? Good start | |
" by Erik Falor | |
" ( https://groups.google.com/d/topic/vim_use/7XTmC4D22dU/discussion ). | |
" * Add optional argument to :TOhtml command to specify mode (gui, cterm, | |
" term) to use for the styling. Suggestion by "nacitar". | |
" * Add way to override or specify which RGB colors map to the color numbers | |
" in cterm. Get better defaults than just guessing? Suggestion by "nacitar". | |
" * Disable filetype detection until after all processing is done. | |
" * Add option for not generating the hyperlink on stuff that looks like a | |
" URL? Or just color the link to fit with the colorscheme (and only special | |
" when hovering)? | |
" * Bug: Opera does not allow printing more than one page if uncopyable | |
" regions is turned on. Possible solution: Add normal text line numbers with | |
" display:none, set to display:inline for print style sheets, and hide | |
" <input> elements for print, to allow Opera printing multiple pages (and | |
" other uncopyable areas?). May need to make the new text invisible to IE | |
" with conditional comments to prevent copying it, IE for some reason likes | |
" to copy hidden text. Other browsers too? | |
" * Bug: still a 1px gap throughout the fold column when html_prevent_copy is | |
" "fn" in some browsers. Specifically, in Chromium on Ubuntu (but not Chrome | |
" on Windows). Perhaps it is font related? | |
" * Bug: still some gaps in the fold column when html_prevent_copy contains | |
" 'd' and showing the whole diff (observed in multiple browsers). Only gaps | |
" on diff lines though. | |
" * Undercurl support via CSS3, with fallback to dotted or something: | |
" https://groups.google.com/d/topic/vim_use/BzXA6He1pHg/discussion | |
" * Redo updates for modified default foldtext (v11) when/if the patch is | |
" accepted to modify it. | |
" * Test case +diff_one_file-dynamic_folds+expand_tabs-hover_unfold | |
" +ignore_conceal-ignore_folding+no_foldcolumn+no_pre+no_progress | |
" +number_lines-pre_wrap-use_css+use_xhtml+whole_filler.xhtml | |
" does not show the whole diff filler as it is supposed to? | |
" * Bug: when 'isprint' is wrong for the current encoding, will generate | |
" invalid content. Can/should anything be done about this? Maybe a separate | |
" plugin to correct 'isprint' based on encoding? | |
" * Check to see if the windows-125\d encodings actually work in Unix without | |
" the 8bit- prefix. Add prefix to autoload dictionaries for Unix if not. | |
" * Font auto-detection similar to | |
" http://www.vim.org/scripts/script.php?script_id=2384 but for a variety of | |
" platforms. | |
" * Error thrown when sourcing 2html.vim directly when plugins are not loaded. | |
" * Pull in code from http://www.vim.org/scripts/script.php?script_id=3113 : | |
" - listchars support | |
" - full-line background highlight | |
" - other? | |
" * Make it so deleted lines in a diff don't create side-scrolling (get it | |
" free with full-line background highlight above). | |
" * Restore open/closed folds and cursor position after processing each file | |
" with option not to restore for speed increase. | |
" * Add extra meta info (generation time, etc.)? | |
" * Tidy up so we can use strict doctype in even more situations | |
" * Implementation detail: add threshold for writing the lines to the html | |
" buffer before we're done (5000 or so lines should do it) | |
" * TODO comments for code cleanup scattered throughout | |
"}}} | |
1 0.000015 if exists('g:loaded_2html_plugin') | |
finish | |
endif | |
1 0.000005 let g:loaded_2html_plugin = 'vim7.4_v2' | |
" | |
" Changelog: {{{ | |
" 7.4_v2 (this version): Fix error raised when converting a diff containing | |
" an empty buffer. Jan Stocker: allow g:html_font to | |
" take a list so it is easier to specfiy fallback | |
" fonts in the generated CSS. | |
" 7.4_v1 (Vim 7.4.0000): Fix modeline mangling for new "Vim:" format, and | |
" also for version-specific modelines like "vim>703:". | |
" | |
" 7.3 updates: {{{ | |
" 7.3_v14 (Vim 7.3.1246): Allow suppressing line number anchors using | |
" g:html_line_ids=0. Allow customizing | |
" important IDs (like line IDs and fold IDs) using | |
" g:html_id_expr evalutated when the buffer conversion | |
" is started. | |
" 7.3_v13 (Vim 7.3.1088): Keep foldmethod at manual in the generated file and | |
" insert modeline to set it to manual. | |
" Fix bug: diff mode with 2 unsaved buffers creates a | |
" duplicate of one buffer instead of including both. | |
" Add anchors to each line so you can put '#L123' | |
" or '#123' at the end of the URL to jump to line 123 | |
" (idea by Andy Spencer). Add javascript to open folds | |
" to show the anchor being jumped to if it is hidden. | |
" Fix XML validation error: &nsbp; not part of XML. | |
" Allow TOhtml to chain together with other commands | |
" using |. | |
" 7.3_v12 (Vim 7.3.0616): Fix modeline mangling to also work for when multiple | |
" highlight groups make up the start-of-modeline text. | |
" Improve render time of page with uncopyable regions | |
" by not using one-input-per-char. Change name of | |
" uncopyable option from html_unselectable to | |
" html_prevent_copy. Added html_no_invalid option and | |
" default to inserting invalid markup for uncopyable | |
" regions to prevent MS Word from pasting undeletable | |
" <input> elements. Fix 'cpo' handling (Thilo Six). | |
" 7.3_v12b1: Add html_unselectable option. Rework logic to | |
" eliminate post-processing substitute commands in | |
" favor of doing the work up front. Remove unnecessary | |
" special treatment of 'LineNr' highlight group. Minor | |
" speed improvements. Fix modeline mangling in | |
" generated output so it works for text in the first | |
" column. Fix missing line number and fold column in | |
" diff filler lines. Fix that some fonts have a 1px | |
" gap (using a dirty hack, improvements welcome). Add | |
" "colorscheme" meta tag. Does NOT include support for | |
" the new default foldtext added in v11, as the patch | |
" adding it has not yet been included in Vim. | |
" 7.3_v11 ( unreleased ): Support new default foldtext from patch by Christian | |
" Brabandt in | |
" http://groups.google.com/d/topic/vim_dev/B6FSGfq9VoI/discussion. | |
" This patch has not yet been included in Vim, thus | |
" these changes are removed in the next version. | |
" 7.3_v10 (Vim 7.3.0227): Fix error E684 when converting a range wholly inside | |
" multiple nested folds with dynamic folding on. | |
" Also fix problem with foldtext in this situation. | |
" 7.3_v9 (Vim 7.3.0170): Add html_pre_wrap option active with html_use_css | |
" and without html_no_pre, default value same as | |
" 'wrap' option, (Andy Spencer). Don't use | |
" 'fileencoding' for converted document encoding if | |
" 'buftype' indicates a special buffer which isn't | |
" written. | |
" 7.3_v8 (Vim 7.3.0100): Add html_expand_tabs option to allow leaving tab | |
" characters in generated output (Andy Spencer). | |
" Escape text that looks like a modeline so Vim | |
" doesn't use anything in the converted HTML as a | |
" modeline. Bugfixes: Fix folding when a fold starts | |
" before the conversion range. Remove fold column when | |
" there are no folds. | |
" 7.3_v7 (Vim 7-3-0063): see betas released on vim_dev below: | |
" 7.3_v7b3: Fixed bug, convert Unicode to UTF-8 all the way. | |
" 7.3_v7b2: Remove automatic detection of encodings that are not | |
" supported by all major browsers according to | |
" http://wiki.whatwg.org/wiki/Web_Encodings and | |
" convert to UTF-8 for all Unicode encodings. Make | |
" HTML encoding to Vim encoding detection be | |
" case-insensitive for built-in pairs. | |
" 7.3_v7b1: Remove use of setwinvar() function which cannot be | |
" called in restricted mode (Andy Spencer). Use | |
" 'fencoding' instead of 'encoding' to determine by | |
" charset, and make sure the 'fenc' of the generated | |
" file matches its indicated charset. Add charsets for | |
" all of Vim's natively supported encodings. | |
" 7.3_v6 (Vim 7.3.0000): Really fix bug with 'nowrapscan', 'magic' and other | |
" user settings interfering with diff mode generation, | |
" trailing whitespace (e.g. line number column) when | |
" using html_no_pre, and bugs when using | |
" html_hover_unfold. | |
" 7.3_v5 ( unreleased ): Fix bug with 'nowrapscan' and also with out-of-sync | |
" folds in diff mode when first line was folded. | |
" 7.3_v4 (Vim 7.3.0000): Bugfixes, especially for xhtml markup, and diff mode | |
" 7.3_v3 (Vim 7.3.0000): Refactor option handling and make html_use_css | |
" default to true when not set to anything. Use strict | |
" doctypes where possible. Rename use_xhtml option to | |
" html_use_xhtml for consistency. Use .xhtml extension | |
" when using this option. Add meta tag for settings. | |
" 7.3_v2 (Vim 7.3.0000): Fix syntax highlighting in diff mode to use both the | |
" diff colors and the normal syntax colors | |
" 7.3_v1 (Vim 7.3.0000): Add conceal support and meta tags in output | |
"}}} | |
"}}} | |
" Define the :TOhtml command when: | |
" - 'compatible' is not set | |
" - this plugin was not already loaded | |
" - user commands are available. {{{ | |
1 0.000022 if !&cp && !exists(":TOhtml") && has("user_commands") | |
1 0.000015 command -range=% -bar TOhtml :call tohtml#Convert2HTML(<line1>, <line2>) | |
1 0.000001 endif "}}} | |
" Make sure any patches will probably use consistent indent | |
" vim: ts=8 sw=2 sts=2 noet fdm=marker | |
SCRIPT /usr/share/nvim/runtime/plugin/tutor.vim | |
Sourced 1 time | |
Total time: 0.000040 | |
Self time: 0.000040 | |
count total (s) self (s) | |
if exists('g:loaded_tutor_mode_plugin') || &compatible | |
finish | |
endif | |
1 0.000005 let g:loaded_tutor_mode_plugin = 1 | |
1 0.000018 command! -nargs=? -complete=custom,tutor#TutorCmdComplete Tutor call tutor#TutorCmd(<q-args>) | |
SCRIPT /usr/share/nvim/runtime/plugin/zipPlugin.vim | |
Sourced 1 time | |
Total time: 0.000211 | |
Self time: 0.000211 | |
count total (s) self (s) | |
" zipPlugin.vim: Handles browsing zipfiles | |
" PLUGIN PORTION | |
" Date: Sep 13, 2016 | |
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> | |
" License: Vim License (see vim's :help license) | |
" Copyright: Copyright (C) 2005-2016 Charles E. Campbell {{{1 | |
" Permission is hereby granted to use and distribute this code, | |
" with or without modifications, provided that this copyright | |
" notice is copied with it. Like anything else that's free, | |
" zipPlugin.vim is provided *as is* and comes with no warranty | |
" of any kind, either expressed or implied. By using this | |
" plugin, you agree that in no event will the copyright | |
" holder be liable for any damages resulting from the use | |
" of this software. | |
" | |
" (James 4:8 WEB) Draw near to God, and he will draw near to you. | |
" Cleanse your hands, you sinners; and purify your hearts, you double-minded. | |
" --------------------------------------------------------------------- | |
" Load Once: {{{1 | |
1 0.000014 if &cp || exists("g:loaded_zipPlugin") | |
finish | |
endif | |
1 0.000003 let g:loaded_zipPlugin = "v28" | |
1 0.000006 let s:keepcpo = &cpo | |
1 0.000008 set cpo&vim | |
" --------------------------------------------------------------------- | |
" Options: {{{1 | |
1 0.000003 if !exists("g:zipPlugin_ext") | |
1 0.000005 let g:zipPlugin_ext='*.apk,*.celzip,*.crtx,*.docm,*.docx,*.dotm,*.dotx,*.ear,*.epub,*.gcsx,*.glox,*.gqsx,*.ja,*.jar,*.kmz,*.oxt,*.potm,*.potx,*.ppam,*.ppsm,*.ppsx,*.pptm,*.pptx,*.sldx,*.thmx,*.vdw,*.war,*.wsz,*.xap,*.xlam,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip' | |
1 0.000001 endif | |
" --------------------------------------------------------------------- | |
" Public Interface: {{{1 | |
1 0.000003 augroup zip | |
1 0.000024 au! | |
1 0.000011 au BufReadCmd zipfile:* call zip#Read(expand("<amatch>"), 1) | |
1 0.000006 au FileReadCmd zipfile:* call zip#Read(expand("<amatch>"), 0) | |
1 0.000009 au BufWriteCmd zipfile:* call zip#Write(expand("<amatch>")) | |
1 0.000005 au FileWriteCmd zipfile:* call zip#Write(expand("<amatch>")) | |
1 0.000004 if has("unix") | |
1 0.000008 au BufReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 1) | |
1 0.000006 au FileReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 0) | |
1 0.000006 au BufWriteCmd zipfile:*/* call zip#Write(expand("<amatch>")) | |
1 0.000005 au FileWriteCmd zipfile:*/* call zip#Write(expand("<amatch>")) | |
1 0.000001 endif | |
1 0.000053 exe "au BufReadCmd ".g:zipPlugin_ext.' call zip#Browse(expand("<amatch>"))' | |
1 0.000002 augroup END | |
" --------------------------------------------------------------------- | |
" Restoration And Modelines: {{{1 | |
" vim: fdm=marker | |
1 0.000007 let &cpo= s:keepcpo | |
1 0.000003 unlet s:keepcpo | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/after/plugin/ale.vim | |
Sourced 2 times | |
Total time: 0.000083 | |
Self time: 0.000083 | |
count total (s) self (s) | |
" Author: w0rp <devw0rp@gmail.com> | |
" Description: Follow-up checks for the plugin: warn about conflicting plugins. | |
" A flag for ensuring that this is not run more than one time. | |
2 0.000028 if exists('g:loaded_ale_after') | |
1 0.000002 finish | |
endif | |
" Set the flag so this file is not run more than one time. | |
1 0.000003 let g:loaded_ale_after = 1 | |
" Check if the flag is available and set to 0 to disable checking for and | |
" emitting conflicting plugin warnings. | |
1 0.000004 if exists('g:ale_emit_conflict_warnings') && !g:ale_emit_conflict_warnings | |
finish | |
endif | |
" Conflicting Plugins Checks | |
1 0.000006 function! s:GetConflictingPluginWarning(plugin_name) abort | |
return 'ALE conflicts with ' . a:plugin_name | |
\ . '. Uninstall it, or disable this warning with ' | |
\ . '`let g:ale_emit_conflict_warnings = 0` in your vimrc file, ' | |
\ . '*before* plugins are loaded.' | |
endfunction | |
1 0.000002 if exists('g:loaded_syntastic_plugin') | |
throw s:GetConflictingPluginWarning('Syntastic') | |
endif | |
1 0.000002 if exists('g:loaded_neomake') | |
throw s:GetConflictingPluginWarning('Neomake') | |
endif | |
1 0.000002 if exists('g:loaded_validator_plugin') | |
throw s:GetConflictingPluginWarning('Validator') | |
endif | |
SCRIPT /usr/share/nvim/runtime/ftplugin/php.vim | |
Sourced 1 time | |
Total time: 0.007967 | |
Self time: 0.003331 | |
count total (s) self (s) | |
" Vim filetype plugin file | |
" Language: php | |
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> | |
" Last Changed: 20 Jan 2009 | |
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin | |
1 0.000013 if exists("b:did_ftplugin") | finish | endif | |
" Make sure the continuation lines below do not cause problems in | |
" compatibility mode. | |
1 0.000011 let s:keepcpo= &cpo | |
1 0.000010 set cpo&vim | |
" Define some defaults in case the included ftplugins don't set them. | |
1 0.000003 let s:undo_ftplugin = "" | |
1 0.000005 let s:browsefilter = "HTML Files (*.html, *.htm)\t*.html;*.htm\n" . | |
\ "All Files (*.*)\t*.*\n" | |
1 0.000002 let s:match_words = "" | |
1 0.001266 runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim | |
1 0.000011 let b:did_ftplugin = 1 | |
" Override our defaults if these were set by an included ftplugin. | |
1 0.000008 if exists("b:undo_ftplugin") | |
1 0.000004 let s:undo_ftplugin = b:undo_ftplugin | |
1 0.000002 endif | |
1 0.000003 if exists("b:browsefilter") | |
let s:browsefilter = b:browsefilter | |
endif | |
1 0.000003 if exists("b:match_words") | |
1 0.000003 let s:match_words = b:match_words | |
1 0.000001 endif | |
1 0.000002 if exists("b:match_skip") | |
unlet b:match_skip | |
endif | |
" Change the :browse e filter to primarily show PHP-related files. | |
1 0.000006 if has("gui_win32") | |
let b:browsefilter="PHP Files (*.php)\t*.php\n" . s:browsefilter | |
endif | |
" ### | |
" Provided by Mikolaj Machowski <mikmach at wp dot pl> | |
1 0.000008 setlocal include=\\\(require\\\|include\\\)\\\(_once\\\)\\\? | |
" Disabled changing 'iskeyword', it breaks a command such as "*" | |
" setlocal iskeyword+=$ | |
1 0.000003 if exists("loaded_matchit") | |
1 0.000166 let b:match_words = '<?php:?>,\<switch\>:\<endswitch\>,' . | |
\ '\<if\>:\<elseif\>:\<else\>:\<endif\>,' . | |
\ '\<while\>:\<endwhile\>,' . | |
\ '\<do\>:\<while\>,' . | |
\ '\<for\>:\<endfor\>,' . | |
\ '\<foreach\>:\<endforeach\>,' . | |
\ '(:),[:],{:},' . | |
\ s:match_words | |
1 0.000001 endif | |
" ### | |
1 0.000004 if exists('&omnifunc') | |
1 0.000004 setlocal omnifunc=phpcomplete#CompletePHP | |
1 0.000001 endif | |
" Section jumping: [[ and ]] provided by Antony Scriven <adscriven at gmail dot com> | |
1 0.000004 let s:function = '\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function' | |
1 0.000003 let s:class = '\(abstract\s\+\|final\s\+\)*class' | |
1 0.000002 let s:interface = 'interface' | |
1 0.000007 let s:section = '\(.*\%#\)\@!\_^\s*\zs\('.s:function.'\|'.s:class.'\|'.s:interface.'\)' | |
1 0.000062 exe 'nno <buffer> <silent> [[ ?' . escape(s:section, '|') . '?<CR>:nohls<CR>' | |
1 0.000033 exe 'nno <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>' | |
1 0.000190 exe 'ono <buffer> <silent> [[ ?' . escape(s:section, '|') . '?<CR>:nohls<CR>' | |
1 0.000239 exe 'ono <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>' | |
1 0.000005 setlocal commentstring=/*%s*/ | |
" Undo the stuff we changed. | |
1 0.000105 let b:undo_ftplugin = "setlocal commentstring< include< omnifunc<" . | |
\ " | unlet! b:browsefilter b:match_words | " . | |
\ s:undo_ftplugin | |
" Restore the saved compatibility options. | |
1 0.000014 let &cpo = s:keepcpo | |
1 0.000009 unlet s:keepcpo | |
SCRIPT /usr/share/nvim/runtime/ftplugin/html.vim | |
Sourced 1 time | |
Total time: 0.004621 | |
Self time: 0.001610 | |
count total (s) self (s) | |
" Vim filetype plugin file | |
" Language: html | |
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> | |
" Last Changed: 20 Jan 2009 | |
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin | |
1 0.000012 if exists("b:did_ftplugin") | finish | endif | |
1 0.000004 let b:did_ftplugin = 1 | |
" Make sure the continuation lines below do not cause problems in | |
" compatibility mode. | |
1 0.000010 let s:save_cpo = &cpo | |
1 0.000010 set cpo-=C | |
1 0.000004 setlocal matchpairs+=<:> | |
1 0.000003 setlocal commentstring=<!--%s--> | |
1 0.000003 setlocal comments=s:<!--,m:\ \ \ \ ,e:--> | |
1 0.000005 if exists("g:ft_html_autocomment") && (g:ft_html_autocomment == 1) | |
setlocal formatoptions-=t formatoptions+=croql | |
endif | |
1 0.000003 if exists('&omnifunc') | |
1 0.000003 setlocal omnifunc=htmlcomplete#CompleteTags | |
1 0.001196 call htmlcomplete#DetectOmniFlavor() | |
1 0.000117 endif | |
" HTML: thanks to Johannes Zellner and Benji Fisher. | |
1 0.000006 if exists("loaded_matchit") | |
1 0.000004 let b:match_ignorecase = 1 | |
1 0.000009 let b:match_words = '<:>,' . | |
\ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' . | |
\ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' . | |
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' | |
1 0.000001 endif | |
" Change the :browse e filter to primarily show HTML-related files. | |
1 0.000009 if has("gui_win32") | |
let b:browsefilter="HTML Files (*.html,*.htm)\t*.htm;*.html\n" . | |
\ "JavaScript Files (*.js)\t*.js\n" . | |
\ "Cascading StyleSheets (*.css)\t*.css\n" . | |
\ "All Files (*.*)\t*.*\n" | |
endif | |
" Undo the stuff we changed. | |
1 0.000005 let b:undo_ftplugin = "setlocal commentstring< matchpairs< omnifunc< comments< formatoptions<" . | |
\ " | unlet! b:match_ignorecase b:match_skip b:match_words b:browsefilter" | |
" Restore the saved compatibility options. | |
1 0.000013 let &cpo = s:save_cpo | |
1 0.000006 unlet s:save_cpo | |
SCRIPT /usr/share/nvim/runtime/autoload/htmlcomplete.vim | |
Sourced 1 time | |
Total time: 0.002141 | |
Self time: 0.002141 | |
count total (s) self (s) | |
" Vim completion script | |
" Language: HTML and XHTML | |
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) | |
" Last Change: 2014 Jun 20 | |
" Distinguish between HTML versions. | |
" To use with other HTML versions add another "elseif" condition to match | |
" proper DOCTYPE. | |
1 0.000009 function! htmlcomplete#DetectOmniFlavor() | |
if &filetype == 'xhtml' | |
let b:html_omni_flavor = 'xhtml10s' | |
else | |
let b:html_omni_flavor = 'html401t' | |
endif | |
let i = 1 | |
let line = "" | |
while i < 10 && i < line("$") | |
let line = getline(i) | |
if line =~ '<!DOCTYPE.*\<DTD ' | |
break | |
endif | |
let i += 1 | |
endwhile | |
if line =~ '<!DOCTYPE.*\<DTD ' " doctype line found above | |
if line =~ ' HTML 3\.2' | |
let b:html_omni_flavor = 'html32' | |
elseif line =~ ' XHTML 1\.1' | |
let b:html_omni_flavor = 'xhtml11' | |
else " two-step detection with strict/frameset/transitional | |
if line =~ ' XHTML 1\.0' | |
let b:html_omni_flavor = 'xhtml10' | |
elseif line =~ ' HTML 4\.01' | |
let b:html_omni_flavor = 'html401' | |
elseif line =~ ' HTML 4.0\>' | |
let b:html_omni_flavor = 'html40' | |
endif | |
if line =~ '\<Transitional\>' | |
let b:html_omni_flavor .= 't' | |
elseif line =~ '\<Frameset\>' | |
let b:html_omni_flavor .= 'f' | |
else | |
let b:html_omni_flavor .= 's' | |
endif | |
endif | |
endif | |
endfunction | |
1 0.000004 function! htmlcomplete#CompleteTags(findstart, base) | |
if a:findstart | |
" locate the start of the word | |
let line = getline('.') | |
let start = col('.') - 1 | |
let curline = line('.') | |
let compl_begin = col('.') - 2 | |
while start >= 0 && line[start - 1] =~ '\(\k\|[!:.-]\)' | |
let start -= 1 | |
endwhile | |
" Handling of entities {{{ | |
if start >= 0 && line[start - 1] =~ '&' | |
let b:entitiescompl = 1 | |
let b:compl_context = '' | |
return start | |
endif | |
" }}} | |
" Handling of <style> tag {{{ | |
let stylestart = searchpair('<style\>', '', '<\/style\>', "bnW") | |
let styleend = searchpair('<style\>', '', '<\/style\>', "nW") | |
if stylestart != 0 && styleend != 0 | |
if stylestart <= curline && styleend >= curline | |
let start = col('.') - 1 | |
let b:csscompl = 1 | |
while start >= 0 && line[start - 1] =~ '\(\k\|-\)' | |
let start -= 1 | |
endwhile | |
endif | |
endif | |
" }}} | |
" Handling of <script> tag {{{ | |
let scriptstart = searchpair('<script\>', '', '<\/script\>', "bnW") | |
let scriptend = searchpair('<script\>', '', '<\/script\>', "nW") | |
if scriptstart != 0 && scriptend != 0 | |
if scriptstart <= curline && scriptend >= curline | |
let start = col('.') - 1 | |
let b:jscompl = 1 | |
let b:jsrange = [scriptstart, scriptend] | |
while start >= 0 && line[start - 1] =~ '\k' | |
let start -= 1 | |
endwhile | |
" We are inside of <script> tag. But we should also get contents | |
" of all linked external files and (secondary, less probably) other <script> tags | |
" This logic could possible be done in separate function - may be | |
" reused in events scripting (also with option could be reused for | |
" CSS | |
let b:js_extfiles = [] | |
let l = line('.') | |
let c = col('.') | |
call cursor(1,1) | |
while search('<\@<=script\>', 'W') && line('.') <= l | |
if synIDattr(synID(line('.'),col('.')-1,0),"name") !~? 'comment' | |
let sname = matchstr(getline('.'), '<script[^>]*src\s*=\s*\([''"]\)\zs.\{-}\ze\1') | |
if filereadable(sname) | |
let b:js_extfiles += readfile(sname) | |
endif | |
endif | |
endwhile | |
call cursor(1,1) | |
let js_scripttags = [] | |
while search('<script\>', 'W') && line('.') < l | |
if matchstr(getline('.'), '<script[^>]*src') == '' | |
let js_scripttag = getline(line('.'), search('</script>', 'W')) | |
let js_scripttags += js_scripttag | |
endif | |
endwhile | |
let b:js_extfiles += js_scripttags | |
call cursor(l,c) | |
unlet! l c | |
endif | |
endif | |
" }}} | |
if !exists("b:csscompl") && !exists("b:jscompl") | |
let b:compl_context = getline('.')[0:(compl_begin)] | |
if b:compl_context !~ '<[^>]*$' | |
" Look like we may have broken tag. Check previous lines. | |
let i = 1 | |
while 1 | |
let context_line = getline(curline-i) | |
if context_line =~ '<[^>]*$' | |
" Yep, this is this line | |
let context_lines = getline(curline-i, curline-1) + [b:compl_context] | |
let b:compl_context = join(context_lines, ' ') | |
break | |
elseif context_line =~ '>[^<]*$' || i == curline | |
" We are in normal tag line, no need for completion at all | |
" OR reached first line without tag at all | |
let b:compl_context = '' | |
break | |
endif | |
let i += 1 | |
endwhile | |
" Make sure we don't have counter | |
unlet! i | |
endif | |
let b:compl_context = matchstr(b:compl_context, '.*\zs<.*') | |
" Return proper start for on-events. Without that beginning of | |
" completion will be badly reported | |
if b:compl_context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$' | |
let start = col('.') - 1 | |
while start >= 0 && line[start - 1] =~ '\k' | |
let start -= 1 | |
endwhile | |
endif | |
" If b:compl_context begins with <? we are inside of PHP code. It | |
" wasn't closed so PHP completion passed it to HTML | |
if &filetype =~? 'php' && b:compl_context =~ '^<?' | |
let b:phpcompl = 1 | |
let start = col('.') - 1 | |
while start >= 0 && line[start - 1] =~ '[a-zA-Z_0-9\x7f-\xff$]' | |
let start -= 1 | |
endwhile | |
endif | |
else | |
let b:compl_context = getline('.')[0:compl_begin] | |
endif | |
return start | |
else | |
" Initialize base return lists | |
let res = [] | |
let res2 = [] | |
" a:base is very short - we need context | |
let context = b:compl_context | |
" Check if we should do CSS completion inside of <style> tag | |
" or JS completion inside of <script> tag or PHP completion in case of <? | |
" tag AND &ft==php | |
if exists("b:csscompl") | |
unlet! b:csscompl | |
let context = b:compl_context | |
unlet! b:compl_context | |
return csscomplete#CompleteCSS(0, context) | |
elseif exists("b:jscompl") | |
unlet! b:jscompl | |
return javascriptcomplete#CompleteJS(0, a:base) | |
elseif exists("b:phpcompl") | |
unlet! b:phpcompl | |
let context = b:compl_context | |
return phpcomplete#CompletePHP(0, a:base) | |
else | |
if len(b:compl_context) == 0 && !exists("b:entitiescompl") | |
return [] | |
endif | |
let context = matchstr(b:compl_context, '.\zs.*') | |
endif | |
unlet! b:compl_context | |
" Entities completion {{{ | |
if exists("b:entitiescompl") | |
unlet! b:entitiescompl | |
if !exists("b:html_doctype") | |
call htmlcomplete#CheckDoctype() | |
endif | |
if !exists("b:html_omni") | |
"runtime! autoload/xml/xhtml10s.vim | |
call htmlcomplete#LoadData() | |
endif | |
let entities = b:html_omni['vimxmlentities'] | |
if len(a:base) == 1 | |
for m in entities | |
if m =~ '^'.a:base | |
call add(res, m.';') | |
endif | |
endfor | |
return res | |
else | |
for m in entities | |
if m =~? '^'.a:base | |
call add(res, m.';') | |
elseif m =~? a:base | |
call add(res2, m.';') | |
endif | |
endfor | |
return res + res2 | |
endif | |
endif | |
" }}} | |
if context =~ '>' | |
" Generally if context contains > it means we are outside of tag and | |
" should abandon action - with one exception: <style> span { bo | |
if context =~ 'style[^>]\{-}>[^<]\{-}$' | |
return csscomplete#CompleteCSS(0, context) | |
elseif context =~ 'script[^>]\{-}>[^<]\{-}$' | |
let b:jsrange = [line('.'), search('<\/script\>', 'nW')] | |
return javascriptcomplete#CompleteJS(0, context) | |
else | |
return [] | |
endif | |
endif | |
" If context contains > it means we are already outside of tag and we | |
" should abandon action | |
" If context contains white space it is attribute. | |
" It can be also value of attribute. | |
" We have to get first word to offer proper completions | |
if context == '' | |
let tag = '' | |
else | |
let tag = split(context)[0] | |
" Detect if tag is uppercase to return in proper case, | |
" we need to make it lowercase for processing | |
if tag =~ '^[A-Z]*$' | |
let uppercase_tag = 1 | |
let tag = tolower(tag) | |
else | |
let uppercase_tag = 0 | |
endif | |
endif | |
" Get last word, it should be attr name | |
let attr = matchstr(context, '.*\s\zs.*') | |
" Possible situations where any prediction would be difficult: | |
" 1. Events attributes | |
if context =~ '\s' | |
" Sort out style, class, and on* cases | |
if context =~? "\\(on[a-z]*\\|id\\|style\\|class\\)\\s*=\\s*[\"']" | |
" Id, class completion {{{ | |
if context =~? "\\(id\\|class\\)\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$" | |
if context =~? "class\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$" | |
let search_for = "class" | |
elseif context =~? "id\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$" | |
let search_for = "id" | |
endif | |
" Handle class name completion | |
" 1. Find lines of <link stylesheet> | |
" 1a. Check file for @import | |
" 2. Extract filename(s?) of stylesheet, | |
call cursor(1,1) | |
let head = getline(search('<head\>'), search('<\/head>')) | |
let headjoined = join(copy(head), ' ') | |
if headjoined =~ '<style' | |
" Remove possibly confusing CSS operators | |
let stylehead = substitute(headjoined, '+>\*[,', ' ', 'g') | |
if search_for == 'class' | |
let styleheadlines = split(stylehead) | |
let headclasslines = filter(copy(styleheadlines), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'") | |
else | |
let stylesheet = split(headjoined, '[{}]') | |
" Get all lines which fit id syntax | |
let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'") | |
" Filter out possible color definitions | |
call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'") | |
" Filter out complex border definitions | |
call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'") | |
let templines = join(classlines, ' ') | |
let headclasslines = split(templines) | |
call filter(headclasslines, "v:val =~ '#[a-zA-Z0-9_-]\\+'") | |
endif | |
let internal = 1 | |
else | |
let internal = 0 | |
endif | |
let styletable = [] | |
let secimportfiles = [] | |
let filestable = filter(copy(head), "v:val =~ '\\(@import\\|link.*stylesheet\\)'") | |
for line in filestable | |
if line =~ "@import" | |
let styletable += [matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze")] | |
elseif line =~ "<link" | |
let styletable += [matchstr(line, "href\\s*=\\s*[\"']\\zs\\f\\+\\ze")] | |
endif | |
endfor | |
for file in styletable | |
if filereadable(file) | |
let stylesheet = readfile(file) | |
let secimport = filter(copy(stylesheet), "v:val =~ '@import'") | |
if len(secimport) > 0 | |
for line in secimport | |
let secfile = matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze") | |
let secfile = fnamemodify(file, ":p:h").'/'.secfile | |
let secimportfiles += [secfile] | |
endfor | |
endif | |
endif | |
endfor | |
let cssfiles = styletable + secimportfiles | |
let classes = [] | |
for file in cssfiles | |
let classlines = [] | |
if filereadable(file) | |
let stylesheet = readfile(file) | |
let stylefile = join(stylesheet, ' ') | |
let stylefile = substitute(stylefile, '+>\*[,', ' ', 'g') | |
if search_for == 'class' | |
let stylesheet = split(stylefile) | |
let classlines = filter(copy(stylesheet), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'") | |
else | |
let stylesheet = split(stylefile, '[{}]') | |
" Get all lines which fit id syntax | |
let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'") | |
" Filter out possible color definitions | |
call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'") | |
" Filter out complex border definitions | |
call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'") | |
let templines = join(classlines, ' ') | |
let stylelines = split(templines) | |
let classlines = filter(stylelines, "v:val =~ '#[a-zA-Z0-9_-]\\+'") | |
endif | |
endif | |
" We gathered classes definitions from all external files | |
let classes += classlines | |
endfor | |
if internal == 1 | |
let classes += headclasslines | |
endif | |
if search_for == 'class' | |
let elements = {} | |
for element in classes | |
if element =~ '^\.' | |
let class = matchstr(element, '^\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze') | |
let class = substitute(class, ':.*', '', '') | |
if has_key(elements, 'common') | |
let elements['common'] .= ' '.class | |
else | |
let elements['common'] = class | |
endif | |
else | |
let class = matchstr(element, '[a-zA-Z1-6]*\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze') | |
let tagname = tolower(matchstr(element, '[a-zA-Z1-6]*\ze.')) | |
if tagname != '' | |
if has_key(elements, tagname) | |
let elements[tagname] .= ' '.class | |
else | |
let elements[tagname] = class | |
endif | |
endif | |
endif | |
endfor | |
if has_key(elements, tag) && has_key(elements, 'common') | |
let values = split(elements[tag]." ".elements['common']) | |
elseif has_key(elements, tag) && !has_key(elements, 'common') | |
let values = split(elements[tag]) | |
elseif !has_key(elements, tag) && has_key(elements, 'common') | |
let values = split(elements['common']) | |
else | |
return [] | |
endif | |
elseif search_for == 'id' | |
" Find used IDs | |
" 1. Catch whole file | |
let filelines = getline(1, line('$')) | |
" 2. Find lines with possible id | |
let used_id_lines = filter(filelines, 'v:val =~ "id\\s*=\\s*[\"''][a-zA-Z0-9_-]\\+"') | |
" 3a. Join all filtered lines | |
let id_string = join(used_id_lines, ' ') | |
" 3b. And split them to be sure each id is in separate item | |
let id_list = split(id_string, 'id\s*=\s*') | |
" 4. Extract id values | |
let used_id = map(id_list, 'matchstr(v:val, "[\"'']\\zs[a-zA-Z0-9_-]\\+\\ze")') | |
let joined_used_id = ','.join(used_id, ',').',' | |
let allvalues = map(classes, 'matchstr(v:val, ".*#\\zs[a-zA-Z0-9_-]\\+")') | |
let values = [] | |
for element in classes | |
if joined_used_id !~ ','.element.',' | |
let values += [element] | |
endif | |
endfor | |
endif | |
" We need special version of sbase | |
let classbase = matchstr(context, ".*[\"']") | |
let classquote = matchstr(classbase, '.$') | |
let entered_class = matchstr(attr, ".*=\\s*[\"']\\zs.*") | |
for m in sort(values) | |
if m =~? '^'.entered_class | |
call add(res, m . classquote) | |
elseif m =~? entered_class | |
call add(res2, m . classquote) | |
endif | |
endfor | |
return res + res2 | |
elseif context =~? "style\\s*=\\s*[\"'][^\"']*$" | |
return csscomplete#CompleteCSS(0, context) | |
endif | |
" }}} | |
" Complete on-events {{{ | |
if context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$' | |
" We have to: | |
" 1. Find external files | |
let b:js_extfiles = [] | |
let l = line('.') | |
let c = col('.') | |
call cursor(1,1) | |
while search('<\@<=script\>', 'W') && line('.') <= l | |
if synIDattr(synID(line('.'),col('.')-1,0),"name") !~? 'comment' | |
let sname = matchstr(getline('.'), '<script[^>]*src\s*=\s*\([''"]\)\zs.\{-}\ze\1') | |
if filereadable(sname) | |
let b:js_extfiles += readfile(sname) | |
endif | |
endif | |
endwhile | |
" 2. Find at least one <script> tag | |
call cursor(1,1) | |
let js_scripttags = [] | |
while search('<script\>', 'W') && line('.') < l | |
if matchstr(getline('.'), '<script[^>]*src') == '' | |
let js_scripttag = getline(line('.'), search('</script>', 'W')) | |
let js_scripttags += js_scripttag | |
endif | |
endwhile | |
let b:js_extfiles += js_scripttags | |
" 3. Proper call for javascriptcomplete#CompleteJS | |
call cursor(l,c) | |
let js_context = matchstr(a:base, '\k\+$') | |
let js_shortcontext = substitute(a:base, js_context.'$', '', '') | |
let b:compl_context = context | |
let b:jsrange = [l, l] | |
unlet! l c | |
return javascriptcomplete#CompleteJS(0, js_context) | |
endif | |
" }}} | |
let stripbase = matchstr(context, ".*\\(on[a-zA-Z]*\\|style\\|class\\)\\s*=\\s*[\"']\\zs.*") | |
" Now we have context stripped from all chars up to style/class. | |
" It may fail with some strange style value combinations. | |
if stripbase !~ "[\"']" | |
return [] | |
endif | |
endif | |
" Value of attribute completion {{{ | |
" If attr contains =\s*[\"'] we catched value of attribute | |
if attr =~ "=\s*[\"']" || attr =~ "=\s*$" | |
" Let do attribute specific completion | |
let attrname = matchstr(attr, '.*\ze\s*=') | |
let entered_value = matchstr(attr, ".*=\\s*[\"']\\?\\zs.*") | |
let values = [] | |
" Load data {{{ | |
if !exists("b:html_doctype") | |
call htmlcomplete#CheckDoctype() | |
endif | |
if !exists("b:html_omni") | |
"runtime! autoload/xml/xhtml10s.vim | |
call htmlcomplete#LoadData() | |
endif | |
" }}} | |
if attrname == 'href' | |
" Now we are looking for local anchors defined by name or id | |
if entered_value =~ '^#' | |
let file = join(getline(1, line('$')), ' ') | |
" Split it be sure there will be one id/name element in | |
" item, it will be also first word [a-zA-Z0-9_-] in element | |
let oneelement = split(file, "\\(meta \\)\\@<!\\(name\\|id\\)\\s*=\\s*[\"']") | |
for i in oneelement | |
let values += ['#'.matchstr(i, "^[a-zA-Z][a-zA-Z0-9%_-]*")] | |
endfor | |
endif | |
else | |
if has_key(b:html_omni, tag) && has_key(b:html_omni[tag][1], attrname) | |
let values = b:html_omni[tag][1][attrname] | |
else | |
return [] | |
endif | |
endif | |
if len(values) == 0 | |
return [] | |
endif | |
" We need special version of sbase | |
let attrbase = matchstr(context, ".*[\"']") | |
let attrquote = matchstr(attrbase, '.$') | |
if attrquote !~ "['\"]" | |
let attrquoteopen = '"' | |
let attrquote = '"' | |
else | |
let attrquoteopen = '' | |
endif | |
for m in values | |
" This if is needed to not offer all completions as-is | |
" alphabetically but sort them. Those beginning with entered | |
" part will be as first choices | |
if m =~ '^'.entered_value | |
call add(res, attrquoteopen . m . attrquote) | |
elseif m =~ entered_value | |
call add(res2, attrquoteopen . m . attrquote) | |
endif | |
endfor | |
return res + res2 | |
endif | |
" }}} | |
" Attribute completion {{{ | |
" Shorten context to not include last word | |
let sbase = matchstr(context, '.*\ze\s.*') | |
" Load data {{{ | |
if !exists("b:html_doctype") | |
call htmlcomplete#CheckDoctype() | |
endif | |
if !exists("b:html_omni") | |
call htmlcomplete#LoadData() | |
endif | |
" }}} | |
if has_key(b:html_omni, tag) | |
let attrs = keys(b:html_omni[tag][1]) | |
else | |
return [] | |
endif | |
for m in sort(attrs) | |
if m =~ '^'.attr | |
call add(res, m) | |
elseif m =~ attr | |
call add(res2, m) | |
endif | |
endfor | |
let menu = res + res2 | |
if has_key(b:html_omni, 'vimxmlattrinfo') | |
let final_menu = [] | |
for i in range(len(menu)) | |
let item = menu[i] | |
if has_key(b:html_omni['vimxmlattrinfo'], item) | |
let m_menu = b:html_omni['vimxmlattrinfo'][item][0] | |
let m_info = b:html_omni['vimxmlattrinfo'][item][1] | |
else | |
let m_menu = '' | |
let m_info = '' | |
endif | |
if len(b:html_omni[tag][1][item]) > 0 && b:html_omni[tag][1][item][0] =~ '^\(BOOL\|'.item.'\)$' | |
let item = item | |
let m_menu = 'Bool' | |
else | |
let item .= '="' | |
endif | |
let final_menu += [{'word':item, 'menu':m_menu, 'info':m_info}] | |
endfor | |
else | |
let final_menu = [] | |
for i in range(len(menu)) | |
let item = menu[i] | |
if len(b:html_omni[tag][1][item]) > 0 && b:html_omni[tag][1][item][0] =~ '^\(BOOL\|'.item.'\)$' | |
let item = item | |
else | |
let item .= '="' | |
endif | |
let final_menu += [item] | |
endfor | |
return final_menu | |
endif | |
return final_menu | |
endif | |
" }}} | |
" Close tag {{{ | |
let b:unaryTagsStack = "base meta link hr br param img area input col" | |
if context =~ '^\/' | |
if context =~ '^\/.' | |
return [] | |
else | |
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack") | |
return [opentag.">"] | |
endif | |
endif | |
" }}} | |
" Load data {{{ | |
if !exists("b:html_doctype") | |
call htmlcomplete#CheckDoctype() | |
endif | |
if !exists("b:html_omni") | |
"runtime! autoload/xml/xhtml10s.vim | |
call htmlcomplete#LoadData() | |
endif | |
" }}} | |
" Tag completion {{{ | |
" Deal with tag completion. | |
let opentag = tolower(xmlcomplete#GetLastOpenTag("b:unaryTagsStack")) | |
" MM: TODO: GLOT works always the same but with some weird situation it | |
" behaves as intended in HTML but screws in PHP | |
if opentag == '' || &filetype == 'php' && !has_key(b:html_omni, opentag) | |
" Hack for sometimes failing GetLastOpenTag. | |
" As far as I tested fail isn't GLOT fault but problem | |
" of invalid document - not properly closed tags and other mish-mash. | |
" Also when document is empty. Return list of *all* tags. | |
let tags = keys(b:html_omni) | |
call filter(tags, 'v:val !~ "^vimxml"') | |
else | |
if has_key(b:html_omni, opentag) | |
let tags = b:html_omni[opentag][0] | |
else | |
return [] | |
endif | |
endif | |
" }}} | |
if exists("uppercase_tag") && uppercase_tag == 1 | |
let context = tolower(context) | |
endif | |
" Handle XML keywords: DOCTYPE | |
if opentag == '' | |
let tags += [ | |
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">', | |
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">', | |
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">', | |
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "http://www.w3.org/TR/REC-html40/frameset.dtd">', | |
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">', | |
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">', | |
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">', | |
\ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', | |
\ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', | |
\ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">', | |
\ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/1999/xhtml">' | |
\ ] | |
endif | |
for m in sort(tags) | |
if m =~ '^'.context | |
call add(res, m) | |
elseif m =~ context | |
call add(res2, m) | |
endif | |
endfor | |
let menu = res + res2 | |
if has_key(b:html_omni, 'vimxmltaginfo') | |
let final_menu = [] | |
for i in range(len(menu)) | |
let item = menu[i] | |
if has_key(b:html_omni['vimxmltaginfo'], item) | |
let m_menu = b:html_omni['vimxmltaginfo'][item][0] | |
let m_info = b:html_omni['vimxmltaginfo'][item][1] | |
else | |
let m_menu = '' | |
let m_info = '' | |
endif | |
if &filetype == 'html' && exists("uppercase_tag") && uppercase_tag == 1 && item !~ 'DOCTYPE' | |
let item = toupper(item) | |
endif | |
if item =~ 'DOCTYPE' | |
let abbr = 'DOCTYPE '.matchstr(item, 'DTD \zsX\?HTML .\{-}\ze\/\/') | |
else | |
let abbr = item | |
endif | |
let final_menu += [{'abbr':abbr, 'word':item, 'menu':m_menu, 'info':m_info}] | |
endfor | |
else | |
let final_menu = menu | |
endif | |
return final_menu | |
" }}} | |
endif | |
endfunction | |
1 0.000008 function! htmlcomplete#LoadData() " {{{ | |
if !exists("b:html_omni_flavor") | |
if &filetype == 'html' | |
let b:html_omni_flavor = 'html401t' | |
else | |
let b:html_omni_flavor = 'xhtml10s' | |
endif | |
endif | |
" With that if we still have bloated memory but create new buffer | |
" variables only by linking to existing g:variable, not sourcing whole | |
" file. | |
if exists('g:xmldata_'.b:html_omni_flavor) | |
exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor | |
else | |
exe 'runtime! autoload/xml/'.b:html_omni_flavor.'.vim' | |
exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor | |
endif | |
endfunction | |
" }}} | |
1 0.000004 function! htmlcomplete#CheckDoctype() " {{{ | |
if exists('b:html_omni_flavor') | |
let old_flavor = b:html_omni_flavor | |
else | |
let old_flavor = '' | |
endif | |
let i = 1 | |
while i < 10 && i < line("$") | |
let line = getline(i) | |
if line =~ '<!DOCTYPE.*\<DTD HTML 3\.2' | |
let b:html_omni_flavor = 'html32' | |
let b:html_doctype = 1 | |
break | |
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.0 Transitional' | |
let b:html_omni_flavor = 'html40t' | |
let b:html_doctype = 1 | |
break | |
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.0 Frameset' | |
let b:html_omni_flavor = 'html40f' | |
let b:html_doctype = 1 | |
break | |
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.0' | |
let b:html_omni_flavor = 'html40s' | |
let b:html_doctype = 1 | |
break | |
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.01 Transitional' | |
let b:html_omni_flavor = 'html401t' | |
let b:html_doctype = 1 | |
break | |
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.01 Frameset' | |
let b:html_omni_flavor = 'html401f' | |
let b:html_doctype = 1 | |
break | |
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.01' | |
let b:html_omni_flavor = 'html401s' | |
let b:html_doctype = 1 | |
break | |
elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.0 Transitional' | |
let b:html_omni_flavor = 'xhtml10t' | |
let b:html_doctype = 1 | |
break | |
elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.0 Frameset' | |
let b:html_omni_flavor = 'xhtml10f' | |
let b:html_doctype = 1 | |
break | |
elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.0 Strict' | |
let b:html_omni_flavor = 'xhtml10s' | |
let b:html_doctype = 1 | |
break | |
elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.1' | |
let b:html_omni_flavor = 'xhtml11' | |
let b:html_doctype = 1 | |
break | |
endif | |
let i += 1 | |
endwhile | |
if !exists("b:html_doctype") | |
return | |
else | |
" Tie g:xmldata with b:html_omni this way we need to sourca data file only | |
" once, not every time per buffer. | |
if old_flavor == b:html_omni_flavor | |
return | |
else | |
if exists('g:xmldata_'.b:html_omni_flavor) | |
exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor | |
else | |
exe 'runtime! autoload/xml/'.b:html_omni_flavor.'.vim' | |
exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor | |
endif | |
return | |
endif | |
endif | |
endfunction | |
" }}} | |
" vim:set foldmethod=marker: | |
SCRIPT /usr/share/nvim/runtime/indent/php.vim | |
Sourced 1 time | |
Total time: 0.002330 | |
Self time: 0.002289 | |
count total (s) self (s) | |
" Vim indent file | |
" Language: PHP | |
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr> | |
" URL: http://www.2072productions.com/vim/indent/php.vim | |
" Home: https://github.com/2072/PHP-Indenting-for-VIm | |
" Last Change: 2015 September 8th | |
" Version: 1.60 | |
" | |
" | |
" Type :help php-indent for available options | |
" | |
" A fully commented version of this file is available on github | |
" | |
" | |
" If you find a bug, please open a ticket on github.org | |
" ( https://github.com/2072/PHP-Indenting-for-VIm/issues ) with an example of | |
" code that breaks the algorithm. | |
" | |
" NOTE: This script must be used with PHP syntax ON and with the php syntax | |
" script by Lutz Eymers (http://www.isp.de/data/php.vim ) or with the | |
" script by Peter Hodge (http://www.vim.org/scripts/script.php?script_id=1571 ) | |
" the later is bunbdled by default with Vim 7. | |
" | |
" | |
" In the case you have syntax errors in your script such as HereDoc end | |
" identifiers not at col 1 you'll have to indent your file 2 times (This | |
" script will automatically put HereDoc end identifiers at col 1 if | |
" they are followed by a ';'). | |
" | |
" NOTE: If you are editing files in Unix file format and that (by accident) | |
" there are '\r' before new lines, this script won't be able to proceed | |
" correctly and will make many mistakes because it won't be able to match | |
" '\s*$' correctly. | |
" So you have to remove those useless characters first with a command like: | |
" | |
" :%s /\r$//g | |
" | |
" or simply 'let' the option PHP_removeCRwhenUnix to 1 and the script will | |
" silently remove them when VIM load this script (at each bufread). | |
1 0.000013 if exists("b:did_indent") | |
finish | |
endif | |
1 0.000080 let b:did_indent = 1 | |
1 0.000004 let g:php_sync_method = 0 | |
1 0.000005 if exists('*shiftwidth') | |
1 0.000020 function! s:sw() | |
return shiftwidth() | |
endfunction | |
1 0.000047 else | |
function! s:sw() | |
return &shiftwidth | |
endfunction | |
endif | |
1 0.000004 if exists("PHP_default_indenting") | |
let b:PHP_default_indenting = PHP_default_indenting * s:sw() | |
else | |
1 0.000003 let b:PHP_default_indenting = 0 | |
1 0.000001 endif | |
1 0.000003 if exists("PHP_outdentSLComments") | |
let b:PHP_outdentSLComments = PHP_outdentSLComments * s:sw() | |
else | |
1 0.000002 let b:PHP_outdentSLComments = 0 | |
1 0.000001 endif | |
1 0.000003 if exists("PHP_BracesAtCodeLevel") | |
let b:PHP_BracesAtCodeLevel = PHP_BracesAtCodeLevel | |
else | |
1 0.000002 let b:PHP_BracesAtCodeLevel = 0 | |
1 0.000001 endif | |
1 0.000003 if exists("PHP_autoformatcomment") | |
let b:PHP_autoformatcomment = PHP_autoformatcomment | |
else | |
1 0.000004 let b:PHP_autoformatcomment = 1 | |
1 0.000001 endif | |
1 0.000003 if exists("PHP_outdentphpescape") | |
let b:PHP_outdentphpescape = PHP_outdentphpescape | |
else | |
1 0.000002 let b:PHP_outdentphpescape = 1 | |
1 0.000001 endif | |
1 0.000004 if exists("PHP_vintage_case_default_indent") && PHP_vintage_case_default_indent | |
let b:PHP_vintage_case_default_indent = 1 | |
else | |
1 0.000003 let b:PHP_vintage_case_default_indent = 0 | |
1 0.000001 endif | |
1 0.000002 let b:PHP_lastindented = 0 | |
1 0.000002 let b:PHP_indentbeforelast = 0 | |
1 0.000002 let b:PHP_indentinghuge = 0 | |
1 0.000003 let b:PHP_CurrentIndentLevel = b:PHP_default_indenting | |
1 0.000002 let b:PHP_LastIndentedWasComment = 0 | |
1 0.000002 let b:PHP_InsideMultilineComment = 0 | |
1 0.000002 let b:InPHPcode = 0 | |
1 0.000002 let b:InPHPcode_checked = 0 | |
1 0.000002 let b:InPHPcode_and_script = 0 | |
1 0.000002 let b:InPHPcode_tofind = "" | |
1 0.000003 let b:PHP_oldchangetick = b:changedtick | |
1 0.000002 let b:UserIsTypingComment = 0 | |
1 0.000077 let b:optionsset = 0 | |
1 0.000009 setlocal nosmartindent | |
1 0.000003 setlocal noautoindent | |
1 0.000002 setlocal nocindent | |
1 0.000089 setlocal nolisp | |
1 0.000006 setlocal indentexpr=GetPhpIndent() | |
1 0.000003 setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e,*<Return>,=?>,=<?,=*/ | |
1 0.000004 let s:searchpairflags = 'bWr' | |
1 0.000007 if &fileformat == "unix" && exists("PHP_removeCRwhenUnix") && PHP_removeCRwhenUnix | |
silent! %s/\r$//g | |
endif | |
1 0.000003 if exists("*GetPhpIndent") | |
call ResetPhpOptions() | |
finish | |
endif | |
1 0.000003 let s:PHP_validVariable = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' | |
1 0.000004 let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)' | |
1 0.000007 let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)' | |
1 0.000005 let s:functionDecl = '\<function\>\%(\s\+'.s:PHP_validVariable.'\)\=\s*(.*' | |
1 0.000003 let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$' | |
1 0.000008 let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)\|^[^''"`]*[''"`]$' | |
1 0.000003 let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!' | |
1 0.000002 let s:escapeDebugStops = 0 | |
1 0.000003 function! DebugPrintReturn(scriptLine) | |
if ! s:escapeDebugStops | |
echo "debug:" . a:scriptLine | |
let c = getchar() | |
if c == "\<Del>" | |
let s:escapeDebugStops = 1 | |
end | |
endif | |
endfunction | |
1 0.000012 function! GetLastRealCodeLNum(startline) " {{{ | |
let lnum = a:startline | |
if b:GetLastRealCodeLNum_ADD && b:GetLastRealCodeLNum_ADD == lnum + 1 | |
let lnum = b:GetLastRealCodeLNum_ADD | |
endif | |
while lnum > 1 | |
let lnum = prevnonblank(lnum) | |
let lastline = getline(lnum) | |
if b:InPHPcode_and_script && lastline =~ '?>\s*$' | |
let lnum = lnum - 1 | |
elseif lastline =~ '^\s*?>.*<?\%(php\)\=\s*$' | |
let lnum = lnum - 1 | |
elseif lastline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)' | |
let lnum = lnum - 1 | |
elseif lastline =~ '\*/\s*$' | |
call cursor(lnum, 1) | |
if lastline !~ '^\*/' | |
call search('\*/', 'W') | |
endif | |
let lnum = searchpair('/\*', '', '\*/', s:searchpairflags, 'Skippmatch2()') | |
let lastline = getline(lnum) | |
if lastline =~ '^\s*/\*' | |
let lnum = lnum - 1 | |
else | |
break | |
endif | |
elseif lastline =~? '\%(//\s*\|?>.*\)\@<!<?\%(php\)\=\s*$\|^\s*<script\>' | |
while lastline !~ '\(<?.*\)\@<!?>' && lnum > 1 | |
let lnum = lnum - 1 | |
let lastline = getline(lnum) | |
endwhile | |
if lastline =~ '^\s*?>' | |
let lnum = lnum - 1 | |
else | |
break | |
endif | |
elseif lastline =~? '^\a\w*;\=$' && lastline !~? s:notPhpHereDoc | |
let tofind=substitute( lastline, '\(\a\w*\);\=', '<<<\\s*[''"]\\=\1[''"]\\=$', '') | |
while getline(lnum) !~? tofind && lnum > 1 | |
let lnum = lnum - 1 | |
endwhile | |
elseif lastline =~ '^[^''"`]*[''"`][;,]'.s:endline | |
let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$', '') | |
while getline(lnum) !~? tofind && lnum > 1 | |
let lnum = lnum - 1 | |
endwhile | |
else | |
break | |
endif | |
endwhile | |
if lnum==1 && getline(lnum) !~ '<?' | |
let lnum=0 | |
endif | |
if b:InPHPcode_and_script && 1 > b:InPHPcode | |
let b:InPHPcode_and_script = 0 | |
endif | |
return lnum | |
endfunction " }}} | |
1 0.000185 function! Skippmatch2() | |
let line = getline(".") | |
if line =~ "\\([\"']\\).*/\\*.*\\1" || line =~ '\%(//\|#\).*/\*' | |
return 1 | |
else | |
return 0 | |
endif | |
endfun | |
1 0.000003 function! Skippmatch() " {{{ | |
let synname = synIDattr(synID(line("."), col("."), 0), "name") | |
if synname == "Delimiter" || synname == "phpRegionDelimiter" || synname =~# "^phpParent" || synname == "phpArrayParens" || synname =~# '^php\%(Block\|Brace\)' || synname == "javaScriptBraces" || synname =~# '^php\%(Doc\)\?Comment' && b:UserIsTypingComment | |
return 0 | |
else | |
return 1 | |
endif | |
endfun " }}} | |
1 0.000067 function! FindOpenBracket(lnum, blockStarter) " {{{ | |
call cursor(a:lnum, 1) | |
let line = searchpair('{', '', '}', 'bW', 'Skippmatch()') | |
if a:blockStarter == 1 | |
while line > 1 | |
let linec = getline(line) | |
if linec =~ s:terminated || linec =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline | |
break | |
endif | |
let line = GetLastRealCodeLNum(line - 1) | |
endwhile | |
endif | |
return line | |
endfun " }}} | |
1 0.000013 function! FindTheIfOfAnElse (lnum, StopAfterFirstPrevElse) " {{{ | |
if getline(a:lnum) =~# '^\s*}\s*else\%(if\)\=\>' | |
let beforeelse = a:lnum | |
else | |
let beforeelse = GetLastRealCodeLNum(a:lnum - 1) | |
endif | |
if !s:level | |
let s:iftoskip = 0 | |
endif | |
if getline(beforeelse) =~# '^\s*\%(}\s*\)\=else\%(\s*if\)\@!\>' | |
let s:iftoskip = s:iftoskip + 1 | |
endif | |
if getline(beforeelse) =~ '^\s*}' | |
let beforeelse = FindOpenBracket(beforeelse, 0) | |
if getline(beforeelse) =~ '^\s*{' | |
let beforeelse = GetLastRealCodeLNum(beforeelse - 1) | |
endif | |
endif | |
if !s:iftoskip && a:StopAfterFirstPrevElse && getline(beforeelse) =~# '^\s*\%([}]\s*\)\=else\%(if\)\=\>' | |
return beforeelse | |
endif | |
if getline(beforeelse) !~# '^\s*if\>' && beforeelse>1 || s:iftoskip && beforeelse>1 | |
if s:iftoskip && getline(beforeelse) =~# '^\s*if\>' | |
let s:iftoskip = s:iftoskip - 1 | |
endif | |
let s:level = s:level + 1 | |
let beforeelse = FindTheIfOfAnElse(beforeelse, a:StopAfterFirstPrevElse) | |
endif | |
return beforeelse | |
endfunction " }}} | |
1 0.000005 let s:defaultORcase = '^\s*\%(default\|case\).*:' | |
1 0.000002 function! FindTheSwitchIndent (lnum) " {{{ | |
let test = GetLastRealCodeLNum(a:lnum - 1) | |
if test <= 1 | |
return indent(1) - s:sw() * b:PHP_vintage_case_default_indent | |
end | |
while getline(test) =~ '^\s*}' && test > 1 | |
let test = GetLastRealCodeLNum(FindOpenBracket(test, 0) - 1) | |
if getline(test) =~ '^\s*switch\>' | |
let test = GetLastRealCodeLNum(test - 1) | |
endif | |
endwhile | |
if getline(test) =~# '^\s*switch\>' | |
return indent(test) | |
elseif getline(test) =~# s:defaultORcase | |
return indent(test) - s:sw() * b:PHP_vintage_case_default_indent | |
else | |
return FindTheSwitchIndent(test) | |
endif | |
endfunction "}}} | |
1 0.000013 let s:SynPHPMatchGroups = {'phpParent':1, 'Delimiter':1, 'Define':1, 'Storageclass':1, 'StorageClass':1, 'Structure':1, 'Exception':1} | |
1 0.000069 function! IslinePHP (lnum, tofind) " {{{ | |
let cline = getline(a:lnum) | |
if a:tofind=="" | |
let tofind = "^\\s*[\"'`]*\\s*\\zs\\S" | |
else | |
let tofind = a:tofind | |
endif | |
let tofind = tofind . '\c' | |
let coltotest = match (cline, tofind) + 1 | |
let synname = synIDattr(synID(a:lnum, coltotest, 0), "name") | |
if synname == 'phpStringSingle' || synname == 'phpStringDouble' || synname == 'phpBacktick' | |
if cline !~ '^\s*[''"`]' | |
return "SpecStringEntrails" | |
else | |
return synname | |
end | |
end | |
if get(s:SynPHPMatchGroups, synname) || synname =~ '^php' || synname =~? '^javaScript' | |
return synname | |
else | |
return "" | |
endif | |
endfunction " }}} | |
1 0.000004 let s:autoresetoptions = 0 | |
1 0.000002 if ! s:autoresetoptions | |
1 0.000003 let s:autoresetoptions = 1 | |
1 0.000001 endif | |
1 0.000138 function! ResetPhpOptions() | |
if ! b:optionsset && &filetype =~ "php" | |
if b:PHP_autoformatcomment | |
setlocal comments=s1:/*,mb:*,ex:*/,://,:# | |
setlocal formatoptions-=t | |
setlocal formatoptions+=q | |
setlocal formatoptions+=r | |
setlocal formatoptions+=o | |
setlocal formatoptions+=c | |
setlocal formatoptions+=b | |
endif | |
let b:optionsset = 1 | |
endif | |
endfunc | |
1 0.000142 0.000100 call ResetPhpOptions() | |
1 0.000002 function! GetPhpIndent() | |
let b:GetLastRealCodeLNum_ADD = 0 | |
let UserIsEditing=0 | |
if b:PHP_oldchangetick != b:changedtick | |
let b:PHP_oldchangetick = b:changedtick | |
let UserIsEditing=1 | |
endif | |
if b:PHP_default_indenting | |
let b:PHP_default_indenting = g:PHP_default_indenting * s:sw() | |
endif | |
let cline = getline(v:lnum) | |
if !b:PHP_indentinghuge && b:PHP_lastindented > b:PHP_indentbeforelast | |
if b:PHP_indentbeforelast | |
let b:PHP_indentinghuge = 1 | |
endif | |
let b:PHP_indentbeforelast = b:PHP_lastindented | |
endif | |
if b:InPHPcode_checked && prevnonblank(v:lnum - 1) != b:PHP_lastindented | |
if b:PHP_indentinghuge | |
let b:PHP_indentinghuge = 0 | |
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting | |
endif | |
let real_PHP_lastindented = v:lnum | |
let b:PHP_LastIndentedWasComment=0 | |
let b:PHP_InsideMultilineComment=0 | |
let b:PHP_indentbeforelast = 0 | |
let b:InPHPcode = 0 | |
let b:InPHPcode_checked = 0 | |
let b:InPHPcode_and_script = 0 | |
let b:InPHPcode_tofind = "" | |
elseif v:lnum > b:PHP_lastindented | |
let real_PHP_lastindented = b:PHP_lastindented | |
else | |
let real_PHP_lastindented = v:lnum | |
endif | |
let b:PHP_lastindented = v:lnum | |
if !b:InPHPcode_checked " {{{ One time check | |
let b:InPHPcode_checked = 1 | |
let b:UserIsTypingComment = 0 | |
let synname = "" | |
if cline !~ '<?.*?>' | |
let synname = IslinePHP (prevnonblank(v:lnum), "") | |
endif | |
if synname!="" | |
if synname == "SpecStringEntrails" | |
let b:InPHPcode = -1 | |
let b:InPHPcode_tofind = "" | |
elseif synname != "phpHereDoc" && synname != "phpHereDocDelimiter" | |
let b:InPHPcode = 1 | |
let b:InPHPcode_tofind = "" | |
if synname =~# '^php\%(Doc\)\?Comment' | |
let b:UserIsTypingComment = 1 | |
let b:InPHPcode_checked = 0 | |
endif | |
if synname =~? '^javaScript' | |
let b:InPHPcode_and_script = 1 | |
endif | |
else | |
let b:InPHPcode = 0 | |
let lnum = v:lnum - 1 | |
while getline(lnum) !~? '<<<\s*[''"]\=\a\w*[''"]\=$' && lnum > 1 | |
let lnum = lnum - 1 | |
endwhile | |
let b:InPHPcode_tofind = substitute( getline(lnum), '^.*<<<\s*[''"]\=\(\a\w*\)[''"]\=$', '^\\s*\1;\\=$', '') | |
endif | |
else | |
let b:InPHPcode = 0 | |
let b:InPHPcode_tofind = s:PHP_startindenttag | |
endif | |
endif "!b:InPHPcode_checked }}} | |
" Test if we are indenting PHP code {{{ | |
let lnum = prevnonblank(v:lnum - 1) | |
let last_line = getline(lnum) | |
let endline= s:endline | |
if b:InPHPcode_tofind!="" | |
if cline =~? b:InPHPcode_tofind | |
let b:InPHPcode_tofind = "" | |
let b:UserIsTypingComment = 0 | |
if b:InPHPcode == -1 | |
let b:InPHPcode = 1 | |
return -1 | |
end | |
let b:InPHPcode = 1 | |
if cline =~ '\*/' | |
call cursor(v:lnum, 1) | |
if cline !~ '^\*/' | |
call search('\*/', 'W') | |
endif | |
let lnum = searchpair('/\*', '', '\*/', s:searchpairflags, 'Skippmatch2()') | |
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting | |
let b:PHP_LastIndentedWasComment = 0 | |
if cline =~ '^\s*\*/' | |
return indent(lnum) + 1 | |
else | |
return indent(lnum) | |
endif | |
elseif cline =~? '<script\>' | |
let b:InPHPcode_and_script = 1 | |
let b:GetLastRealCodeLNum_ADD = v:lnum | |
endif | |
endif | |
endif | |
if 1 == b:InPHPcode | |
if !b:InPHPcode_and_script && last_line =~ '\%(<?.*\)\@<!?>\%(.*<?\)\@!' && IslinePHP(lnum, '?>')=~"Delimiter" | |
if cline !~? s:PHP_startindenttag | |
let b:InPHPcode = 0 | |
let b:InPHPcode_tofind = s:PHP_startindenttag | |
elseif cline =~? '<script\>' | |
let b:InPHPcode_and_script = 1 | |
endif | |
elseif last_line =~ '^[^''"`]\+[''"`]$' | |
let b:InPHPcode = -1 | |
let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '') | |
elseif last_line =~? '<<<\s*[''"]\=\a\w*[''"]\=$' | |
let b:InPHPcode = 0 | |
let b:InPHPcode_tofind = substitute( last_line, '^.*<<<\s*[''"]\=\(\a\w*\)[''"]\=$', '^\\s*\1;\\=$', '') | |
elseif !UserIsEditing && cline =~ '^\s*/\*\%(.*\*/\)\@!' && getline(v:lnum + 1) !~ '^\s*\*' | |
let b:InPHPcode = 0 | |
let b:InPHPcode_tofind = '\*/' | |
elseif cline =~? '^\s*</script>' | |
let b:InPHPcode = 0 | |
let b:InPHPcode_tofind = s:PHP_startindenttag | |
endif | |
endif " }}} | |
if 1 > b:InPHPcode && !b:InPHPcode_and_script | |
return -1 | |
endif | |
" Indent successive // or # comment the same way the first is {{{ | |
let addSpecial = 0 | |
if cline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)' | |
let addSpecial = b:PHP_outdentSLComments | |
if b:PHP_LastIndentedWasComment == 1 | |
return indent(real_PHP_lastindented) | |
endif | |
let b:PHP_LastIndentedWasComment = 1 | |
else | |
let b:PHP_LastIndentedWasComment = 0 | |
endif " }}} | |
" Indent multiline /* comments correctly {{{ | |
if b:PHP_InsideMultilineComment || b:UserIsTypingComment | |
if cline =~ '^\s*\*\%(\/\)\@!' | |
if last_line =~ '^\s*/\*' | |
return indent(lnum) + 1 | |
else | |
return indent(lnum) | |
endif | |
else | |
let b:PHP_InsideMultilineComment = 0 | |
endif | |
endif | |
if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*\%(.*\*/\)\@!' | |
if getline(v:lnum + 1) !~ '^\s*\*' | |
return -1 | |
endif | |
let b:PHP_InsideMultilineComment = 1 | |
endif " }}} | |
" Things always indented at col 1 (PHP delimiter: <?, ?>, Heredoc end) {{{ | |
if cline =~# '^\s*<?' && cline !~ '?>' && b:PHP_outdentphpescape | |
return 0 | |
endif | |
if cline =~ '^\s*?>' && cline !~# '<?' && b:PHP_outdentphpescape | |
return 0 | |
endif | |
if cline =~? '^\s*\a\w*;$\|^\a\w*$\|^\s*[''"`][;,]' && cline !~? s:notPhpHereDoc | |
return 0 | |
endif " }}} | |
let s:level = 0 | |
let lnum = GetLastRealCodeLNum(v:lnum - 1) | |
let last_line = getline(lnum) | |
let ind = indent(lnum) | |
if ind==0 && b:PHP_default_indenting | |
let ind = b:PHP_default_indenting | |
endif | |
if lnum == 0 | |
return b:PHP_default_indenting + addSpecial | |
endif | |
if cline =~ '^\s*}\%(}}\)\@!' | |
let ind = indent(FindOpenBracket(v:lnum, 1)) | |
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting | |
return ind | |
endif | |
if cline =~ '^\s*\*/' | |
call cursor(v:lnum, 1) | |
if cline !~ '^\*/' | |
call search('\*/', 'W') | |
endif | |
let lnum = searchpair('/\*', '', '\*/', s:searchpairflags, 'Skippmatch2()') | |
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting | |
if cline =~ '^\s*\*/' | |
return indent(lnum) + 1 | |
else | |
return indent(lnum) | |
endif | |
endif | |
if last_line =~ '[;}]'.endline && last_line !~ '^[)\]]' && last_line !~# s:defaultORcase | |
if ind==b:PHP_default_indenting | |
return b:PHP_default_indenting + addSpecial | |
elseif b:PHP_indentinghuge && ind==b:PHP_CurrentIndentLevel && cline !~# '^\s*\%(else\|\%(case\|default\).*:\|[})];\=\)' && last_line !~# '^\s*\%(\%(}\s*\)\=else\)' && getline(GetLastRealCodeLNum(lnum - 1))=~';'.endline | |
return b:PHP_CurrentIndentLevel + addSpecial | |
endif | |
endif | |
let LastLineClosed = 0 | |
let terminated = s:terminated | |
let unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.endline | |
if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>' | |
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting | |
return indent(FindTheIfOfAnElse(v:lnum, 1)) | |
elseif cline =~# s:defaultORcase | |
return FindTheSwitchIndent(v:lnum) + s:sw() * b:PHP_vintage_case_default_indent | |
elseif cline =~ '^\s*)\=\s*{' | |
let previous_line = last_line | |
let last_line_num = lnum | |
while last_line_num > 1 | |
if previous_line =~ terminated || previous_line =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . endline | |
let ind = indent(last_line_num) | |
if b:PHP_BracesAtCodeLevel | |
let ind = ind + s:sw() | |
endif | |
return ind | |
endif | |
let last_line_num = GetLastRealCodeLNum(last_line_num - 1) | |
let previous_line = getline(last_line_num) | |
endwhile | |
elseif last_line =~# unstated && cline !~ '^\s*);\='.endline | |
let ind = ind + s:sw() | |
return ind + addSpecial | |
elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated | |
let previous_line = last_line | |
let last_line_num = lnum | |
let LastLineClosed = 1 | |
let isSingleLineBlock = 0 | |
while 1 | |
if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline | |
call cursor(last_line_num, 1) | |
if previous_line !~ '^}' | |
call search('}\|;\s*}'.endline, 'W') | |
end | |
let oldLastLine = last_line_num | |
let last_line_num = searchpair('{', '', '}', 'bW', 'Skippmatch()') | |
if getline(last_line_num) =~ '^\s*{' | |
let last_line_num = GetLastRealCodeLNum(last_line_num - 1) | |
elseif oldLastLine == last_line_num | |
let isSingleLineBlock = 1 | |
continue | |
endif | |
let previous_line = getline(last_line_num) | |
continue | |
else | |
let isSingleLineBlock = 0 | |
if getline(last_line_num) =~# '^\s*else\%(if\)\=\>' | |
let last_line_num = FindTheIfOfAnElse(last_line_num, 0) | |
continue | |
endif | |
let last_match = last_line_num | |
let one_ahead_indent = indent(last_line_num) | |
let last_line_num = GetLastRealCodeLNum(last_line_num - 1) | |
let two_ahead_indent = indent(last_line_num) | |
let after_previous_line = previous_line | |
let previous_line = getline(last_line_num) | |
if previous_line =~# s:defaultORcase.'\|{'.endline | |
break | |
endif | |
if after_previous_line=~# '^\s*'.s:blockstart.'.*)'.endline && previous_line =~# '[;}]'.endline | |
break | |
endif | |
if one_ahead_indent == two_ahead_indent || last_line_num < 1 | |
if previous_line =~# '\%(;\|^\s*}\)'.endline || last_line_num < 1 | |
break | |
endif | |
endif | |
endif | |
endwhile | |
if indent(last_match) != ind | |
let ind = indent(last_match) | |
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting | |
return ind + addSpecial | |
endif | |
endif | |
if (last_line !~ '^\s*}\%(}}\)\@!') | |
let plinnum = GetLastRealCodeLNum(lnum - 1) | |
else | |
let plinnum = GetLastRealCodeLNum(FindOpenBracket(lnum, 1) - 1) | |
endif | |
let AntepenultimateLine = getline(plinnum) | |
let last_line = substitute(last_line,"\\(//\\|#\\)\\(\\(\\([^\"']*\\([\"']\\)[^\"']*\\5\\)\\+[^\"']*$\\)\\|\\([^\"']*$\\)\\)",'','') | |
if ind == b:PHP_default_indenting | |
if last_line =~ terminated && last_line !~# s:defaultORcase | |
let LastLineClosed = 1 | |
endif | |
endif | |
if !LastLineClosed | |
if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline | |
let dontIndent = 0 | |
if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*)\s*{'.endline && last_line !~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline | |
let dontIndent = 1 | |
endif | |
if !dontIndent && (!b:PHP_BracesAtCodeLevel || last_line !~# '^\s*{') | |
let ind = ind + s:sw() | |
endif | |
if b:PHP_BracesAtCodeLevel || b:PHP_vintage_case_default_indent == 1 | |
let b:PHP_CurrentIndentLevel = ind | |
return ind + addSpecial | |
endif | |
elseif last_line =~ '\S\+\s*),'.endline | |
call cursor(lnum, 1) | |
call search('),'.endline, 'W') | |
let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()') | |
if openedparent != lnum | |
let ind = indent(openedparent) | |
endif | |
elseif last_line =~ '^\s*'.s:blockstart | |
let ind = ind + s:sw() | |
elseif AntepenultimateLine =~ '{'.endline || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase | |
let ind = ind + s:sw() | |
endif | |
endif | |
if cline =~ '^\s*[)\]];\=' | |
let ind = ind - s:sw() | |
endif | |
let b:PHP_CurrentIndentLevel = ind | |
return ind + addSpecial | |
endfunction | |
SCRIPT /usr/share/nvim/runtime/syntax/php.vim | |
Sourced 1 time | |
Total time: 0.056173 | |
Self time: 0.010192 | |
count total (s) self (s) | |
" Vim syntax file | |
" Language: php PHP 3/4/5/7 | |
" Maintainer: Jason Woofenden <jason@jasonwoof.com> | |
" Last Change: Dec 11, 2016 | |
" URL: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=blob;f=php.vim;hb=HEAD | |
" Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com> | |
" Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> | |
" | |
" Note: If you are using a colour terminal with dark background, you will probably find | |
" the 'elflord' colorscheme is much better for PHP's syntax than the default | |
" colourscheme, because elflord's colours will better highlight the break-points | |
" (Statements) in your code. | |
" | |
" Options: php_sql_query = 1 for SQL syntax highlighting inside strings | |
" php_htmlInStrings = 1 for HTML syntax highlighting inside strings | |
" php_baselib = 1 for highlighting baselib functions | |
" php_asp_tags = 1 for highlighting ASP-style short tags | |
" php_parent_error_close = 1 for highlighting parent error ] or ) | |
" php_parent_error_open = 1 for skipping an php end tag, if there exists an open ( or [ without a closing one | |
" php_oldStyle = 1 for using old colorstyle | |
" php_noShortTags = 1 don't sync <? ?> as php | |
" php_folding = 1 for folding classes and functions | |
" php_folding = 2 for folding all { } regions | |
" php_sync_method = x | |
" x=-1 to sync by search ( default ) | |
" x>0 to sync at least x lines backwards | |
" x=0 to sync from start | |
" | |
" Added by Peter Hodge On June 9, 2006: | |
" php_special_functions = 1|0 to highlight functions with abnormal behaviour | |
" php_alt_comparisons = 1|0 to highlight comparison operators in an alternate colour | |
" php_alt_assignByReference = 1|0 to highlight '= &' in an alternate colour | |
" | |
" Note: these all default to 1 (On), so you would set them to '0' to turn them off. | |
" E.g., in your .vimrc or _vimrc file: | |
" let php_special_functions = 0 | |
" let php_alt_comparisons = 0 | |
" let php_alt_assignByReference = 0 | |
" Unletting these variables will revert back to their default (On). | |
" | |
" | |
" Note: | |
" Setting php_folding=1 will match a closing } by comparing the indent | |
" before the class or function keyword with the indent of a matching }. | |
" Setting php_folding=2 will match all of pairs of {,} ( see known | |
" bugs ii ) | |
" Known Bugs: | |
" - setting php_parent_error_close on and php_parent_error_open off | |
" has these two leaks: | |
" i) A closing ) or ] inside a string match to the last open ( or [ | |
" before the string, when the the closing ) or ] is on the same line | |
" where the string started. In this case a following ) or ] after | |
" the string would be highlighted as an error, what is incorrect. | |
" ii) Same problem if you are setting php_folding = 2 with a closing | |
" } inside an string on the first line of this string. | |
" quit when a syntax file was already loaded | |
1 0.000014 if exists("b:current_syntax") | |
finish | |
endif | |
1 0.000003 if !exists("main_syntax") | |
1 0.000196 let main_syntax = 'php' | |
1 0.000002 endif | |
1 0.004042 runtime! syntax/html.vim | |
1 0.000003 unlet b:current_syntax | |
" accept old options | |
1 0.000005 if !exists("php_sync_method") | |
if exists("php_minlines") | |
let php_sync_method=php_minlines | |
else | |
let php_sync_method=-1 | |
endif | |
endif | |
1 0.000005 if exists("php_parentError") && !exists("php_parent_error_open") && !exists("php_parent_error_close") | |
let php_parent_error_close=1 | |
let php_parent_error_open=1 | |
endif | |
1 0.000015 syn cluster htmlPreproc add=phpRegion,phpRegionAsp,phpRegionSc | |
1 0.001203 syn include @sqlTop syntax/sql.vim | |
1 0.000012 syn sync clear | |
1 0.000003 unlet b:current_syntax | |
1 0.000005 syn cluster sqlTop remove=sqlString,sqlComment | |
1 0.000004 if exists( "php_sql_query") | |
syn cluster phpAddStrings contains=@sqlTop | |
endif | |
1 0.000003 if exists( "php_htmlInStrings") | |
syn cluster phpAddStrings add=@htmlTop | |
endif | |
" make sure we can use \ at the beginning of the line to do a continuation | |
1 0.000011 let s:cpo_save = &cpo | |
1 0.000009 set cpo&vim | |
1 0.000002 syn case match | |
" Env Variables | |
1 0.000050 syn keyword phpEnvVar GATEWAY_INTERFACE SERVER_NAME SERVER_SOFTWARE SERVER_PROTOCOL REQUEST_METHOD QUERY_STRING DOCUMENT_ROOT HTTP_ACCEPT HTTP_ACCEPT_CHARSET HTTP_ENCODING HTTP_ACCEPT_LANGUAGE HTTP_CONNECTION HTTP_HOST HTTP_REFERER HTTP_USER_AGENT REMOTE_ADDR REMOTE_PORT SCRIPT_FILENAME SERVER_ADMIN SERVER_PORT SERVER_SIGNATURE PATH_TRANSLATED SCRIPT_NAME REQUEST_URI contained | |
" Internal Variables | |
1 0.000013 syn keyword phpIntVar GLOBALS PHP_ERRMSG PHP_SELF HTTP_GET_VARS HTTP_POST_VARS HTTP_COOKIE_VARS HTTP_POST_FILES HTTP_ENV_VARS HTTP_SERVER_VARS HTTP_SESSION_VARS HTTP_RAW_POST_DATA HTTP_STATE_VARS _GET _POST _COOKIE _FILES _SERVER _ENV _SERVER _REQUEST _SESSION contained | |
" Constants | |
1 0.000010 syn keyword phpCoreConstant PHP_VERSION PHP_OS DEFAULT_INCLUDE_PATH PEAR_INSTALL_DIR PEAR_EXTENSION_DIR PHP_EXTENSION_DIR PHP_BINDIR PHP_LIBDIR PHP_DATADIR PHP_SYSCONFDIR PHP_LOCALSTATEDIR PHP_CONFIG_FILE_PATH PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_END contained | |
" Predefined constants | |
" Generated by: curl -q http://php.net/manual/en/errorfunc.constants.php | grep -oP 'E_\w+' | sort -u | |
1 0.000008 syn keyword phpCoreConstant E_ALL E_COMPILE_ERROR E_COMPILE_WARNING E_CORE_ERROR E_CORE_WARNING E_DEPRECATED E_ERROR E_NOTICE E_PARSE E_RECOVERABLE_ERROR E_STRICT E_USER_DEPRECATED E_USER_ERROR E_USER_NOTICE E_USER_WARNING E_WARNING contained | |
1 0.000002 syn case ignore | |
1 0.000009 syn keyword phpConstant __LINE__ __FILE__ __FUNCTION__ __METHOD__ __CLASS__ __DIR__ __NAMESPACE__ contained | |
" Function and Methods ripped from php_manual_de.tar.gz Jan 2003 | |
1 0.000033 syn keyword phpFunctions apache_child_terminate apache_get_modules apache_get_version apache_getenv apache_lookup_uri apache_note apache_request_headers apache_response_headers apache_setenv ascii2ebcdic ebcdic2ascii getallheaders virtual contained | |
1 0.000049 syn keyword phpFunctions array_change_key_case array_chunk array_column array_combine array_count_values array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_diff array_fill_keys array_fill array_filter array_flip array_intersect_assoc array_intersect_key array_intersect_uassoc array_intersect_ukey array_intersect array_key_exists array_keys array_map array_merge_recursive array_merge array_multisort array_pad array_pop array_product array_push array_rand array_reduce array_replace_recursive array_replace array_reverse array_search array_shift array_slice array_splice array_sum array_udiff_assoc array_udiff_uassoc array_udiff array_uintersect_assoc array_uintersect_uassoc array_uintersect array_unique array_unshift array_values array_walk_recursive array_walk arsort asort count current each end in_array key_exists key krsort ksort natcasesort natsort next pos prev range reset rsort shuffle sizeof sort uasort uksort usort contained | |
1 0.000004 syn keyword phpFunctions aspell_check aspell_new aspell_suggest contained | |
1 0.000006 syn keyword phpFunctions bcadd bccomp bcdiv bcmod bcmul bcpow bcpowmod bcscale bcsqrt bcsub contained | |
1 0.000006 syn keyword phpFunctions bzclose bzcompress bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite contained | |
1 0.000012 syn keyword phpFunctions cal_days_in_month cal_from_jd cal_info cal_to_jd easter_date easter_days frenchtojd gregoriantojd jddayofweek jdmonthname jdtofrench jdtogregorian jdtojewish jdtojulian jdtounix jewishtojd juliantojd unixtojd contained | |
1 0.000012 syn keyword phpFunctions ccvs_add ccvs_auth ccvs_command ccvs_count ccvs_delete ccvs_done ccvs_init ccvs_lookup ccvs_new ccvs_report ccvs_return ccvs_reverse ccvs_sale ccvs_status ccvs_textvalue ccvs_void contained | |
1 0.000025 syn keyword phpFunctions call_user_method_array call_user_method class_exists get_class_methods get_class_vars get_class get_declared_classes get_object_vars get_parent_class is_a is_subclass_of method_exists contained | |
1 0.000016 syn keyword phpFunctions com VARIANT com_addref com_get com_invoke com_isenum com_load_typelib com_load com_propget com_propput com_propset com_release com_set contained | |
1 0.000051 syn keyword phpFunctions cpdf_add_annotation cpdf_add_outline cpdf_arc cpdf_begin_text cpdf_circle cpdf_clip cpdf_close cpdf_closepath_fill_stroke cpdf_closepath_stroke cpdf_closepath cpdf_continue_text cpdf_curveto cpdf_end_text cpdf_fill_stroke cpdf_fill cpdf_finalize_page cpdf_finalize cpdf_global_set_document_limits cpdf_import_jpeg cpdf_lineto cpdf_moveto cpdf_newpath cpdf_open cpdf_output_buffer cpdf_page_init cpdf_place_inline_image cpdf_rect cpdf_restore cpdf_rlineto cpdf_rmoveto cpdf_rotate_text cpdf_rotate cpdf_save_to_file cpdf_save cpdf_scale cpdf_set_action_url cpdf_set_char_spacing cpdf_set_creator cpdf_set_current_page cpdf_set_font_directories cpdf_set_font_map_file cpdf_set_font cpdf_set_horiz_scaling cpdf_set_keywords cpdf_set_leading cpdf_set_page_animation cpdf_set_subject cpdf_set_text_matrix cpdf_set_text_pos cpdf_set_text_rendering cpdf_set_text_rise cpdf_set_title cpdf_set_viewer_preferences cpdf_set_word_spacing cpdf_setdash cpdf_setflat cpdf_setgray_fill cpdf_setgray_stroke cpdf_set 1 0.000005 syn keyword phpFunctions crack_check crack_closedict crack_getlastmessage crack_opendict contained | |
1 0.000010 syn keyword phpFunctions ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_graph ctype_lower ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit contained | |
1 0.000013 syn keyword phpFunctions curl_close curl_errno curl_error curl_exec curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_setopt curl_version contained | |
1 0.000005 syn keyword phpFunctions cybercash_base64_decode cybercash_base64_encode cybercash_decr cybercash_encr contained | |
1 0.000006 syn keyword phpFunctions cyrus_authenticate cyrus_bind cyrus_close cyrus_connect cyrus_query cyrus_unbind contained | |
1 0.000011 syn keyword phpFunctions checkdate date getdate gettimeofday gmdate gmmktime gmstrftime localtime microtime mktime strftime strtotime time contained | |
1 0.000011 syn keyword phpFunctions dba_close dba_delete dba_exists dba_fetch dba_firstkey dba_handlers dba_insert dba_key_split dba_list dba_nextkey dba_open dba_optimize dba_popen dba_replace dba_sync contained | |
1 0.000010 syn keyword phpFunctions dbase_add_record dbase_close dbase_create dbase_delete_record dbase_get_header_info dbase_get_record_with_names dbase_get_record dbase_numfields dbase_numrecords dbase_open dbase_pack dbase_replace_record contained | |
1 0.000009 syn keyword phpFunctions dblist dbmclose dbmdelete dbmexists dbmfetch dbmfirstkey dbminsert dbmnextkey dbmopen dbmreplace contained | |
1 0.000098 syn keyword phpFunctions dbplus_add dbplus_aql dbplus_chdir dbplus_close dbplus_curr dbplus_errcode dbplus_errno dbplus_find dbplus_first dbplus_flush dbplus_freealllocks dbplus_freelock dbplus_freerlocks dbplus_getlock dbplus_getunique dbplus_info dbplus_last dbplus_lockrel dbplus_next dbplus_open dbplus_prev dbplus_rchperm dbplus_rcreate dbplus_rcrtexact dbplus_rcrtlike dbplus_resolve dbplus_restorepos dbplus_rkeys dbplus_ropen dbplus_rquery dbplus_rrename dbplus_rsecindex dbplus_runlink dbplus_rzap dbplus_savepos dbplus_setindex dbplus_setindexbynumber dbplus_sql dbplus_tcl dbplus_tremove dbplus_undo dbplus_undoprepare dbplus_unlockrel dbplus_unselect dbplus_update dbplus_xlockrel dbplus_xunlockrel contained | |
1 0.000009 syn keyword phpFunctions dbx_close dbx_compare dbx_connect dbx_error dbx_escape_string dbx_fetch_row dbx_query dbx_sort contained | |
1 0.000009 syn keyword phpFunctions dio_close dio_fcntl dio_open dio_read dio_seek dio_stat dio_tcsetattr dio_truncate dio_write contained | |
1 0.000023 syn keyword phpFunctions chdir chroot dir closedir getcwd opendir readdir rewinddir scandir contained | |
1 0.000017 syn keyword phpFunctions domxml_new_doc domxml_open_file domxml_open_mem domxml_version domxml_xmltree domxml_xslt_stylesheet_doc domxml_xslt_stylesheet_file domxml_xslt_stylesheet xpath_eval_expression xpath_eval xpath_new_context xptr_eval xptr_new_context contained | |
1 0.000043 syn keyword phpMethods name specified value create_attribute create_cdata_section create_comment create_element_ns create_element create_entity_reference create_processing_instruction create_text_node doctype document_element dump_file dump_mem get_element_by_id get_elements_by_tagname html_dump_mem xinclude entities internal_subset name notations public_id system_id get_attribute_node get_attribute get_elements_by_tagname has_attribute remove_attribute set_attribute tagname add_namespace append_child append_sibling attributes child_nodes clone_node dump_node first_child get_content has_attributes has_child_nodes insert_before is_blank_node last_child next_sibling node_name node_type node_value owner_document parent_node prefix previous_sibling remove_child replace_child replace_node set_content set_name set_namespace unlink_node data target process result_dump_file result_dump_mem contained | |
1 0.000003 syn keyword phpFunctions dotnet_load contained | |
1 0.000007 syn keyword phpFunctions debug_backtrace debug_print_backtrace error_log error_reporting restore_error_handler set_error_handler trigger_error user_error contained | |
1 0.000007 syn keyword phpFunctions escapeshellarg escapeshellcmd exec passthru proc_close proc_get_status proc_nice proc_open proc_terminate shell_exec system contained | |
1 0.000010 syn keyword phpFunctions fam_cancel_monitor fam_close fam_monitor_collection fam_monitor_directory fam_monitor_file fam_next_event fam_open fam_pending fam_resume_monitor fam_suspend_monitor contained | |
1 0.000034 syn keyword phpFunctions fbsql_affected_rows fbsql_autocommit fbsql_change_user fbsql_close fbsql_commit fbsql_connect fbsql_create_blob fbsql_create_clob fbsql_create_db fbsql_data_seek fbsql_database_password fbsql_database fbsql_db_query fbsql_db_status fbsql_drop_db fbsql_errno fbsql_error fbsql_fetch_array fbsql_fetch_assoc fbsql_fetch_field fbsql_fetch_lengths fbsql_fetch_object fbsql_fetch_row fbsql_field_flags fbsql_field_len fbsql_field_name fbsql_field_seek fbsql_field_table fbsql_field_type fbsql_free_result fbsql_get_autostart_info fbsql_hostname fbsql_insert_id fbsql_list_dbs fbsql_list_fields fbsql_list_tables fbsql_next_result fbsql_num_fields fbsql_num_rows fbsql_password fbsql_pconnect fbsql_query fbsql_read_blob fbsql_read_clob fbsql_result fbsql_rollback fbsql_select_db fbsql_set_lob_mode fbsql_set_transaction fbsql_start_db fbsql_stop_db fbsql_tablename fbsql_username fbsql_warnings contained | |
1 0.000018 syn keyword phpFunctions fdf_add_doc_javascript fdf_add_template fdf_close fdf_create fdf_enum_values fdf_errno fdf_error fdf_get_ap fdf_get_attachment fdf_get_encoding fdf_get_file fdf_get_flags fdf_get_opt fdf_get_status fdf_get_value fdf_get_version fdf_header fdf_next_field_name fdf_open_string fdf_open fdf_remove_item fdf_save_string fdf_save fdf_set_ap fdf_set_encoding fdf_set_file fdf_set_flags fdf_set_javascript_action fdf_set_opt fdf_set_status fdf_set_submit_form_action fdf_set_target_frame fdf_set_value fdf_set_version contained | |
1 0.000007 syn keyword phpFunctions filepro_fieldcount filepro_fieldname filepro_fieldtype filepro_fieldwidth filepro_retrieve filepro_rowcount filepro contained | |
1 0.000061 syn keyword phpFunctions basename chgrp chmod chown clearstatcache copy delete dirname disk_free_space disk_total_space diskfreespace fclose feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents file fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype flock fnmatch fopen fpassthru fputs fread fscanf fseek fstat ftell ftruncate fwrite glob is_dir is_executable is_file is_link is_readable is_uploaded_file is_writable is_writeable link linkinfo lstat mkdir move_uploaded_file parse_ini_file pathinfo pclose popen readfile readlink realpath rename rewind rmdir set_file_buffer stat symlink tempnam tmpfile touch umask unlink contained | |
1 0.000007 syn keyword phpFunctions fribidi_log2vis contained | |
1 0.000026 syn keyword phpFunctions ftp_alloc ftp_cdup ftp_chdir ftp_chmod ftp_close ftp_connect ftp_delete ftp_exec ftp_fget ftp_fput ftp_get_option ftp_get ftp_login ftp_mdtm ftp_mkdir ftp_nb_continue ftp_nb_fget ftp_nb_fput ftp_nb_get ftp_nb_put ftp_nlist ftp_pasv ftp_put ftp_pwd ftp_quit ftp_raw ftp_rawlist ftp_rename ftp_rmdir ftp_set_option ftp_site ftp_size ftp_ssl_connect ftp_systype contained | |
1 0.000011 syn keyword phpFunctions call_user_func_array call_user_func create_function func_get_arg func_get_args func_num_args function_exists get_defined_functions register_shutdown_function register_tick_function unregister_tick_function contained | |
1 0.000009 syn keyword phpFunctions bind_textdomain_codeset bindtextdomain dcgettext dcngettext dgettext dngettext gettext ngettext textdomain contained | |
1 0.000072 syn keyword phpFunctions gmp_abs gmp_add gmp_and gmp_clrbit gmp_cmp gmp_com gmp_div_q gmp_div_qr gmp_div_r gmp_div gmp_divexact gmp_fact gmp_gcd gmp_gcdext gmp_hamdist gmp_init gmp_intval gmp_invert gmp_jacobi gmp_legendre gmp_mod gmp_mul gmp_neg gmp_or gmp_perfect_square gmp_popcount gmp_pow gmp_powm gmp_prob_prime gmp_random gmp_scan0 gmp_scan1 gmp_setbit gmp_sign gmp_sqrt gmp_sqrtrem gmp_sqrtrm gmp_strval gmp_sub gmp_xor contained | |
1 0.000005 syn keyword phpFunctions header headers_list headers_sent setcookie contained | |
1 0.000005 syn keyword phpFunctions hw_api_attribute hwapi_hgcsp hw_api_content hw_api_object contained | |
1 0.000028 syn keyword phpMethods key langdepvalue value values checkin checkout children mimetype read content copy dbstat dcstat dstanchors dstofsrcanchors count reason find ftstat hwstat identify info insert insertanchor insertcollection insertdocument link lock move assign attreditable count insert remove title value object objectbyanchor parents description type remove replace setcommitedversion srcanchors srcsofdst unlock user userlist contained | |
1 0.000040 syn keyword phpFunctions hw_Array2Objrec hw_changeobject hw_Children hw_ChildrenObj hw_Close hw_Connect hw_connection_info hw_cp hw_Deleteobject hw_DocByAnchor hw_DocByAnchorObj hw_Document_Attributes hw_Document_BodyTag hw_Document_Content hw_Document_SetContent hw_Document_Size hw_dummy hw_EditText hw_Error hw_ErrorMsg hw_Free_Document hw_GetAnchors hw_GetAnchorsObj hw_GetAndLock hw_GetChildColl hw_GetChildCollObj hw_GetChildDocColl hw_GetChildDocCollObj hw_GetObject hw_GetObjectByQuery hw_GetObjectByQueryColl hw_GetObjectByQueryCollObj hw_GetObjectByQueryObj hw_GetParents hw_GetParentsObj hw_getrellink hw_GetRemote hw_getremotechildren hw_GetSrcByDestObj hw_GetText hw_getusername hw_Identify hw_InCollections hw_Info hw_InsColl hw_InsDoc hw_insertanchors hw_InsertDocument hw_InsertObject hw_mapid hw_Modifyobject hw_mv hw_New_Document hw_objrec2array hw_Output_Document hw_pConnect hw_PipeDocument hw_Root hw_setlinkroot hw_stat hw_Unlock hw_Who contained | |
1 0.000027 syn keyword phpFunctions ibase_add_user ibase_affected_rows ibase_blob_add ibase_blob_cancel ibase_blob_close ibase_blob_create ibase_blob_echo ibase_blob_get ibase_blob_import ibase_blob_info ibase_blob_open ibase_close ibase_commit_ret ibase_commit ibase_connect ibase_delete_user ibase_drop_db ibase_errcode ibase_errmsg ibase_execute ibase_fetch_assoc ibase_fetch_object ibase_fetch_row ibase_field_info ibase_free_event_handler ibase_free_query ibase_free_result ibase_gen_id ibase_modify_user ibase_name_result ibase_num_fields ibase_num_params ibase_param_info ibase_pconnect ibase_prepare ibase_query ibase_rollback_ret ibase_rollback ibase_set_event_handler ibase_timefmt ibase_trans ibase_wait_event contained | |
1 0.000037 syn keyword phpFunctions iconv_get_encoding iconv_mime_decode_headers iconv_mime_decode iconv_mime_encode iconv_set_encoding iconv_strlen iconv_strpos iconv_strrpos iconv_substr iconv ob_iconv_handler contained | |
1 0.000041 syn keyword phpFunctions ifx_affected_rows ifx_blobinfile_mode ifx_byteasvarchar ifx_close ifx_connect ifx_copy_blob ifx_create_blob ifx_create_char ifx_do ifx_error ifx_errormsg ifx_fetch_row ifx_fieldproperties ifx_fieldtypes ifx_free_blob ifx_free_char ifx_free_result ifx_get_blob ifx_get_char ifx_getsqlca ifx_htmltbl_result ifx_nullformat ifx_num_fields ifx_num_rows ifx_pconnect ifx_prepare ifx_query ifx_textasvarchar ifx_update_blob ifx_update_char ifxus_close_slob ifxus_create_slob ifxus_free_slob ifxus_open_slob ifxus_read_slob ifxus_seek_slob ifxus_tell_slob ifxus_write_slob contained | |
1 0.000075 syn keyword phpFunctions exif_imagetype exif_read_data exif_thumbnail gd_info getimagesize image_type_to_mime_type image2wbmp imagealphablending imageantialias imagearc imagechar imagecharup imagecolorallocate imagecolorallocatealpha imagecolorat imagecolorclosest imagecolorclosestalpha imagecolorclosesthwb imagecolordeallocate imagecolorexact imagecolorexactalpha imagecolormatch imagecolorresolve imagecolorresolvealpha imagecolorset imagecolorsforindex imagecolorstotal imagecolortransparent imagecopy imagecopymerge imagecopymergegray imagecopyresampled imagecopyresized imagecreate imagecreatefromgd2 imagecreatefromgd2part imagecreatefromgd imagecreatefromgif imagecreatefromjpeg imagecreatefrompng imagecreatefromstring imagecreatefromwbmp imagecreatefromxbm imagecreatefromxpm imagecreatetruecolor imagedashedline imagedestroy imageellipse imagefill imagefilledarc imagefilledellipse imagefilledpolygon imagefilledrectangle imagefilltoborder imagefontheight imagefontwidth imageftbbox imagefttext imagegammacorrec 1 0.000041 syn keyword phpFunctions imap_8bit imap_alerts imap_append imap_base64 imap_binary imap_body imap_bodystruct imap_check imap_clearflag_full imap_close imap_createmailbox imap_delete imap_deletemailbox imap_errors imap_expunge imap_fetch_overview imap_fetchbody imap_fetchheader imap_fetchstructure imap_get_quota imap_get_quotaroot imap_getacl imap_getmailboxes imap_getsubscribed imap_header imap_headerinfo imap_headers imap_last_error imap_list imap_listmailbox imap_listscan imap_listsubscribed imap_lsub imap_mail_compose imap_mail_copy imap_mail_move imap_mail imap_mailboxmsginfo imap_mime_header_decode imap_msgno imap_num_msg imap_num_recent imap_open imap_ping imap_qprint imap_renamemailbox imap_reopen imap_rfc822_parse_adrlist imap_rfc822_parse_headers imap_rfc822_write_address imap_scanmailbox imap_search imap_set_quota imap_setacl imap_setflag_full imap_sort imap_status imap_subscribe imap_thread imap_timeout imap_uid imap_undelete imap_unsubscribe imap_utf7_decode imap_utf7_encode imap_utf8 contained | |
1 0.000030 syn keyword phpFunctions assert_options assert dl extension_loaded get_cfg_var get_current_user get_defined_constants get_extension_funcs get_include_path get_included_files get_loaded_extensions get_magic_quotes_gpc get_magic_quotes_runtime get_required_files getenv getlastmod getmygid getmyinode getmypid getmyuid getopt getrusage ini_alter ini_get_all ini_get ini_restore ini_set main memory_get_usage php_ini_scanned_files php_logo_guid php_sapi_name php_uname phpcredits phpinfo phpversion putenv restore_include_path set_include_path set_magic_quotes_runtime set_time_limit version_compare zend_logo_guid zend_version contained | |
1 0.000014 syn keyword phpFunctions ingres_autocommit ingres_close ingres_commit ingres_connect ingres_fetch_array ingres_fetch_object ingres_fetch_row ingres_field_length ingres_field_name ingres_field_nullable ingres_field_precision ingres_field_scale ingres_field_type ingres_num_fields ingres_num_rows ingres_pconnect ingres_query ingres_rollback contained | |
1 0.000016 syn keyword phpFunctions ircg_channel_mode ircg_disconnect ircg_fetch_error_msg ircg_get_username ircg_html_encode ircg_ignore_add ircg_ignore_del ircg_is_conn_alive ircg_join ircg_kick ircg_lookup_format_messages ircg_msg ircg_nick ircg_nickname_escape ircg_nickname_unescape ircg_notice ircg_part ircg_pconnect ircg_register_format_messages ircg_set_current ircg_set_file ircg_set_on_die ircg_topic ircg_whois contained | |
1 0.000004 syn keyword phpFunctions java_last_exception_clear java_last_exception_get contained | |
1 0.000007 syn keyword phpFunctions json_decode json_encode json_last_error contained | |
1 0.000051 syn keyword phpFunctions ldap_8859_to_t61 ldap_add ldap_bind ldap_close ldap_compare ldap_connect ldap_count_entries ldap_delete ldap_dn2ufn ldap_err2str ldap_errno ldap_error ldap_explode_dn ldap_first_attribute ldap_first_entry ldap_first_reference ldap_free_result ldap_get_attributes ldap_get_dn ldap_get_entries ldap_get_option ldap_get_values_len ldap_get_values ldap_list ldap_mod_add ldap_mod_del ldap_mod_replace ldap_modify ldap_next_attribute ldap_next_entry ldap_next_reference ldap_parse_reference ldap_parse_result ldap_read ldap_rename ldap_search ldap_set_option ldap_set_rebind_proc ldap_sort ldap_start_tls ldap_t61_to_8859 ldap_unbind contained | |
1 0.000005 syn keyword phpFunctions lzf_compress lzf_decompress lzf_optimized_for contained | |
1 0.000004 syn keyword phpFunctions ezmlm_hash mail contained | |
1 0.000026 syn keyword phpFunctions mailparse_determine_best_xfer_encoding mailparse_msg_create mailparse_msg_extract_part_file mailparse_msg_extract_part mailparse_msg_free mailparse_msg_get_part_data mailparse_msg_get_part mailparse_msg_get_structure mailparse_msg_parse_file mailparse_msg_parse mailparse_rfc822_parse_addresses mailparse_stream_encode mailparse_uudecode_all contained | |
1 0.000026 syn keyword phpFunctions abs acos acosh asin asinh atan2 atan atanh base_convert bindec ceil cos cosh decbin dechex decoct deg2rad exp expm1 floor fmod getrandmax hexdec hypot is_finite is_infinite is_nan lcg_value log10 log1p log max min mt_getrandmax mt_rand mt_srand octdec pi pow rad2deg rand round sin sinh sqrt srand tan tanh contained | |
1 0.000043 syn keyword phpFunctions mb_convert_case mb_convert_encoding mb_convert_kana mb_convert_variables mb_decode_mimeheader mb_decode_numericentity mb_detect_encoding mb_detect_order mb_encode_mimeheader mb_encode_numericentity mb_ereg_match mb_ereg_replace mb_ereg_search_getpos mb_ereg_search_getregs mb_ereg_search_init mb_ereg_search_pos mb_ereg_search_regs mb_ereg_search_setpos mb_ereg_search mb_ereg mb_eregi_replace mb_eregi mb_get_info mb_http_input mb_http_output mb_internal_encoding mb_language mb_output_handler mb_parse_str mb_preferred_mime_name mb_regex_encoding mb_regex_set_options mb_send_mail mb_split mb_strcut mb_strimwidth mb_strlen mb_strpos mb_strrpos mb_strtolower mb_strtoupper mb_strwidth mb_substitute_character mb_substr_count mb_substr contained | |
1 0.000031 syn keyword phpFunctions mcal_append_event mcal_close mcal_create_calendar mcal_date_compare mcal_date_valid mcal_day_of_week mcal_day_of_year mcal_days_in_month mcal_delete_calendar mcal_delete_event mcal_event_add_attribute mcal_event_init mcal_event_set_alarm mcal_event_set_category mcal_event_set_class mcal_event_set_description mcal_event_set_end mcal_event_set_recur_daily mcal_event_set_recur_monthly_mday mcal_event_set_recur_monthly_wday mcal_event_set_recur_none mcal_event_set_recur_weekly mcal_event_set_recur_yearly mcal_event_set_start mcal_event_set_title mcal_expunge mcal_fetch_current_stream_event mcal_fetch_event mcal_is_leap_year mcal_list_alarms mcal_list_events mcal_next_recurrence mcal_open mcal_popen mcal_rename_calendar mcal_reopen mcal_snooze mcal_store_event mcal_time_valid mcal_week_of_year contained | |
1 0.000059 syn keyword phpFunctions mcrypt_cbc mcrypt_cfb mcrypt_create_iv mcrypt_decrypt mcrypt_ecb mcrypt_enc_get_algorithms_name mcrypt_enc_get_block_size mcrypt_enc_get_iv_size mcrypt_enc_get_key_size mcrypt_enc_get_modes_name mcrypt_enc_get_supported_key_sizes mcrypt_enc_is_block_algorithm_mode mcrypt_enc_is_block_algorithm mcrypt_enc_is_block_mode mcrypt_enc_self_test mcrypt_encrypt mcrypt_generic_deinit mcrypt_generic_end mcrypt_generic_init mcrypt_generic mcrypt_get_block_size mcrypt_get_cipher_name mcrypt_get_iv_size mcrypt_get_key_size mcrypt_list_algorithms mcrypt_list_modes mcrypt_module_close mcrypt_module_get_algo_block_size mcrypt_module_get_algo_key_size mcrypt_module_get_supported_key_sizes mcrypt_module_is_block_algorithm_mode mcrypt_module_is_block_algorithm mcrypt_module_is_block_mode mcrypt_module_open mcrypt_module_self_test mcrypt_ofb mdecrypt_generic contained | |
1 0.000072 syn keyword phpFunctions mcve_adduser mcve_adduserarg mcve_bt mcve_checkstatus mcve_chkpwd mcve_chngpwd mcve_completeauthorizations mcve_connect mcve_connectionerror mcve_deleteresponse mcve_deletetrans mcve_deleteusersetup mcve_deluser mcve_destroyconn mcve_destroyengine mcve_disableuser mcve_edituser mcve_enableuser mcve_force mcve_getcell mcve_getcellbynum mcve_getcommadelimited mcve_getheader mcve_getuserarg mcve_getuserparam mcve_gft mcve_gl mcve_gut mcve_initconn mcve_initengine mcve_initusersetup mcve_iscommadelimited mcve_liststats mcve_listusers mcve_maxconntimeout mcve_monitor mcve_numcolumns mcve_numrows mcve_override mcve_parsecommadelimited mcve_ping mcve_preauth mcve_preauthcompletion mcve_qc mcve_responseparam mcve_return mcve_returncode mcve_returnstatus mcve_sale mcve_setblocking mcve_setdropfile mcve_setip mcve_setssl_files mcve_setssl mcve_settimeout mcve_settle mcve_text_avs mcve_text_code mcve_text_cv mcve_transactionauth mcve_transactionavs mcve_transactionbatch mcve_transactioncv mcve_ 1 0.000007 syn keyword phpFunctions mhash_count mhash_get_block_size mhash_get_hash_name mhash_keygen_s2k mhash contained | |
1 0.000003 syn keyword phpFunctions mime_content_type contained | |
1 0.000016 syn keyword phpFunctions ming_setcubicthreshold ming_setscale ming_useswfversion SWFAction SWFBitmap swfbutton_keypress SWFbutton SWFDisplayItem SWFFill SWFFont SWFGradient SWFMorph SWFMovie SWFShape SWFSprite SWFText SWFTextField contained | |
1 0.000040 syn keyword phpMethods getHeight getWidth addAction addShape setAction setdown setHit setOver setUp addColor move moveTo multColor remove Rotate rotateTo scale scaleTo setDepth setName setRatio skewX skewXTo skewY skewYTo moveTo rotateTo scaleTo skewXTo skewYTo getwidth addEntry getshape1 getshape2 add nextframe output remove save setbackground setdimension setframes setrate streammp3 addFill drawCurve drawCurveTo drawLine drawLineTo movePen movePenTo setLeftFill setLine setRightFill add nextframe remove setframes addString getWidth moveTo setColor setFont setHeight setSpacing addstring align setbounds setcolor setFont setHeight setindentation setLeftMargin setLineSpacing setMargins setname setrightMargin contained | |
1 0.000012 syn keyword phpFunctions connection_aborted connection_status connection_timeout constant define defined die eval exit get_browser highlight_file highlight_string ignore_user_abort pack show_source sleep uniqid unpack usleep contained | |
1 0.000012 syn keyword phpFunctions udm_add_search_limit udm_alloc_agent udm_api_version udm_cat_list udm_cat_path udm_check_charset udm_check_stored udm_clear_search_limits udm_close_stored udm_crc32 udm_errno udm_error udm_find udm_free_agent udm_free_ispell_data udm_free_res udm_get_doc_count udm_get_res_field udm_get_res_param udm_load_ispell_data udm_open_stored udm_set_agent_param contained | |
1 0.000011 syn keyword phpFunctions msession_connect msession_count msession_create msession_destroy msession_disconnect msession_find msession_get_array msession_get msession_getdata msession_inc msession_list msession_listvar msession_lock msession_plugin msession_randstr msession_set_array msession_set msession_setdata msession_timeout msession_uniq msession_unlock contained | |
1 0.000023 syn keyword phpFunctions msql_affected_rows msql_close msql_connect msql_create_db msql_createdb msql_data_seek msql_dbname msql_drop_db msql_dropdb msql_error msql_fetch_array msql_fetch_field msql_fetch_object msql_fetch_row msql_field_seek msql_fieldflags msql_fieldlen msql_fieldname msql_fieldtable msql_fieldtype msql_free_result msql_freeresult msql_list_dbs msql_list_fields msql_list_tables msql_listdbs msql_listfields msql_listtables msql_num_fields msql_num_rows msql_numfields msql_numrows msql_pconnect msql_query msql_regcase msql_result msql_select_db msql_selectdb msql_tablename msql contained | |
1 0.000015 syn keyword phpFunctions mssql_bind mssql_close mssql_connect mssql_data_seek mssql_execute mssql_fetch_array mssql_fetch_assoc mssql_fetch_batch mssql_fetch_field mssql_fetch_object mssql_fetch_row mssql_field_length mssql_field_name mssql_field_seek mssql_field_type mssql_free_result mssql_free_statement mssql_get_last_message mssql_guid_string mssql_init mssql_min_error_severity mssql_min_message_severity mssql_next_result mssql_num_fields mssql_num_rows mssql_pconnect mssql_query mssql_result mssql_rows_affected mssql_select_db contained | |
1 0.000004 syn keyword phpFunctions muscat_close muscat_get muscat_give muscat_setup_net muscat_setup contained | |
1 0.000030 syn keyword phpFunctions mysql_affected_rows mysql_change_user mysql_client_encoding mysql_close mysql_connect mysql_create_db mysql_data_seek mysql_db_name mysql_db_query mysql_drop_db mysql_errno mysql_error mysql_escape_string mysql_fetch_array mysql_fetch_assoc mysql_fetch_field mysql_fetch_lengths mysql_fetch_object mysql_fetch_row mysql_field_flags mysql_field_len mysql_field_name mysql_field_seek mysql_field_table mysql_field_type mysql_free_result mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql_insert_id mysql_list_dbs mysql_list_fields mysql_list_processes mysql_list_tables mysql_num_fields mysql_num_rows mysql_pconnect mysql_ping mysql_query mysql_real_escape_string mysql_result mysql_select_db mysql_stat mysql_tablename mysql_thread_id mysql_unbuffered_query contained | |
1 0.000062 syn keyword phpFunctions mysqli_affected_rows mysqli_autocommit mysqli_bind_param mysqli_bind_result mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect mysqli_data_seek mysqli_debug mysqli_disable_reads_from_master mysqli_disable_rpl_parse mysqli_dump_debug_info mysqli_enable_reads_from_master mysqli_enable_rpl_parse mysqli_errno mysqli_error mysqli_execute mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_fetch mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_client_info mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_master_query mysqli_num_fields mysqli_num_rows mysqli_options mysqli_param_count mysqli_ping mysqli_prepare_result mysqli_prepare mysqli_profiler mysqli_query mysqli_read_query_result mysqli_real_connect 1 0.000084 syn keyword phpFunctions ncurses_addch ncurses_addchnstr ncurses_addchstr ncurses_addnstr ncurses_addstr ncurses_assume_default_colors ncurses_attroff ncurses_attron ncurses_attrset ncurses_baudrate ncurses_beep ncurses_bkgd ncurses_bkgdset ncurses_border ncurses_bottom_panel ncurses_can_change_color ncurses_cbreak ncurses_clear ncurses_clrtobot ncurses_clrtoeol ncurses_color_content ncurses_color_set ncurses_curs_set ncurses_def_prog_mode ncurses_def_shell_mode ncurses_define_key ncurses_del_panel ncurses_delay_output ncurses_delch ncurses_deleteln ncurses_delwin ncurses_doupdate ncurses_echo ncurses_echochar ncurses_end ncurses_erase ncurses_erasechar ncurses_filter ncurses_flash ncurses_flushinp ncurses_getch ncurses_getmaxyx ncurses_getmouse ncurses_getyx ncurses_halfdelay ncurses_has_colors ncurses_has_ic ncurses_has_il ncurses_has_key ncurses_hide_panel ncurses_hline ncurses_inch ncurses_init_color ncurses_init_pair ncurses_init ncurses_insch ncurses_insdelln ncurses_insertln ncurses_insstr ncurses_ins 1 0.000014 syn keyword phpFunctions checkdnsrr closelog debugger_off debugger_on define_syslog_variables dns_check_record dns_get_mx dns_get_record fsockopen gethostbyaddr gethostbyname gethostbynamel getmxrr getprotobyname getprotobynumber getservbyname getservbyport ip2long long2ip openlog pfsockopen socket_get_status socket_set_blocking socket_set_timeout syslog contained | |
1 0.000005 syn keyword phpFunctions yp_all yp_cat yp_err_string yp_errno yp_first yp_get_default_domain yp_master yp_match yp_next yp_order contained | |
1 0.000008 syn keyword phpFunctions notes_body notes_copy_db notes_create_db notes_create_note notes_drop_db notes_find_note notes_header_info notes_list_msgs notes_mark_read notes_mark_unread notes_nav_create notes_search notes_unread notes_version contained | |
1 0.000003 syn keyword phpFunctions nsapi_request_headers nsapi_response_headers nsapi_virtual contained | |
1 0.000008 syn keyword phpFunctions aggregate_info aggregate_methods_by_list aggregate_methods_by_regexp aggregate_methods aggregate_properties_by_list aggregate_properties_by_regexp aggregate_properties aggregate aggregation_info deaggregate contained | |
1 0.000025 syn keyword phpFunctions ocibindbyname ocicancel ocicloselob ocicollappend ocicollassign ocicollassignelem ocicollgetelem ocicollmax ocicollsize ocicolltrim ocicolumnisnull ocicolumnname ocicolumnprecision ocicolumnscale ocicolumnsize ocicolumntype ocicolumntyperaw ocicommit ocidefinebyname ocierror ociexecute ocifetch ocifetchinto ocifetchstatement ocifreecollection ocifreecursor ocifreedesc ocifreestatement ociinternaldebug ociloadlob ocilogoff ocilogon ocinewcollection ocinewcursor ocinewdescriptor ocinlogon ocinumcols ociparse ociplogon ociresult ocirollback ocirowcount ocisavelob ocisavelobfile ociserverversion ocisetprefetch ocistatementtype ociwritelobtofile ociwritetemporarylob contained | |
1 0.000025 syn keyword phpFunctions odbc_autocommit odbc_binmode odbc_close_all odbc_close odbc_columnprivileges odbc_columns odbc_commit odbc_connect odbc_cursor odbc_data_source odbc_do odbc_error odbc_errormsg odbc_exec odbc_execute odbc_fetch_array odbc_fetch_into odbc_fetch_object odbc_fetch_row odbc_field_len odbc_field_name odbc_field_num odbc_field_precision odbc_field_scale odbc_field_type odbc_foreignkeys odbc_free_result odbc_gettypeinfo odbc_longreadlen odbc_next_result odbc_num_fields odbc_num_rows odbc_pconnect odbc_prepare odbc_primarykeys odbc_procedurecolumns odbc_procedures odbc_result_all odbc_result odbc_rollback odbc_setoption odbc_specialcolumns odbc_statistics odbc_tableprivileges odbc_tables contained | |
1 0.000020 syn keyword phpFunctions openssl_csr_export_to_file openssl_csr_export openssl_csr_new openssl_csr_sign openssl_error_string openssl_free_key openssl_get_privatekey openssl_get_publickey openssl_open openssl_pkcs7_decrypt openssl_pkcs7_encrypt openssl_pkcs7_sign openssl_pkcs7_verify openssl_pkey_export_to_file openssl_pkey_export openssl_pkey_get_private openssl_pkey_get_public openssl_pkey_new openssl_private_decrypt openssl_private_encrypt openssl_public_decrypt openssl_public_encrypt openssl_seal openssl_sign openssl_verify openssl_x509_check_private_key openssl_x509_checkpurpose openssl_x509_export_to_file openssl_x509_export openssl_x509_free openssl_x509_parse openssl_x509_read contained | |
1 0.000011 syn keyword phpFunctions ora_bind ora_close ora_columnname ora_columnsize ora_columntype ora_commit ora_commitoff ora_commiton ora_do ora_error ora_errorcode ora_exec ora_fetch_into ora_fetch ora_getcolumn ora_logoff ora_logon ora_numcols ora_numrows ora_open ora_parse ora_plogon ora_rollback contained | |
1 0.000009 syn keyword phpFunctions flush ob_clean ob_end_clean ob_end_flush ob_flush ob_get_clean ob_get_contents ob_get_flush ob_get_length ob_get_level ob_get_status ob_gzhandler ob_implicit_flush ob_list_handlers ob_start output_add_rewrite_var output_reset_rewrite_vars contained | |
1 0.000003 syn keyword phpFunctions overload contained | |
1 0.000023 syn keyword phpFunctions ovrimos_close ovrimos_commit ovrimos_connect ovrimos_cursor ovrimos_exec ovrimos_execute ovrimos_fetch_into ovrimos_fetch_row ovrimos_field_len ovrimos_field_name ovrimos_field_num ovrimos_field_type ovrimos_free_result ovrimos_longreadlen ovrimos_num_fields ovrimos_num_rows ovrimos_prepare ovrimos_result_all ovrimos_result ovrimos_rollback contained | |
1 0.000009 syn keyword phpFunctions pcntl_exec pcntl_fork pcntl_signal pcntl_waitpid pcntl_wexitstatus pcntl_wifexited pcntl_wifsignaled pcntl_wifstopped pcntl_wstopsig pcntl_wtermsig contained | |
1 0.000008 syn keyword phpFunctions preg_grep preg_match_all preg_match preg_quote preg_replace_callback preg_replace preg_split contained | |
1 0.000060 syn keyword phpFunctions pdf_add_annotation pdf_add_bookmark pdf_add_launchlink pdf_add_locallink pdf_add_note pdf_add_outline pdf_add_pdflink pdf_add_thumbnail pdf_add_weblink pdf_arc pdf_arcn pdf_attach_file pdf_begin_page pdf_begin_pattern pdf_begin_template pdf_circle pdf_clip pdf_close_image pdf_close_pdi_page pdf_close_pdi pdf_close pdf_closepath_fill_stroke pdf_closepath_stroke pdf_closepath pdf_concat pdf_continue_text pdf_curveto pdf_delete pdf_end_page pdf_end_pattern pdf_end_template pdf_endpath pdf_fill_stroke pdf_fill pdf_findfont pdf_get_buffer pdf_get_font pdf_get_fontname pdf_get_fontsize pdf_get_image_height pdf_get_image_width pdf_get_majorversion pdf_get_minorversion pdf_get_parameter pdf_get_pdi_parameter pdf_get_pdi_value pdf_get_value pdf_initgraphics pdf_lineto pdf_makespotcolor pdf_moveto pdf_new pdf_open_CCITT pdf_open_file pdf_open_gif pdf_open_image_file pdf_open_image pdf_open_jpeg pdf_open_memory_image pdf_open_pdi_page pdf_open_pdi pdf_open_png pdf_open_tiff pdf_open pdf_place_i 1 0.000012 syn keyword phpFunctions pfpro_cleanup pfpro_init pfpro_process_raw pfpro_process pfpro_version contained | |
1 0.000033 syn keyword phpFunctions pg_affected_rows pg_cancel_query pg_client_encoding pg_close pg_connect pg_connection_busy pg_connection_reset pg_connection_status pg_convert pg_copy_from pg_copy_to pg_dbname pg_delete pg_end_copy pg_escape_bytea pg_escape_string pg_fetch_all pg_fetch_array pg_fetch_assoc pg_fetch_object pg_fetch_result pg_fetch_row pg_field_is_null pg_field_name pg_field_num pg_field_prtlen pg_field_size pg_field_type pg_free_result pg_get_notify pg_get_pid pg_get_result pg_host pg_insert pg_last_error pg_last_notice pg_last_oid pg_lo_close pg_lo_create pg_lo_export pg_lo_import pg_lo_open pg_lo_read_all pg_lo_read pg_lo_seek pg_lo_tell pg_lo_unlink pg_lo_write pg_meta_data pg_num_fields pg_num_rows pg_options pg_pconnect pg_ping pg_port pg_put_line pg_query pg_result_error pg_result_seek pg_result_status pg_select pg_send_query pg_set_client_encoding pg_trace pg_tty pg_unescape_bytea pg_untrace pg_update contained | |
1 0.000016 syn keyword phpFunctions posix_ctermid posix_get_last_error posix_getcwd posix_getegid posix_geteuid posix_getgid posix_getgrgid posix_getgrnam posix_getgroups posix_getlogin posix_getpgid posix_getpgrp posix_getpid posix_getppid posix_getpwnam posix_getpwuid posix_getrlimit posix_getsid posix_getuid posix_isatty posix_kill posix_mkfifo posix_setegid posix_seteuid posix_setgid posix_setpgid posix_setsid posix_setuid posix_strerror posix_times posix_ttyname posix_uname contained | |
1 0.000017 syn keyword phpFunctions printer_abort printer_close printer_create_brush printer_create_dc printer_create_font printer_create_pen printer_delete_brush printer_delete_dc printer_delete_font printer_delete_pen printer_draw_bmp printer_draw_chord printer_draw_elipse printer_draw_line printer_draw_pie printer_draw_rectangle printer_draw_roundrect printer_draw_text printer_end_doc printer_end_page printer_get_option printer_list printer_logical_fontheight printer_open printer_select_brush printer_select_font printer_select_pen printer_set_option printer_start_doc printer_start_page printer_write contained | |
1 0.000010 syn keyword phpFunctions pspell_add_to_personal pspell_add_to_session pspell_check pspell_clear_session pspell_config_create pspell_config_ignore pspell_config_mode pspell_config_personal pspell_config_repl pspell_config_runtogether pspell_config_save_repl pspell_new_config pspell_new_personal pspell_new pspell_save_wordlist pspell_store_replacement pspell_suggest contained | |
1 0.000002 syn keyword phpFunctions qdom_error qdom_tree contained | |
1 0.000006 syn keyword phpFunctions readline_add_history readline_clear_history readline_completion_function readline_info readline_list_history readline_read_history readline_write_history readline contained | |
1 0.000003 syn keyword phpFunctions recode_file recode_string recode contained | |
1 0.000006 syn keyword phpFunctions ereg_replace ereg eregi_replace eregi split spliti sql_regcase contained | |
1 0.000009 syn keyword phpFunctions ftok msg_get_queue msg_receive msg_remove_queue msg_send msg_set_queue msg_stat_queue sem_acquire sem_get sem_release sem_remove shm_attach shm_detach shm_get_var shm_put_var shm_remove_var shm_remove contained | |
1 0.000011 syn keyword phpFunctions sesam_affected_rows sesam_commit sesam_connect sesam_diagnostic sesam_disconnect sesam_errormsg sesam_execimm sesam_fetch_array sesam_fetch_result sesam_fetch_row sesam_field_array sesam_field_name sesam_free_result sesam_num_fields sesam_query sesam_rollback sesam_seek_row sesam_settransaction contained | |
1 0.000013 syn keyword phpFunctions session_cache_expire session_cache_limiter session_decode session_destroy session_encode session_get_cookie_params session_id session_is_registered session_module_name session_name session_regenerate_id session_register session_save_path session_set_cookie_params session_set_save_handler session_start session_unregister session_unset session_write_close contained | |
1 0.000004 syn keyword phpFunctions shmop_close shmop_delete shmop_open shmop_read shmop_size shmop_write contained | |
1 0.000009 syn keyword phpFunctions snmp_get_quick_print snmp_set_quick_print snmpget snmprealwalk snmpset snmpwalk snmpwalkoid contained | |
1 0.000020 syn keyword phpFunctions socket_accept socket_bind socket_clear_error socket_close socket_connect socket_create_listen socket_create_pair socket_create socket_get_option socket_getpeername socket_getsockname socket_iovec_add socket_iovec_alloc socket_iovec_delete socket_iovec_fetch socket_iovec_free socket_iovec_set socket_last_error socket_listen socket_read socket_readv socket_recv socket_recvfrom socket_recvmsg socket_select socket_send socket_sendmsg socket_sendto socket_set_block socket_set_nonblock socket_set_option socket_shutdown socket_strerror socket_write socket_writev contained | |
1 0.000022 syn keyword phpFunctions sqlite_array_query sqlite_busy_timeout sqlite_changes sqlite_close sqlite_column sqlite_create_aggregate sqlite_create_function sqlite_current sqlite_error_string sqlite_escape_string sqlite_fetch_array sqlite_fetch_single sqlite_fetch_string sqlite_field_name sqlite_has_more sqlite_last_error sqlite_last_insert_rowid sqlite_libencoding sqlite_libversion sqlite_next sqlite_num_fields sqlite_num_rows sqlite_open sqlite_popen sqlite_query sqlite_rewind sqlite_seek sqlite_udf_decode_binary sqlite_udf_encode_binary sqlite_unbuffered_query contained | |
1 0.000027 syn keyword phpFunctions stream_context_create stream_context_get_options stream_context_set_option stream_context_set_params stream_copy_to_stream stream_filter_append stream_filter_prepend stream_filter_register stream_get_contents stream_get_filters stream_get_line stream_get_meta_data stream_get_transports stream_get_wrappers stream_register_wrapper stream_select stream_set_blocking stream_set_timeout stream_set_write_buffer stream_socket_accept stream_socket_client stream_socket_get_name stream_socket_recvfrom stream_socket_sendto stream_socket_server stream_wrapper_register contained | |
1 0.000055 syn keyword phpFunctions addcslashes addslashes bin2hex chop chr chunk_split convert_cyr_string count_chars crc32 crypt explode fprintf get_html_translation_table hebrev hebrevc html_entity_decode htmlentities htmlspecialchars implode join levenshtein localeconv ltrim md5_file md5 metaphone money_format nl_langinfo nl2br number_format ord parse_str print printf quoted_printable_decode quotemeta rtrim setlocale sha1_file sha1 similar_text soundex sprintf sscanf str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split str_word_count strcasecmp strchr strcmp strcoll strcspn strip_tags stripcslashes stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpos strrchr strrev strripos strrpos strspn strstr strtok strtolower strtoupper strtr substr_compare substr_count substr_replace substr trim ucfirst ucwords vprintf vsprintf wordwrap contained | |
1 0.000048 syn keyword phpFunctions swf_actiongeturl swf_actiongotoframe swf_actiongotolabel swf_actionnextframe swf_actionplay swf_actionprevframe swf_actionsettarget swf_actionstop swf_actiontogglequality swf_actionwaitforframe swf_addbuttonrecord swf_addcolor swf_closefile swf_definebitmap swf_definefont swf_defineline swf_definepoly swf_definerect swf_definetext swf_endbutton swf_enddoaction swf_endshape swf_endsymbol swf_fontsize swf_fontslant swf_fonttracking swf_getbitmapinfo swf_getfontinfo swf_getframe swf_labelframe swf_lookat swf_modifyobject swf_mulcolor swf_nextid swf_oncondition swf_openfile swf_ortho2 swf_ortho swf_perspective swf_placeobject swf_polarview swf_popmatrix swf_posround swf_pushmatrix swf_removeobject swf_rotate swf_scale swf_setfont swf_setframe swf_shapearc swf_shapecurveto3 swf_shapecurveto swf_shapefillbitmapclip swf_shapefillbitmaptile swf_shapefilloff swf_shapefillsolid swf_shapelinesolid swf_shapelineto swf_shapemoveto swf_showframe swf_startbutton swf_startdoaction swf_startshape swf 1 0.000028 syn keyword phpFunctions sybase_affected_rows sybase_close sybase_connect sybase_data_seek sybase_deadlock_retry_count sybase_fetch_array sybase_fetch_assoc sybase_fetch_field sybase_fetch_object sybase_fetch_row sybase_field_seek sybase_free_result sybase_get_last_message sybase_min_client_severity sybase_min_error_severity sybase_min_message_severity sybase_min_server_severity sybase_num_fields sybase_num_rows sybase_pconnect sybase_query sybase_result sybase_select_db sybase_set_message_handler sybase_unbuffered_query contained | |
1 0.000019 syn keyword phpFunctions tidy_access_count tidy_clean_repair tidy_config_count tidy_diagnose tidy_error_count tidy_get_body tidy_get_config tidy_get_error_buffer tidy_get_head tidy_get_html_ver tidy_get_html tidy_get_output tidy_get_release tidy_get_root tidy_get_status tidy_getopt tidy_is_xhtml tidy_load_config tidy_parse_file tidy_parse_string tidy_repair_file tidy_repair_string tidy_reset_config tidy_save_config tidy_set_encoding tidy_setopt tidy_warning_count contained | |
1 0.000009 syn keyword phpMethods attributes children get_attr get_nodes has_children has_siblings is_asp is_comment is_html is_jsp is_jste is_text is_xhtml is_xml next prev tidy_node contained | |
1 0.000003 syn keyword phpFunctions token_get_all token_name contained | |
1 0.000007 syn keyword phpFunctions base64_decode base64_encode get_meta_tags http_build_query parse_url rawurldecode rawurlencode urldecode urlencode contained | |
1 0.000017 syn keyword phpFunctions doubleval empty floatval get_defined_vars get_resource_type gettype import_request_variables intval is_array is_bool is_callable is_double is_float is_int is_integer is_long is_null is_numeric is_object is_real is_resource is_scalar is_string isset print_r serialize settype strval unserialize unset var_dump var_export contained | |
1 0.000025 syn keyword phpFunctions vpopmail_add_alias_domain_ex vpopmail_add_alias_domain vpopmail_add_domain_ex vpopmail_add_domain vpopmail_add_user vpopmail_alias_add vpopmail_alias_del_domain vpopmail_alias_del vpopmail_alias_get_all vpopmail_alias_get vpopmail_auth_user vpopmail_del_domain_ex vpopmail_del_domain vpopmail_del_user vpopmail_error vpopmail_passwd vpopmail_set_user_quota contained | |
1 0.000006 syn keyword phpFunctions w32api_deftype w32api_init_dtype w32api_invoke_function w32api_register_function w32api_set_call_method contained | |
1 0.000006 syn keyword phpFunctions wddx_add_vars wddx_deserialize wddx_packet_end wddx_packet_start wddx_serialize_value wddx_serialize_vars contained | |
1 0.000019 syn keyword phpFunctions utf8_decode utf8_encode xml_error_string xml_get_current_byte_index xml_get_current_column_number xml_get_current_line_number xml_get_error_code xml_parse_into_struct xml_parse xml_parser_create_ns xml_parser_create xml_parser_free xml_parser_get_option xml_parser_set_option xml_set_character_data_handler xml_set_default_handler xml_set_element_handler xml_set_end_namespace_decl_handler xml_set_external_entity_ref_handler xml_set_notation_decl_handler xml_set_object xml_set_processing_instruction_handler xml_set_start_namespace_decl_handler xml_set_unparsed_entity_decl_handler contained | |
1 0.000035 syn keyword phpFunctions xmlrpc_decode_request xmlrpc_decode xmlrpc_encode_request xmlrpc_encode xmlrpc_get_type xmlrpc_parse_method_descriptions xmlrpc_server_add_introspection_data xmlrpc_server_call_method xmlrpc_server_create xmlrpc_server_destroy xmlrpc_server_register_introspection_callback xmlrpc_server_register_method xmlrpc_set_type contained | |
1 0.000011 syn keyword phpFunctions xslt_create xslt_errno xslt_error xslt_free xslt_output_process xslt_set_base xslt_set_encoding xslt_set_error_handler xslt_set_log xslt_set_sax_handler xslt_set_sax_handlers xslt_set_scheme_handler xslt_set_scheme_handlers contained | |
1 0.000012 syn keyword phpFunctions yaz_addinfo yaz_ccl_conf yaz_ccl_parse yaz_close yaz_connect yaz_database yaz_element yaz_errno yaz_error yaz_es_result yaz_get_option yaz_hits yaz_itemorder yaz_present yaz_range yaz_record yaz_scan_result yaz_scan yaz_schema yaz_search yaz_set_option yaz_sort yaz_syntax yaz_wait contained | |
1 0.000008 syn keyword phpFunctions zip_close zip_entry_close zip_entry_compressedsize zip_entry_compressionmethod zip_entry_filesize zip_entry_name zip_entry_open zip_entry_read zip_open zip_read contained | |
1 0.000012 syn keyword phpFunctions gzclose gzcompress gzdeflate gzencode gzeof gzfile gzgetc gzgets gzgetss gzinflate gzopen gzpassthru gzputs gzread gzrewind gzseek gztell gzuncompress gzwrite readgzfile zlib_get_coding_type contained | |
1 0.000009 if exists( "php_baselib" ) | |
syn keyword phpMethods query next_record num_rows affected_rows nf f p np num_fields haltmsg seek link_id query_id metadata table_names nextid connect halt free register unregister is_registered delete url purl self_url pself_url hidden_session add_query padd_query reimport_get_vars reimport_post_vars reimport_cookie_vars set_container set_tokenname release_token put_headers get_id get_id put_id freeze thaw gc reimport_any_vars start url purl login_if is_authenticated auth_preauth auth_loginform auth_validatelogin auth_refreshlogin auth_registerform auth_doregister start check have_perm permsum perm_invalid contained | |
syn keyword phpFunctions page_open page_close sess_load sess_save contained | |
endif | |
" Conditional | |
1 0.000010 syn keyword phpConditional declare else enddeclare endswitch elseif endif if switch contained | |
" Repeat | |
1 0.000008 syn keyword phpRepeat as do endfor endforeach endwhile for foreach while contained | |
" Repeat | |
1 0.000004 syn keyword phpLabel case default switch contained | |
" Statement | |
1 0.000006 syn keyword phpStatement return break continue exit goto contained | |
" Keyword | |
1 0.000005 syn keyword phpKeyword var const contained | |
" Type | |
1 0.000007 syn keyword phpType bool boolean int integer real double float string array object NULL contained | |
" Structure | |
1 0.000006 syn keyword phpStructure namespace extends implements instanceof parent self contained | |
" Operator | |
1 0.000008 syn match phpOperator "[-=+%^&|*!.~?:]" contained display | |
1 0.000004 syn match phpOperator "[-+*/%^&|.]=" contained display | |
1 0.000004 syn match phpOperator "/[^*/]"me=e-1 contained display | |
1 0.000002 syn match phpOperator "\$" contained display | |
1 0.000003 syn match phpOperator "&&\|\<and\>" contained display | |
1 0.000003 syn match phpOperator "||\|\<x\=or\>" contained display | |
1 0.000004 syn match phpRelation "[!=<>]=" contained display | |
1 0.000002 syn match phpRelation "[<>]" contained display | |
1 0.000004 syn match phpMemberSelector "->" contained display | |
1 0.000004 syn match phpVarSelector "\$" contained display | |
" Identifier | |
1 0.000014 syn match phpIdentifier "$\h\w*" contained contains=phpEnvVar,phpIntVar,phpVarSelector display | |
1 0.000010 syn match phpIdentifierSimply "${\h\w*}" contains=phpOperator,phpParent contained display | |
1 0.000014 syn region phpIdentifierComplex matchgroup=phpParent start="{\$"rs=e-1 end="}" contains=phpIdentifier,phpMemberSelector,phpVarSelector,phpIdentifierComplexP contained extend | |
1 0.000006 syn region phpIdentifierComplexP matchgroup=phpParent start="\[" end="]" contains=@phpClInside contained | |
" Interpolated indentifiers (inside strings) | |
1 0.000005 syn match phpBrackets "[][}{]" contained display | |
" errors | |
1 0.000006 syn match phpInterpSimpleError "\[[^]]*\]" contained display " fallback (if nothing else matches) | |
1 0.000005 syn match phpInterpSimpleError "->[^a-zA-Z_]" contained display | |
" make sure these stay above the correct DollarCurlies so they don't take priority | |
1 0.000005 syn match phpInterpBogusDollarCurley "${[^}]*}" contained display " fallback (if nothing else matches) | |
1 0.000005 syn match phpinterpSimpleBracketsInner "\w\+" contained | |
1 0.000006 syn match phpInterpSimpleBrackets "\[\h\w*]" contained contains=phpBrackets,phpInterpSimpleBracketsInner | |
1 0.000011 syn match phpInterpSimpleBrackets "\[\d\+]" contained contains=phpBrackets,phpInterpSimpleBracketsInner | |
1 0.000005 syn match phpInterpSimpleBrackets "\[0[xX]\x\+]" contained contains=phpBrackets,phpInterpSimpleBracketsInner | |
1 0.000010 syn match phpInterpSimple "\$\h\w*\(\[[^]]*\]\|->\h\w*\)\?" contained contains=phpInterpSimpleBrackets,phpIdentifier,phpInterpSimpleError,phpMethods,phpMemberSelector display | |
1 0.000004 syn match phpInterpVarname "\h\w*" contained | |
1 0.000004 syn match phpInterpMethodName "\h\w*" contained " default color | |
1 0.000005 syn match phpInterpSimpleCurly "\${\h\w*}" contains=phpInterpVarname contained extend | |
1 0.000008 syn region phpInterpDollarCurley1Helper matchgroup=phpParent start="{" end="\[" contains=phpInterpVarname contained | |
1 0.000011 syn region phpInterpDollarCurly1 matchgroup=phpParent start="\${\h\w*\["rs=s+1 end="]}" contains=phpInterpDollarCurley1Helper,@phpClConst contained extend | |
1 0.000007 syn match phpInterpDollarCurley2Helper "{\h\w*->" contains=phpBrackets,phpInterpVarname,phpMemberSelector contained | |
1 0.000008 syn region phpInterpDollarCurly2 matchgroup=phpParent start="\${\h\w*->"rs=s+1 end="}" contains=phpInterpDollarCurley2Helper,phpInterpMethodName contained | |
1 0.000003 syn match phpInterpBogusDollarCurley "${\h\w*->}" contained display | |
1 0.000003 syn match phpInterpBogusDollarCurley "${\h\w*\[]}" contained display | |
1 0.000010 syn region phpInterpComplex matchgroup=phpParent start="{\$"rs=e-1 end="}" contains=phpIdentifier,phpMemberSelector,phpVarSelector,phpIdentifierComplexP contained extend | |
1 0.000007 syn region phpIdentifierComplexP matchgroup=phpParent start="\[" end="]" contains=@phpClInside contained | |
" define a cluster to get all interpolation syntaxes for double-quoted strings | |
1 0.000009 syn cluster phpInterpDouble contains=phpInterpSimple,phpInterpSimpleCurly,phpInterpDollarCurly1,phpInterpDollarCurly2,phpInterpBogusDollarCurley,phpInterpComplex | |
" Methoden | |
1 0.000010 syn match phpMethodsVar "->\h\w*" contained contains=phpMethods,phpMemberSelector display | |
" Include | |
1 0.000009 syn keyword phpInclude include require include_once require_once use contained | |
" Peter Hodge - added 'clone' keyword | |
" Define | |
1 0.000007 syn keyword phpDefine new clone contained | |
" Boolean | |
1 0.000005 syn keyword phpBoolean true false contained | |
" Number | |
1 0.000007 syn match phpNumber "-\=\<\d\+\>" contained display | |
1 0.000004 syn match phpNumber "\<0x\x\{1,8}\>" contained display | |
" Float | |
1 0.000006 syn match phpFloat "\(-\=\<\d+\|-\=\)\.\d\+\>" contained display | |
" Backslash escapes | |
1 0.000001 syn case match | |
" for double quotes and heredoc | |
1 0.000017 syn match phpBackslashSequences "\\[fnrtv\\\"$]" contained display | |
1 0.000009 syn match phpBackslashSequences "\\\d\{1,3}" contained contains=phpOctalError display | |
1 0.000003 syn match phpBackslashSequences "\\x\x\{1,2}" contained display | |
" additional sequence for double quotes only | |
1 0.000006 syn match phpBackslashDoubleQuote "\\[\"]" contained display | |
" for single quotes only | |
1 0.000006 syn match phpBackslashSingleQuote "\\[\\']" contained display | |
1 0.000002 syn case ignore | |
" Error | |
1 0.000003 syn match phpOctalError "[89]" contained display | |
1 0.000004 if exists("php_parent_error_close") | |
syn match phpParentError "[)\]}]" contained display | |
endif | |
" Todo | |
1 0.000005 syn keyword phpTodo todo fixme xxx contained | |
" Comment | |
1 0.000002 if exists("php_parent_error_open") | |
syn region phpComment start="/\*" end="\*/" contained contains=phpTodo,@Spell | |
else | |
1 0.000007 syn region phpComment start="/\*" end="\*/" contained contains=phpTodo,@Spell extend | |
1 0.000001 endif | |
1 0.000006 syn match phpComment "#.\{-}\(?>\|$\)\@=" contained contains=phpTodo,@Spell | |
1 0.000004 syn match phpComment "//.\{-}\(?>\|$\)\@=" contained contains=phpTodo,@Spell | |
" String | |
1 0.000002 if exists("php_parent_error_open") | |
syn region phpStringDouble matchgroup=phpStringDouble start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@phpAddStrings,phpBackslashSequences,phpBackslashDoubleQuote,@phpInterpDouble,@Spell contained keepend | |
syn region phpBacktick matchgroup=phpBacktick start=+`+ skip=+\\\\\|\\"+ end=+`+ contains=@phpAddStrings,phpIdentifier,phpBackslashSequences,phpIdentifierSimply,phpIdentifierComplex contained keepend | |
syn region phpStringSingle matchgroup=phpStringSingle start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@phpAddStrings,phpBackslashSingleQuote,@Spell contained keepend | |
else | |
1 0.000016 syn region phpStringDouble matchgroup=phpStringDouble start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@phpAddStrings,phpBackslashSequences,phpBackslashDoubleQuote,@phpInterpDouble,@Spell contained extend keepend | |
1 0.000017 syn region phpBacktick matchgroup=phpBacktick start=+`+ skip=+\\\\\|\\"+ end=+`+ contains=@phpAddStrings,phpIdentifier,phpBackslashSequences,phpIdentifierSimply,phpIdentifierComplex contained extend keepend | |
1 0.000017 syn region phpStringSingle matchgroup=phpStringSingle start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@phpAddStrings,phpBackslashSingleQuote,@Spell contained keepend extend | |
1 0.000001 endif | |
" HereDoc and NowDoc | |
1 0.000002 syn case match | |
" HereDoc | |
1 0.000025 syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\(\"\=\)\z(\I\i*\)\2$" end="^\z1\(;\=$\)\@=" contained contains=phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar,@Spell keepend extend | |
" including HTML,JavaScript,SQL even if not enabled via options | |
1 0.000027 syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\(\"\=\)\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)\2$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar,@Spell keepend extend | |
1 0.000022 syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\(\"\=\)\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)\2$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar,@Spell keepend extend | |
1 0.000024 syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\(\"\=\)\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)\2$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar,@Spell keepend extend | |
" NowDoc | |
1 0.000014 syn region phpNowDoc matchgroup=Delimiter start="\(<<<\)\@<='\z(\I\i*\)'$" end="^\z1\(;\=$\)\@=" contained contains=@Spell keepend extend | |
" including HTML,JavaScript,SQL even if not enabled via options | |
1 0.000012 syn region phpNowDoc matchgroup=Delimiter start="\(<<<\)\@<='\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)'$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,@Spell keepend extend | |
1 0.000048 syn region phpNowDoc matchgroup=Delimiter start="\(<<<\)\@<='\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)'$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,@Spell keepend extend | |
1 0.000013 syn region phpNowDoc matchgroup=Delimiter start="\(<<<\)\@<='\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)'$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,@Spell keepend extend | |
1 0.000002 syn case ignore | |
" Parent | |
1 0.000006 if exists("php_parent_error_close") || exists("php_parent_error_open") | |
syn match phpParent "[{}]" contained | |
syn region phpParent matchgroup=Delimiter start="(" end=")" contained contains=@phpClInside transparent | |
syn region phpParent matchgroup=Delimiter start="\[" end="\]" contained contains=@phpClInside transparent | |
if !exists("php_parent_error_close") | |
syn match phpParent "[\])]" contained | |
endif | |
else | |
1 0.000004 syn match phpParent "[({[\]})]" contained | |
1 0.000001 endif | |
1 0.000025 syn cluster phpClConst contains=phpFunctions,phpIdentifier,phpConditional,phpRepeat,phpStatement,phpOperator,phpRelation,phpStringSingle,phpStringDouble,phpBacktick,phpNumber,phpFloat,phpKeyword,phpType,phpBoolean,phpStructure,phpMethodsVar,phpConstant,phpCoreConstant,phpException | |
1 0.000011 syn cluster phpClInside contains=@phpClConst,phpComment,phpLabel,phpParent,phpParentError,phpInclude,phpHereDoc,phpNowDoc | |
1 0.000008 syn cluster phpClFunction contains=@phpClInside,phpDefine,phpParentError,phpStorageClass | |
1 0.000018 syn cluster phpClTop contains=@phpClFunction,phpFoldFunction,phpFoldClass,phpFoldInterface,phpFoldTry,phpFoldCatch | |
" Php Region | |
1 0.000033 if exists("php_parent_error_open") | |
if exists("php_noShortTags") | |
syn region phpRegion matchgroup=Delimiter start="<?php" end="?>" contains=@phpClTop | |
else | |
syn region phpRegion matchgroup=Delimiter start="<?\(php\)\=" end="?>" contains=@phpClTop | |
endif | |
syn region phpRegionSc matchgroup=Delimiter start=+<script language="php">+ end=+</script>+ contains=@phpClTop | |
if exists("php_asp_tags") | |
syn region phpRegionAsp matchgroup=Delimiter start="<%\(=\)\=" end="%>" contains=@phpClTop | |
endif | |
else | |
1 0.000002 if exists("php_noShortTags") | |
syn region phpRegion matchgroup=Delimiter start="<?php" end="?>" contains=@phpClTop keepend | |
else | |
1 0.000007 syn region phpRegion matchgroup=Delimiter start="<?\(php\)\=" end="?>" contains=@phpClTop keepend | |
1 0.000001 endif | |
1 0.000008 syn region phpRegionSc matchgroup=Delimiter start=+<script language="php">+ end=+</script>+ contains=@phpClTop keepend | |
1 0.000002 if exists("php_asp_tags") | |
syn region phpRegionAsp matchgroup=Delimiter start="<%\(=\)\=" end="%>" contains=@phpClTop keepend | |
endif | |
1 0.000001 endif | |
" Fold | |
1 0.000002 if exists("php_folding") && php_folding==1 | |
" match one line constructs here and skip them at folding | |
syn keyword phpSCKeyword abstract final private protected public static contained | |
syn keyword phpFCKeyword function contained | |
syn keyword phpStorageClass global contained | |
syn match phpDefine "\(\s\|^\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\(\s\+.*[;}]\)\@=" contained contains=phpSCKeyword | |
syn match phpStructure "\(\s\|^\)\(abstract\s\+\|final\s\+\)*class\(\s\+.*}\)\@=" contained | |
syn match phpStructure "\(\s\|^\)interface\(\s\+.*}\)\@=" contained | |
syn match phpException "\(\s\|^\)try\(\s\+.*}\)\@=" contained | |
syn match phpException "\(\s\|^\)catch\(\s\+.*}\)\@=" contained | |
set foldmethod=syntax | |
syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop | |
syn region phpFoldFunction matchgroup=Storageclass start="^\z(\s*\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\s\([^};]*$\)\@="rs=e-9 matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldHtmlInside,phpFCKeyword contained transparent fold extend | |
syn region phpFoldFunction matchgroup=Define start="^function\s\([^};]*$\)\@=" matchgroup=Delimiter end="^}" contains=@phpClFunction,phpFoldHtmlInside contained transparent fold extend | |
syn region phpFoldClass matchgroup=Structure start="^\z(\s*\)\(abstract\s\+\|final\s\+\)*class\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction,phpSCKeyword contained transparent fold extend | |
syn region phpFoldInterface matchgroup=Structure start="^\z(\s*\)interface\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend | |
syn region phpFoldCatch matchgroup=Exception start="^\z(\s*\)catch\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend | |
syn region phpFoldTry matchgroup=Exception start="^\z(\s*\)try\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend | |
elseif exists("php_folding") && php_folding==2 | |
syn keyword phpDefine function contained | |
syn keyword phpStructure abstract class interface contained | |
syn keyword phpException catch throw try contained | |
syn keyword phpStorageClass final global private protected public static contained | |
set foldmethod=syntax | |
syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop | |
syn region phpParent matchgroup=Delimiter start="{" end="}" contained contains=@phpClFunction,phpFoldHtmlInside transparent fold | |
else | |
1 0.000004 syn keyword phpDefine function contained | |
1 0.000005 syn keyword phpStructure abstract class interface contained | |
1 0.000005 syn keyword phpException catch throw try contained | |
1 0.000006 syn keyword phpStorageClass final global private protected public static contained | |
1 0.000001 endif | |
" TODO: fold on "trait". For now just make sure it gets colored: | |
1 0.000004 syn keyword phpStructure trait | |
" ================================================================ | |
" Peter Hodge - June 9, 2006 | |
" Some of these changes (highlighting isset/unset/echo etc) are not so | |
" critical, but they make things more colourful. :-) | |
" different syntax highlighting for 'echo', 'print', 'switch', 'die' and 'list' keywords | |
" to better indicate what they are. | |
1 0.000004 syntax keyword phpDefine echo print contained | |
1 0.000003 syntax keyword phpStructure list contained | |
1 0.000003 syntax keyword phpConditional switch contained | |
1 0.000003 syntax keyword phpStatement die contained | |
" Highlighting for PHP5's user-definable magic class methods | |
1 0.000016 syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier | |
\ __construct __destruct __call __callStatic __get __set __isset __unset __sleep __wakeup __toString __invoke __set_state __clone __debugInfo | |
" Highlighting for __autoload slightly different from line above | |
1 0.000007 syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar | |
\ __autoload | |
1 0.000003 hi def link phpSpecialFunction phpOperator | |
" Highlighting for PHP5's built-in classes | |
" - built-in classes harvested from get_declared_classes() in 5.1.4 | |
1 0.000079 syntax keyword phpClasses containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar | |
\ stdClass __PHP_Incomplete_Class php_user_filter Directory ArrayObject | |
\ Exception ErrorException LogicException BadFunctionCallException BadMethodCallException DomainException | |
\ RecursiveIteratorIterator IteratorIterator FilterIterator RecursiveFilterIterator ParentIterator LimitIterator | |
\ CachingIterator RecursiveCachingIterator NoRewindIterator AppendIterator InfiniteIterator EmptyIterator | |
\ ArrayIterator RecursiveArrayIterator DirectoryIterator RecursiveDirectoryIterator | |
\ InvalidArgumentException LengthException OutOfRangeException RuntimeException OutOfBoundsException | |
\ OverflowException RangeException UnderflowException UnexpectedValueException | |
\ PDO PDOException PDOStatement PDORow | |
\ Reflection ReflectionFunction ReflectionParameter ReflectionMethod ReflectionClass | |
\ ReflectionObject ReflectionProperty ReflectionExtension ReflectionException | |
\ SplFileInfo SplFileObject SplTempFileObject SplObjectStorage | |
\ XMLWriter LibXMLError XMLReader SimpleXMLElement SimpleXMLIterator | |
\ DOMException DOMStringList DOMNameList DOMDomError DOMErrorHandler | |
\ DOMImplementation DOMImplementationList DOMImplementationSource | |
\ DOMNode DOMNameSpaceNode DOMDocumentFragment DOMDocument DOMNodeList DOMNamedNodeMap | |
\ DOMCharacterData DOMAttr DOMElement DOMText DOMComment DOMTypeinfo DOMUserDataHandler | |
\ DOMLocator DOMConfiguration DOMCdataSection DOMDocumentType DOMNotation DOMEntity | |
\ DOMEntityReference DOMProcessingInstruction DOMStringExtend DOMXPath | |
1 0.000002 hi def link phpClasses phpFunctions | |
" Highlighting for PHP5's built-in interfaces | |
" - built-in classes harvested from get_declared_interfaces() in 5.1.4 | |
1 0.000016 syntax keyword phpInterfaces containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar | |
\ Iterator IteratorAggregate RecursiveIterator OuterIterator SeekableIterator | |
\ Traversable ArrayAccess Serializable Countable SplObserver SplSubject Reflector | |
1 0.000002 hi def link phpInterfaces phpConstant | |
" option defaults: | |
1 0.000004 if ! exists('php_special_functions') | |
1 0.000004 let php_special_functions = 1 | |
1 0.000001 endif | |
1 0.000003 if ! exists('php_alt_comparisons') | |
1 0.000003 let php_alt_comparisons = 1 | |
1 0.000002 endif | |
1 0.000003 if ! exists('php_alt_assignByReference') | |
1 0.000003 let php_alt_assignByReference = 1 | |
1 0.000001 endif | |
1 0.000002 if php_special_functions | |
" Highlighting for PHP built-in functions which exhibit special behaviours | |
" - isset()/unset()/empty() are not real functions. | |
" - compact()/extract() directly manipulate variables in the local scope where | |
" regular functions would not be able to. | |
" - eval() is the token 'make_your_code_twice_as_complex()' function for PHP. | |
" - user_error()/trigger_error() can be overloaded by set_error_handler and also | |
" have the capacity to terminate your script when type is E_USER_ERROR. | |
1 0.000017 syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle | |
\ user_error trigger_error isset unset eval extract compact empty | |
1 0.000001 endif | |
1 0.000002 if php_alt_assignByReference | |
" special highlighting for '=&' operator | |
1 0.000026 syntax match phpAssignByRef /=\s*&/ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle | |
1 0.000006 hi def link phpAssignByRef Type | |
1 0.000001 endif | |
1 0.000002 if php_alt_comparisons | |
" highlight comparison operators differently | |
1 0.000013 syntax match phpComparison "\v[=!]\=\=?" contained containedin=phpRegion | |
1 0.000009 syntax match phpComparison "\v[=<>-]@<![<>]\=?[<>]@!" contained containedin=phpRegion | |
" highlight the 'instanceof' operator as a comparison operator rather than a structure | |
1 0.000002 syntax case ignore | |
1 0.000006 syntax keyword phpComparison instanceof contained containedin=phpRegion | |
1 0.000005 hi def link phpComparison Statement | |
1 0.000001 endif | |
" ================================================================ | |
" Sync | |
1 0.000004 if php_sync_method==-1 | |
if exists("php_noShortTags") | |
syn sync match phpRegionSync grouphere phpRegion "^\s*<?php\s*$" | |
else | |
syn sync match phpRegionSync grouphere phpRegion "^\s*<?\(php\)\=\s*$" | |
endif | |
syn sync match phpRegionSync grouphere phpRegionSc +^\s*<script language="php">\s*$+ | |
if exists("php_asp_tags") | |
syn sync match phpRegionSync grouphere phpRegionAsp "^\s*<%\(=\)\=\s*$" | |
endif | |
syn sync match phpRegionSync grouphere NONE "^\s*?>\s*$" | |
syn sync match phpRegionSync grouphere NONE "^\s*%>\s*$" | |
syn sync match phpRegionSync grouphere phpRegion "function\s.*(.*\$" | |
"syn sync match phpRegionSync grouphere NONE "/\i*>\s*$" | |
elseif php_sync_method>0 | |
exec "syn sync minlines=" . php_sync_method | |
else | |
1 0.000004 exec "syn sync fromstart" | |
1 0.000001 endif | |
1 0.000013 syntax match phpDocCustomTags "@[a-zA-Z]*\(\s\+\|\n\|\r\)" containedin=phpComment | |
1 0.000015 syntax region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpComment | |
1 0.000028 syntax match phpDocTags "@\(abstract\|access\|author\|category\|copyright\|deprecated\|example\|final\|global\|ignore\|internal\|license\|link\|method\|name\|package\|param\|property\|return\|see\|since\|static\|staticvar\|subpackage\|tutorial\|uses\|var\|version\|contributor\|modified\|filename\|description\|filesource\|throws\)\(\s\+\)\?" containedin=phpComment | |
1 0.000008 syntax match phpDocTodo "@\(todo\|fixme\|xxx\)\(\s\+\)\?" containedin=phpComment | |
" Define the default highlighting. | |
" Only when an item doesn't have highlighting yet | |
1 0.000032 hi def link phpConstant Constant | |
1 0.000006 hi def link phpCoreConstant Constant | |
1 0.000005 hi def link phpComment Comment | |
1 0.000003 hi def link phpDocTags PreProc | |
1 0.000003 hi def link phpDocCustomTags Type | |
1 0.000004 hi def link phpException Exception | |
1 0.000003 hi def link phpBoolean Boolean | |
1 0.000004 hi def link phpStorageClass StorageClass | |
1 0.000003 hi def link phpSCKeyword StorageClass | |
1 0.000004 hi def link phpFCKeyword Define | |
1 0.000004 hi def link phpStructure Structure | |
1 0.000004 hi def link phpStringSingle String | |
1 0.000003 hi def link phpStringDouble String | |
1 0.000003 hi def link phpBacktick String | |
1 0.000003 hi def link phpNumber Number | |
1 0.000003 hi def link phpFloat Float | |
1 0.000004 hi def link phpMethods Function | |
1 0.000004 hi def link phpFunctions Function | |
1 0.000006 hi def link phpBaselib Function | |
1 0.000004 hi def link phpRepeat Repeat | |
1 0.000004 hi def link phpConditional Conditional | |
1 0.000004 hi def link phpLabel Label | |
1 0.000004 hi def link phpStatement Statement | |
1 0.000004 hi def link phpKeyword Statement | |
1 0.000004 hi def link phpType Type | |
1 0.000004 hi def link phpInclude Include | |
1 0.000004 hi def link phpDefine Define | |
1 0.000004 hi def link phpBackslashSequences SpecialChar | |
1 0.000004 hi def link phpBackslashDoubleQuote SpecialChar | |
1 0.000003 hi def link phpBackslashSingleQuote SpecialChar | |
1 0.000004 hi def link phpParent Delimiter | |
1 0.000004 hi def link phpBrackets Delimiter | |
1 0.000006 hi def link phpIdentifierConst Delimiter | |
1 0.000003 hi def link phpParentError Error | |
1 0.000004 hi def link phpOctalError Error | |
1 0.000004 hi def link phpInterpSimpleError Error | |
1 0.000004 hi def link phpInterpBogusDollarCurley Error | |
1 0.000003 hi def link phpInterpDollarCurly1 Error | |
1 0.000003 hi def link phpInterpDollarCurly2 Error | |
1 0.000003 hi def link phpInterpSimpleBracketsInner String | |
1 0.000003 hi def link phpInterpSimpleCurly Delimiter | |
1 0.000003 hi def link phpInterpVarname Identifier | |
1 0.000003 hi def link phpTodo Todo | |
1 0.000003 hi def link phpDocTodo Todo | |
1 0.000003 hi def link phpMemberSelector Structure | |
1 0.000003 if exists("php_oldStyle") | |
hi def phpIntVar guifg=Red ctermfg=DarkRed | |
hi def phpEnvVar guifg=Red ctermfg=DarkRed | |
hi def phpOperator guifg=SeaGreen ctermfg=DarkGreen | |
hi def phpVarSelector guifg=SeaGreen ctermfg=DarkGreen | |
hi def phpRelation guifg=SeaGreen ctermfg=DarkGreen | |
hi def phpIdentifier guifg=DarkGray ctermfg=Brown | |
hi def phpIdentifierSimply guifg=DarkGray ctermfg=Brown | |
else | |
1 0.000003 hi def link phpIntVar Identifier | |
1 0.000003 hi def link phpEnvVar Identifier | |
1 0.000003 hi def link phpOperator Operator | |
1 0.000003 hi def link phpVarSelector Operator | |
1 0.000003 hi def link phpRelation Operator | |
1 0.000003 hi def link phpIdentifier Identifier | |
1 0.000003 hi def link phpIdentifierSimply Identifier | |
1 0.000001 endif | |
1 0.000004 let b:current_syntax = "php" | |
1 0.000004 if main_syntax == 'php' | |
1 0.000003 unlet main_syntax | |
1 0.000001 endif | |
" put cpoptions back the way we found it | |
1 0.000010 let &cpo = s:cpo_save | |
1 0.000001 unlet s:cpo_save | |
" vim: ts=8 sts=2 sw=2 expandtab | |
SCRIPT /usr/share/nvim/runtime/syntax/html.vim | |
Sourced 1 time | |
Total time: 0.043926 | |
Self time: 0.015337 | |
count total (s) self (s) | |
" Vim syntax file | |
" Language: HTML | |
" Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net> | |
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com> | |
" Repository: https://notabug.org/jorgesumle/vim-html-syntax | |
" Last Change: 2017 Jan 21 | |
" included patch from Jorge Maldonado Ventura | |
" Please check :help html.vim for some comments and a description of the options | |
" quit when a syntax file was already loaded | |
1 0.000125 if !exists("main_syntax") | |
if exists("b:current_syntax") | |
finish | |
endif | |
let main_syntax = 'html' | |
endif | |
1 0.000021 let s:cpo_save = &cpo | |
1 0.000081 set cpo&vim | |
1 0.000004 syntax spell toplevel | |
1 0.000002 syn case ignore | |
" mark illegal characters | |
1 0.000071 syn match htmlError "[<>&]" | |
" tags | |
1 0.000084 syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc | |
1 0.000065 syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc | |
1 0.000013 syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@htmlPreproc | |
1 0.000045 syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError | |
1 0.000020 syn region htmlTag start=+<[^/]+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster | |
1 0.000012 syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster | |
1 0.000007 syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster | |
1 0.000003 syn match htmlTagError contained "[^>]<"ms=s+1 | |
" tag names | |
1 0.000005 syn keyword htmlTagName contained address applet area a base basefont | |
1 0.000004 syn keyword htmlTagName contained big blockquote br caption center | |
1 0.000005 syn keyword htmlTagName contained cite code dd dfn dir div dl dt font | |
1 0.000003 syn keyword htmlTagName contained form hr html img | |
1 0.000004 syn keyword htmlTagName contained input isindex kbd li link map menu | |
1 0.000004 syn keyword htmlTagName contained meta ol option param pre p samp span | |
1 0.000015 syn keyword htmlTagName contained select small strike sub sup | |
1 0.000097 syn keyword htmlTagName contained table td textarea th tr tt ul var xmp | |
1 0.000137 syn match htmlTagName contained "\<\(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title\)\>" | |
" new html 4.0 tags | |
1 0.000031 syn keyword htmlTagName contained abbr acronym bdo button col label | |
1 0.000026 syn keyword htmlTagName contained colgroup del fieldset iframe ins legend | |
1 0.000006 syn keyword htmlTagName contained object optgroup q s tbody tfoot thead | |
" new html 5 tags | |
1 0.000004 syn keyword htmlTagName contained article aside audio bdi canvas data | |
1 0.000004 syn keyword htmlTagName contained datalist details embed figcaption figure | |
1 0.000004 syn keyword htmlTagName contained footer header hgroup keygen main mark | |
1 0.000004 syn keyword htmlTagName contained menuitem meter nav output picture | |
1 0.000004 syn keyword htmlTagName contained progress rb rp rt rtc ruby section | |
1 0.000008 syn keyword htmlTagName contained slot source template time track video wbr | |
" legal arg names | |
1 0.000003 syn keyword htmlArg contained action | |
1 0.000004 syn keyword htmlArg contained align alink alt archive background bgcolor | |
1 0.000003 syn keyword htmlArg contained border bordercolor cellpadding | |
1 0.000006 syn keyword htmlArg contained cellspacing checked class clear code codebase color | |
1 0.000111 syn keyword htmlArg contained cols colspan content coords enctype face | |
1 0.000005 syn keyword htmlArg contained gutter height hspace id | |
1 0.000003 syn keyword htmlArg contained link lowsrc marginheight | |
1 0.000076 syn keyword htmlArg contained marginwidth maxlength method name prompt | |
1 0.000005 syn keyword htmlArg contained rel rev rows rowspan scrolling selected shape | |
1 0.000138 syn keyword htmlArg contained size src start target text type url | |
1 0.000007 syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap | |
1 0.000012 syn match htmlArg contained "\<\(http-equiv\|href\|title\)="me=e-1 | |
" Netscape extensions | |
1 0.000008 syn keyword htmlTagName contained frame noframes frameset nobr blink | |
1 0.000012 syn keyword htmlTagName contained layer ilayer nolayer spacer | |
1 0.000023 syn keyword htmlArg contained frameborder noresize pagex pagey above below | |
1 0.000028 syn keyword htmlArg contained left top visibility clip id noshade | |
1 0.000005 syn match htmlArg contained "\<z-index\>" | |
" Microsoft extensions | |
1 0.000005 syn keyword htmlTagName contained marquee | |
" html 4.0 arg names | |
1 0.000008 syn match htmlArg contained "\<\(accept-charset\|label\)\>" | |
1 0.000023 syn keyword htmlArg contained abbr accept accesskey axis char charoff charset | |
1 0.000017 syn keyword htmlArg contained cite classid codetype compact data datetime | |
1 0.000218 syn keyword htmlArg contained declare defer dir disabled for frame | |
1 0.000025 syn keyword htmlArg contained headers hreflang lang language longdesc | |
1 0.000077 syn keyword htmlArg contained multiple nohref nowrap object profile readonly | |
1 0.000011 syn keyword htmlArg contained rules scheme scope span standby style | |
1 0.000004 syn keyword htmlArg contained summary tabindex valuetype version | |
" html 5 arg names | |
1 0.000004 syn keyword htmlArg contained allowfullscreen async autocomplete autofocus | |
1 0.000005 syn keyword htmlArg contained autoplay challenge contenteditable contextmenu | |
1 0.000005 syn keyword htmlArg contained controls crossorigin default dirname download | |
1 0.000005 syn keyword htmlArg contained draggable dropzone form formaction formenctype | |
1 0.000007 syn keyword htmlArg contained formmethod formnovalidate formtarget hidden | |
1 0.000005 syn keyword htmlArg contained high icon inputmode keytype kind list loop low | |
1 0.000005 syn keyword htmlArg contained max min minlength muted nonce novalidate open | |
1 0.000004 syn keyword htmlArg contained optimum pattern placeholder poster preload | |
1 0.000004 syn keyword htmlArg contained radiogroup required reversed sandbox spellcheck | |
1 0.000005 syn keyword htmlArg contained sizes srcset srcdoc srclang step title translate | |
1 0.000003 syn keyword htmlArg contained typemustmatch | |
" special characters | |
1 0.000021 syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};" | |
" Comments (the real ones or the old netscape ones) | |
1 0.000011 if exists("html_wrong_comments") | |
syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell | |
else | |
1 0.000015 syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError,@Spell | |
1 0.000005 syn match htmlCommentError contained "[^><!]" | |
1 0.000416 syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc,@Spell | |
1 0.000011 endif | |
1 0.000016 syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+ | |
" server-parsed commands | |
1 0.000021 syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr | |
1 0.000441 syn match htmlPreStmt contained "<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>" | |
1 0.000020 syn match htmlPreError contained "<!--#\S*"ms=s+4 | |
1 0.000023 syn match htmlPreAttr contained "\w\+=[^"]\S\+" contains=htmlPreProcAttrError,htmlPreProcAttrName | |
1 0.000012 syn region htmlPreAttr contained start=+\w\+="+ skip=+\\\\\|\\"+ end=+"+ contains=htmlPreProcAttrName keepend | |
1 0.000004 syn match htmlPreProcAttrError contained "\w\+="he=e-1 | |
1 0.000010 syn match htmlPreProcAttrName contained "\(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)="he=e-1 | |
1 0.000011 if !exists("html_no_rendering") | |
" rendering | |
1 0.000142 syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc | |
1 0.000030 syn region htmlBold start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic | |
1 0.000009 syn region htmlBold start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic | |
1 0.000008 syn region htmlBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic | |
1 0.000007 syn region htmlBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlBoldItalicUnderline | |
1 0.000037 syn region htmlBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlBoldItalicUnderline | |
1 0.000006 syn region htmlBoldUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop | |
1 0.000005 syn region htmlBoldUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop | |
1 0.000008 syn region htmlBoldItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic | |
1 0.000140 syn region htmlUnderline start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic | |
1 0.000018 syn region htmlUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlUnderlineBoldItalic | |
1 0.000008 syn region htmlUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlUnderlineBoldItalic | |
1 0.000010 syn region htmlUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlUnderlineItalicBold | |
1 0.000099 syn region htmlUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlUnderlineItalicBold | |
1 0.000010 syn region htmlUnderlineItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop | |
1 0.000012 syn region htmlUnderlineItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop | |
1 0.000008 syn region htmlUnderlineBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop | |
1 0.000009 syn region htmlUnderlineBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop | |
1 0.000018 syn region htmlItalic start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline | |
1 0.000008 syn region htmlItalic start="<em\>" end="</em>"me=e-5 contains=@htmlTop | |
1 0.000012 syn region htmlItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlItalicBoldUnderline | |
1 0.000109 syn region htmlItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlItalicBoldUnderline | |
1 0.000009 syn region htmlItalicBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop | |
1 0.000008 syn region htmlItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlItalicUnderlineBold | |
1 0.000005 syn region htmlItalicUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop | |
1 0.000007 syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop | |
1 0.000005 syn match htmlLeadingSpace "^\s\+" contained | |
1 0.000014 syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLeadingSpace,javaScript,@htmlPreproc | |
1 0.000007 syn region htmlH1 start="<h1\>" end="</h1>"me=e-5 contains=@htmlTop | |
1 0.000006 syn region htmlH2 start="<h2\>" end="</h2>"me=e-5 contains=@htmlTop | |
1 0.000006 syn region htmlH3 start="<h3\>" end="</h3>"me=e-5 contains=@htmlTop | |
1 0.000005 syn region htmlH4 start="<h4\>" end="</h4>"me=e-5 contains=@htmlTop | |
1 0.000009 syn region htmlH5 start="<h5\>" end="</h5>"me=e-5 contains=@htmlTop | |
1 0.000081 syn region htmlH6 start="<h6\>" end="</h6>"me=e-5 contains=@htmlTop | |
1 0.000053 syn region htmlHead start="<head\>" end="</head>"me=e-7 end="<body\>"me=e-5 end="<h[1-6]\>"me=e-3 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc | |
1 0.000012 syn region htmlTitle start="<title\>" end="</title>"me=e-8 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc | |
1 0.000002 endif | |
1 0.000005 syn keyword htmlTagName contained noscript | |
1 0.000004 syn keyword htmlSpecialTagName contained script style | |
1 0.000008 if main_syntax != 'java' || exists("java_javascript") | |
" JAVA SCRIPT | |
1 0.003480 syn include @htmlJavaScript syntax/javascript.vim | |
1 0.000004 unlet b:current_syntax | |
1 0.000024 syn region javaScript start=+<script\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc | |
1 0.000032 syn region htmlScriptTag contained start=+<script+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent | |
1 0.000004 hi def link htmlScriptTag htmlTag | |
" html events (i.e. arguments that include javascript commands) | |
1 0.000006 if exists("html_extended_events") | |
syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ contains=htmlEventSQ | |
syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ contains=htmlEventDQ | |
else | |
1 0.000010 syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ keepend contains=htmlEventSQ | |
1 0.000225 syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ keepend contains=htmlEventDQ | |
1 0.000004 endif | |
1 0.000011 syn region htmlEventSQ contained start=+'+ms=s+1 end=+'+me=s-1 contains=@htmlJavaScript | |
1 0.000007 syn region htmlEventDQ contained start=+"+ms=s+1 end=+"+me=s-1 contains=@htmlJavaScript | |
1 0.000004 hi def link htmlEventSQ htmlEvent | |
1 0.000003 hi def link htmlEventDQ htmlEvent | |
" a javascript expression is used as an arg value | |
1 0.000011 syn region javaScriptExpression contained start=+&{+ keepend end=+};+ contains=@htmlJavaScript,@htmlPreproc | |
1 0.000002 endif | |
1 0.000007 if main_syntax != 'java' || exists("java_vb") | |
" VB SCRIPT | |
1 0.002772 syn include @htmlVbScript syntax/vb.vim | |
1 0.000005 unlet b:current_syntax | |
1 0.000349 syn region javaScript start=+<script \_[^>]*language *=\_[^>]*vbscript\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc | |
1 0.000003 endif | |
1 0.000006 syn cluster htmlJavaScript add=@htmlPreproc | |
1 0.000147 if main_syntax != 'java' || exists("java_css") | |
" embedded style sheets | |
1 0.000130 syn keyword htmlArg contained media | |
1 0.002371 syn include @htmlCss syntax/css.vim | |
1 0.000045 unlet b:current_syntax | |
1 0.000023 syn region cssStyle start=+<style+ keepend end=+</style>+ contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc | |
1 0.000007 syn match htmlCssStyleComment contained "\(<!--\|-->\)" | |
1 0.000938 syn region htmlCssDefinition matchgroup=htmlArg start='style="' keepend matchgroup=htmlString end='"' contains=css.*Attr,css.*Prop,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString,@htmlPreproc | |
1 0.000008 hi def link htmlStyleArg htmlString | |
1 0.000001 endif | |
1 0.000003 if main_syntax == "html" | |
" synchronizing (does not always work if a comment includes legal | |
" html tags, but doing it right would mean to always start | |
" at the first line, which is too slow) | |
syn sync match htmlHighlight groupthere NONE "<[/a-zA-Z]" | |
syn sync match htmlHighlight groupthere javaScript "<script" | |
syn sync match htmlHighlightSkip "^.*['\"].*$" | |
syn sync minlines=10 | |
endif | |
" The default highlighting. | |
1 0.000005 hi def link htmlTag Function | |
1 0.000004 hi def link htmlEndTag Identifier | |
1 0.000004 hi def link htmlArg Type | |
1 0.000004 hi def link htmlTagName htmlStatement | |
1 0.000006 hi def link htmlSpecialTagName Exception | |
1 0.000004 hi def link htmlValue String | |
1 0.000004 hi def link htmlSpecialChar Special | |
1 0.000004 if !exists("html_no_rendering") | |
1 0.000004 hi def link htmlH1 Title | |
1 0.000003 hi def link htmlH2 htmlH1 | |
1 0.000003 hi def link htmlH3 htmlH2 | |
1 0.000003 hi def link htmlH4 htmlH3 | |
1 0.000004 hi def link htmlH5 htmlH4 | |
1 0.000004 hi def link htmlH6 htmlH5 | |
1 0.000004 hi def link htmlHead PreProc | |
1 0.000004 hi def link htmlTitle Title | |
1 0.000003 hi def link htmlBoldItalicUnderline htmlBoldUnderlineItalic | |
1 0.000003 hi def link htmlUnderlineBold htmlBoldUnderline | |
1 0.000003 hi def link htmlUnderlineItalicBold htmlBoldUnderlineItalic | |
1 0.000003 hi def link htmlUnderlineBoldItalic htmlBoldUnderlineItalic | |
1 0.000004 hi def link htmlItalicUnderline htmlUnderlineItalic | |
1 0.000004 hi def link htmlItalicBold htmlBoldItalic | |
1 0.000004 hi def link htmlItalicBoldUnderline htmlBoldUnderlineItalic | |
1 0.000003 hi def link htmlItalicUnderlineBold htmlBoldUnderlineItalic | |
1 0.000003 hi def link htmlLink Underlined | |
1 0.000004 hi def link htmlLeadingSpace None | |
1 0.000003 if !exists("html_my_rendering") | |
1 0.000006 hi def htmlBold term=bold cterm=bold gui=bold | |
1 0.000005 hi def htmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline | |
1 0.000004 hi def htmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic | |
1 0.000005 hi def htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline | |
1 0.000005 hi def htmlUnderline term=underline cterm=underline gui=underline | |
1 0.000006 hi def htmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline | |
1 0.000005 hi def htmlItalic term=italic cterm=italic gui=italic | |
1 0.000001 endif | |
1 0.000001 endif | |
1 0.000005 hi def link htmlPreStmt PreProc | |
1 0.000005 hi def link htmlPreError Error | |
1 0.000005 hi def link htmlPreProc PreProc | |
1 0.000005 hi def link htmlPreAttr String | |
1 0.000005 hi def link htmlPreProcAttrName PreProc | |
1 0.000005 hi def link htmlPreProcAttrError Error | |
1 0.000006 hi def link htmlSpecial Special | |
1 0.000005 hi def link htmlSpecialChar Special | |
1 0.000005 hi def link htmlString String | |
1 0.000004 hi def link htmlStatement Statement | |
1 0.000005 hi def link htmlComment Comment | |
1 0.000005 hi def link htmlCommentPart Comment | |
1 0.000005 hi def link htmlValue String | |
1 0.000008 hi def link htmlCommentError htmlError | |
1 0.000005 hi def link htmlTagError htmlError | |
1 0.000005 hi def link htmlEvent javaScript | |
1 0.000005 hi def link htmlError Error | |
1 0.000005 hi def link javaScript Special | |
1 0.000005 hi def link javaScriptExpression javaScript | |
1 0.000005 hi def link htmlCssStyleComment Comment | |
1 0.000005 hi def link htmlCssDefinition Special | |
1 0.000025 let b:current_syntax = "html" | |
1 0.000003 if main_syntax == 'html' | |
unlet main_syntax | |
endif | |
1 0.000011 let &cpo = s:cpo_save | |
1 0.000002 unlet s:cpo_save | |
" vim: ts=8 | |
SCRIPT /usr/share/nvim/runtime/syntax/javascript.vim | |
Sourced 1 time | |
Total time: 0.001189 | |
Self time: 0.001189 | |
count total (s) self (s) | |
" Vim syntax file | |
" Language: JavaScript | |
" Maintainer: Claudio Fleiner <claudio@fleiner.com> | |
" Updaters: Scott Shattuck (ss) <ss@technicalpursuit.com> | |
" URL: http://www.fleiner.com/vim/syntax/javascript.vim | |
" Changes: (ss) added keywords, reserved words, and other identifiers | |
" (ss) repaired several quoting and grouping glitches | |
" (ss) fixed regex parsing issue with multiple qualifiers [gi] | |
" (ss) additional factoring of keywords, globals, and members | |
" Last Change: 2012 Oct 05 | |
" 2013 Jun 12: adjusted javaScriptRegexpString (Kevin Locke) | |
" tuning parameters: | |
" unlet javaScript_fold | |
1 0.000014 if !exists("main_syntax") | |
" quit when a syntax file was already loaded | |
if exists("b:current_syntax") | |
finish | |
endif | |
let main_syntax = 'javascript' | |
elseif exists("b:current_syntax") && b:current_syntax == "javascript" | |
finish | |
endif | |
1 0.000014 let s:cpo_save = &cpo | |
1 0.000012 set cpo&vim | |
1 0.000014 syn keyword javaScriptCommentTodo TODO FIXME XXX TBD contained | |
1 0.000014 syn match javaScriptLineComment "\/\/.*" contains=@Spell,javaScriptCommentTodo | |
1 0.000011 syn match javaScriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)" | |
1 0.000012 syn region javaScriptComment start="/\*" end="\*/" contains=@Spell,javaScriptCommentTodo | |
1 0.000011 syn match javaScriptSpecial "\\\d\d\d\|\\." | |
1 0.000016 syn region javaScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=javaScriptSpecial,@htmlPreproc | |
1 0.000129 syn region javaScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=javaScriptSpecial,@htmlPreproc | |
1 0.000008 syn match javaScriptSpecialCharacter "'\\.'" | |
1 0.000012 syn match javaScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>" | |
1 0.000020 syn region javaScriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gim]\{0,2\}\s*$+ end=+/[gim]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline | |
1 0.000007 syn keyword javaScriptConditional if else switch | |
1 0.000007 syn keyword javaScriptRepeat while for do in | |
1 0.000006 syn keyword javaScriptBranch break continue | |
1 0.000010 syn keyword javaScriptOperator new delete instanceof typeof | |
1 0.000243 syn keyword javaScriptType Array Boolean Date Function Number Object String RegExp | |
1 0.000064 syn keyword javaScriptStatement return with | |
1 0.000009 syn keyword javaScriptBoolean true false | |
1 0.000005 syn keyword javaScriptNull null undefined | |
1 0.000007 syn keyword javaScriptIdentifier arguments this var let | |
1 0.000038 syn keyword javaScriptLabel case default | |
1 0.000009 syn keyword javaScriptException try catch finally throw | |
1 0.000007 syn keyword javaScriptMessage alert confirm prompt status | |
1 0.000006 syn keyword javaScriptGlobal self window top parent | |
1 0.000006 syn keyword javaScriptMember document event location | |
1 0.000007 syn keyword javaScriptDeprecated escape unescape | |
1 0.000019 syn keyword javaScriptReserved abstract boolean byte char class const debugger double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile | |
1 0.000006 if exists("javaScript_fold") | |
syn match javaScriptFunction "\<function\>" | |
syn region javaScriptFunctionFold start="\<function\>.*[^};]$" end="^\z1}.*$" transparent fold keepend | |
syn sync match javaScriptSync grouphere javaScriptFunctionFold "\<function\>" | |
syn sync match javaScriptSync grouphere NONE "^}" | |
setlocal foldmethod=syntax | |
setlocal foldtext=getline(v:foldstart) | |
else | |
1 0.000007 syn keyword javaScriptFunction function | |
1 0.000008 syn match javaScriptBraces "[{}\[\]]" | |
1 0.000006 syn match javaScriptParens "[()]" | |
1 0.000001 endif | |
1 0.000002 syn sync fromstart | |
1 0.000002 syn sync maxlines=100 | |
1 0.000005 if main_syntax == "javascript" | |
syn sync ccomment javaScriptComment | |
endif | |
" Define the default highlighting. | |
" Only when an item doesn't have highlighting yet | |
1 0.000004 hi def link javaScriptComment Comment | |
1 0.000003 hi def link javaScriptLineComment Comment | |
1 0.000003 hi def link javaScriptCommentTodo Todo | |
1 0.000003 hi def link javaScriptSpecial Special | |
1 0.000003 hi def link javaScriptStringS String | |
1 0.000002 hi def link javaScriptStringD String | |
1 0.000016 hi def link javaScriptCharacter Character | |
1 0.000003 hi def link javaScriptSpecialCharacter javaScriptSpecial | |
1 0.000004 hi def link javaScriptNumber javaScriptValue | |
1 0.000003 hi def link javaScriptConditional Conditional | |
1 0.000002 hi def link javaScriptRepeat Repeat | |
1 0.000006 hi def link javaScriptBranch Conditional | |
1 0.000003 hi def link javaScriptOperator Operator | |
1 0.000002 hi def link javaScriptType Type | |
1 0.000003 hi def link javaScriptStatement Statement | |
1 0.000003 hi def link javaScriptFunction Function | |
1 0.000002 hi def link javaScriptBraces Function | |
1 0.000004 hi def link javaScriptError Error | |
1 0.000003 hi def link javaScrParenError javaScriptError | |
1 0.000003 hi def link javaScriptNull Keyword | |
1 0.000002 hi def link javaScriptBoolean Boolean | |
1 0.000003 hi def link javaScriptRegexpString String | |
1 0.000003 hi def link javaScriptIdentifier Identifier | |
1 0.000002 hi def link javaScriptLabel Label | |
1 0.000003 hi def link javaScriptException Exception | |
1 0.000002 hi def link javaScriptMessage Keyword | |
1 0.000002 hi def link javaScriptGlobal Keyword | |
1 0.000003 hi def link javaScriptMember Keyword | |
1 0.000003 hi def link javaScriptDeprecated Exception | |
1 0.000002 hi def link javaScriptReserved Keyword | |
1 0.000004 hi def link javaScriptDebug Debug | |
1 0.000004 hi def link javaScriptConstant Label | |
1 0.000080 let b:current_syntax = "javascript" | |
1 0.000005 if main_syntax == 'javascript' | |
unlet main_syntax | |
endif | |
1 0.000011 let &cpo = s:cpo_save | |
1 0.000003 unlet s:cpo_save | |
" vim: ts=8 | |
SCRIPT /usr/share/nvim/runtime/syntax/vb.vim | |
Sourced 1 time | |
Total time: 0.013046 | |
Self time: 0.013046 | |
count total (s) self (s) | |
" Vim syntax file | |
" Language: Visual Basic | |
" Maintainer: Tim Chase <vb.vim@tim.thechases.com> | |
" Former Maintainer: Robert M. Cortopassi <cortopar@mindspring.com> | |
" (tried multiple times to contact, but email bounced) | |
" Last Change: | |
" 2005 May 25 Synched with work by Thomas Barthel | |
" 2004 May 30 Added a few keywords | |
" This was thrown together after seeing numerous requests on the | |
" VIM and VIM-DEV mailing lists. It is by no means complete. | |
" Send comments, suggestions and requests to the maintainer. | |
" quit when a syntax file was already loaded | |
1 0.000011 if exists("b:current_syntax") | |
finish | |
endif | |
" VB is case insensitive | |
1 0.000004 syn case ignore | |
1 0.000016 syn keyword vbConditional If Then ElseIf Else Select Case | |
1 0.000102 syn keyword vbOperator AddressOf And ByRef ByVal Eqv Imp In | |
1 0.000054 syn keyword vbOperator Is Like Mod Not Or To Xor | |
1 0.000009 syn match vbOperator "[()+.,\-/*=&]" | |
1 0.000005 syn match vbOperator "[<>]=\=" | |
1 0.000068 syn match vbOperator "<>" | |
1 0.000005 syn match vbOperator "\s\+_$" | |
1 0.000006 syn keyword vbBoolean True False | |
1 0.000004 syn keyword vbConst Null Nothing | |
1 0.000092 syn keyword vbRepeat Do For ForEach Loop Next | |
1 0.000004 syn keyword vbRepeat Step To Until Wend While | |
1 0.000006 syn keyword vbEvents AccessKeyPress Activate ActiveRowChanged | |
1 0.000004 syn keyword vbEvents AfterAddFile AfterChangeFileName AfterCloseFile | |
1 0.000003 syn keyword vbEvents AfterColEdit AfterColUpdate AfterDelete | |
1 0.000004 syn keyword vbEvents AfterInsert AfterLabelEdit AfterRemoveFile | |
1 0.000003 syn keyword vbEvents AfterUpdate AfterWriteFile AmbientChanged | |
1 0.000004 syn keyword vbEvents ApplyChanges Associate AsyncProgress | |
1 0.000006 syn keyword vbEvents AsyncReadComplete AsyncReadProgress AxisActivated | |
1 0.000004 syn keyword vbEvents AxisLabelActivated AxisLabelSelected | |
1 0.000004 syn keyword vbEvents AxisLabelUpdated AxisSelected AxisTitleActivated | |
1 0.000004 syn keyword vbEvents AxisTitleSelected AxisTitleUpdated AxisUpdated | |
1 0.000003 syn keyword vbEvents BeforeClick BeforeColEdit BeforeColUpdate | |
1 0.000003 syn keyword vbEvents BeforeConnect BeforeDelete BeforeInsert | |
1 0.000003 syn keyword vbEvents BeforeLabelEdit BeforeLoadFile BeforeUpdate | |
1 0.000005 syn keyword vbEvents BeginRequest BeginTrans ButtonClick | |
1 0.000003 syn keyword vbEvents ButtonCompleted ButtonDropDown ButtonGotFocus | |
1 0.000005 syn keyword vbEvents ButtonLostFocus CallbackKeyDown Change Changed | |
1 0.000005 syn keyword vbEvents ChartActivated ChartSelected ChartUpdated Click | |
1 0.000006 syn keyword vbEvents Close CloseQuery CloseUp ColEdit ColResize | |
1 0.000005 syn keyword vbEvents Collapse ColumnClick CommitTrans Compare | |
1 0.000067 syn keyword vbEvents ConfigChageCancelled ConfigChanged | |
1 0.000006 syn keyword vbEvents ConfigChangedCancelled Connect ConnectionRequest | |
1 0.000006 syn keyword vbEvents CurrentRecordChanged DECommandAdded | |
1 0.000004 syn keyword vbEvents DECommandPropertyChanged DECommandRemoved | |
1 0.000004 syn keyword vbEvents DEConnectionAdded DEConnectionPropertyChanged | |
1 0.000093 syn keyword vbEvents DEConnectionRemoved DataArrival DataChanged | |
1 0.000009 syn keyword vbEvents DataUpdated DateClicked DblClick Deactivate | |
1 0.000005 syn keyword vbEvents DevModeChange DeviceArrival DeviceOtherEvent | |
1 0.000004 syn keyword vbEvents DeviceQueryRemove DeviceQueryRemoveFailed | |
1 0.000003 syn keyword vbEvents DeviceRemoveComplete DeviceRemovePending | |
1 0.000005 syn keyword vbEvents Disconnect DisplayChanged Dissociate | |
1 0.000004 syn keyword vbEvents DoGetNewFileName Done DonePainting DownClick | |
1 0.000004 syn keyword vbEvents DragDrop DragOver DropDown EditProperty EditQuery | |
1 0.000005 syn keyword vbEvents EndRequest EnterCell EnterFocus ExitFocus Expand | |
1 0.000004 syn keyword vbEvents FontChanged FootnoteActivated FootnoteSelected | |
1 0.000004 syn keyword vbEvents FootnoteUpdated Format FormatSize GotFocus | |
1 0.000067 syn keyword vbEvents HeadClick HeightChanged Hide InfoMessage | |
1 0.000007 syn keyword vbEvents IniProperties InitProperties Initialize | |
1 0.000004 syn keyword vbEvents ItemActivated ItemAdded ItemCheck ItemClick | |
1 0.000003 syn keyword vbEvents ItemReloaded ItemRemoved ItemRenamed | |
1 0.000004 syn keyword vbEvents ItemSeletected KeyDown KeyPress KeyUp LeaveCell | |
1 0.000003 syn keyword vbEvents LegendActivated LegendSelected LegendUpdated | |
1 0.000003 syn keyword vbEvents LinkClose LinkError LinkExecute LinkNotify | |
1 0.000093 syn keyword vbEvents LinkOpen Load LostFocus MouseDown MouseMove | |
1 0.000006 syn keyword vbEvents MouseUp NodeCheck NodeClick OLECompleteDrag | |
1 0.000005 syn keyword vbEvents OLEDragDrop OLEDragOver OLEGiveFeedback OLESetData | |
1 0.000008 syn keyword vbEvents OLEStartDrag ObjectEvent ObjectMove OnAddNew | |
1 0.000004 syn keyword vbEvents OnComm Paint PanelClick PanelDblClick PathChange | |
1 0.000004 syn keyword vbEvents PatternChange PlotActivated PlotSelected | |
1 0.000005 syn keyword vbEvents PlotUpdated PointActivated PointLabelActivated | |
1 0.000051 syn keyword vbEvents PointLabelSelected PointLabelUpdated PointSelected | |
1 0.000006 syn keyword vbEvents PointUpdated PowerQuerySuspend PowerResume | |
1 0.000004 syn keyword vbEvents PowerStatusChanged PowerSuspend ProcessTag | |
1 0.000004 syn keyword vbEvents ProcessingTimeout QueryChangeConfig QueryClose | |
1 0.000004 syn keyword vbEvents QueryComplete QueryCompleted QueryTimeout | |
1 0.000005 syn keyword vbEvents QueryUnload ReadProperties RepeatedControlLoaded | |
1 0.000004 syn keyword vbEvents RepeatedControlUnloaded Reposition | |
1 0.000005 syn keyword vbEvents RequestChangeFileName RequestWriteFile Resize | |
1 0.000005 syn keyword vbEvents ResultsChanged RetainedProject RollbackTrans | |
1 0.000005 syn keyword vbEvents RowColChange RowCurrencyChange RowResize | |
1 0.000004 syn keyword vbEvents RowStatusChanged Scroll SelChange SelectionChanged | |
1 0.000004 syn keyword vbEvents SendComplete SendProgress SeriesActivated | |
1 0.000006 syn keyword vbEvents SeriesSelected SeriesUpdated SettingChanged Show | |
1 0.000004 syn keyword vbEvents SplitChange Start StateChanged StatusUpdate | |
1 0.000004 syn keyword vbEvents SysColorsChanged Terminate TimeChanged Timer | |
1 0.000003 syn keyword vbEvents TitleActivated TitleSelected TitleUpdated | |
1 0.000003 syn keyword vbEvents UnboundAddData UnboundDeleteRow | |
1 0.000003 syn keyword vbEvents UnboundGetRelativeBookmark UnboundReadData | |
1 0.000004 syn keyword vbEvents UnboundWriteData Unformat Unload UpClick Updated | |
1 0.000003 syn keyword vbEvents UserEvent Validate ValidationError | |
1 0.000003 syn keyword vbEvents VisibleRecordChanged WillAssociate WillChangeData | |
1 0.000003 syn keyword vbEvents WillDissociate WillExecute WillUpdateRows | |
1 0.000002 syn keyword vbEvents WriteProperties | |
1 0.000015 syn keyword vbFunction Abs Array Asc AscB AscW Atn Avg BOF CBool CByte | |
1 0.000006 syn keyword vbFunction CCur CDate CDbl CInt CLng CSng CStr CVDate CVErr | |
1 0.000006 syn keyword vbFunction CVar CallByName Cdec Choose Chr ChrB ChrW Command | |
1 0.000005 syn keyword vbFunction Cos Count CreateObject CurDir DDB Date DateAdd | |
1 0.000005 syn keyword vbFunction DateDiff DatePart DateSerial DateValue Day Dir | |
1 0.000108 syn keyword vbFunction DoEvents EOF Environ Error Exp FV FileAttr | |
1 0.000008 syn keyword vbFunction FileDateTime FileLen FilterFix Fix Format | |
1 0.000005 syn keyword vbFunction FormatCurrency FormatDateTime FormatNumber | |
1 0.000004 syn keyword vbFunction FormatPercent FreeFile GetAllStrings GetAttr | |
1 0.000004 syn keyword vbFunction GetAutoServerSettings GetObject GetSetting Hex | |
1 0.000004 syn keyword vbFunction Hour IIf IMEStatus IPmt InStr Input InputB | |
1 0.000008 syn keyword vbFunction InputBox InstrB Int IsArray IsDate IsEmpty IsError | |
1 0.000004 syn keyword vbFunction IsMissing IsNull IsNumeric IsObject Join LBound | |
1 0.000844 syn keyword vbFunction LCase LOF LTrim Left LeftB Len LenB LoadPicture | |
1 0.000340 syn keyword vbFunction LoadResData LoadResPicture LoadResString Loc Log | |
1 0.000273 syn keyword vbFunction MIRR Max Mid MidB Min Minute Month MonthName | |
1 0.000813 syn keyword vbFunction MsgBox NPV NPer Now Oct PPmt PV Partition Pmt | |
1 0.000938 syn keyword vbFunction QBColor RGB RTrim Rate Replace Right RightB Rnd | |
1 0.000529 syn keyword vbFunction Round SLN SYD Second Seek Sgn Shell Sin Space Spc | |
1 0.000316 syn keyword vbFunction Split Sqr StDev StDevP Str StrComp StrConv | |
1 0.000278 syn keyword vbFunction StrReverse String Sum Switch Tab Tan Time | |
1 0.000246 syn keyword vbFunction TimeSerial TimeValue Timer Trim TypeName UBound | |
1 0.000475 syn keyword vbFunction UCase Val Var VarP VarType Weekday WeekdayName | |
1 0.000024 syn keyword vbFunction Year | |
1 0.000415 syn keyword vbMethods AboutBox Accept Activate Add AddCustom AddFile | |
1 0.000086 syn keyword vbMethods AddFromFile AddFromGuid AddFromString | |
1 0.000176 syn keyword vbMethods AddFromTemplate AddItem AddNew AddToAddInToolbar | |
1 0.000134 syn keyword vbMethods AddToolboxProgID Append AppendAppendChunk | |
1 0.000263 syn keyword vbMethods AppendChunk Arrange Assert AsyncRead BatchUpdate | |
1 0.000051 syn keyword vbMethods BeginQueryEdit BeginTrans Bind BuildPath | |
1 0.000149 syn keyword vbMethods CanPropertyChange Cancel CancelAsyncRead | |
1 0.000070 syn keyword vbMethods CancelBatch CancelUpdate CaptureImage CellText | |
1 0.000065 syn keyword vbMethods CellValue Circle Clear ClearFields ClearSel | |
1 0.000156 syn keyword vbMethods ClearSelCols ClearStructure Clone Close Cls | |
1 0.000052 syn keyword vbMethods ColContaining CollapseAll ColumnSize CommitTrans | |
1 0.000139 syn keyword vbMethods CompactDatabase Compose Connect Copy CopyFile | |
1 0.000135 syn keyword vbMethods CopyFolder CopyQueryDef Count CreateDatabase | |
1 0.000124 syn keyword vbMethods CreateDragImage CreateEmbed CreateField | |
1 0.000160 syn keyword vbMethods CreateFolder CreateGroup CreateIndex CreateLink | |
1 0.000296 syn keyword vbMethods CreatePreparedStatement CreatePropery CreateQuery | |
1 0.000152 syn keyword vbMethods CreateQueryDef CreateRelation CreateTableDef | |
1 0.000115 syn keyword vbMethods CreateTextFile CreateToolWindow CreateUser | |
1 0.000162 syn keyword vbMethods CreateWorkspace Customize Cut Delete | |
1 0.000264 syn keyword vbMethods DeleteColumnLabels DeleteColumns DeleteFile | |
1 0.000166 syn keyword vbMethods DeleteFolder DeleteLines DeleteRowLabels | |
1 0.000072 syn keyword vbMethods DeleteRows DeselectAll DesignerWindow DoVerb Drag | |
1 0.000008 syn keyword vbMethods Draw DriveExists Edit EditCopy EditPaste EndDoc | |
1 0.000004 syn keyword vbMethods EnsureVisible EstablishConnection Execute Exists | |
1 0.000004 syn keyword vbMethods Expand Export ExportReport ExtractIcon Fetch | |
1 0.000065 syn keyword vbMethods FetchVerbs FileExists Files FillCache Find | |
1 0.000087 syn keyword vbMethods FindFirst FindItem FindLast FindNext FindPrevious | |
1 0.000008 syn keyword vbMethods FolderExists Forward GetAbsolutePathName | |
1 0.000005 syn keyword vbMethods GetBaseName GetBookmark GetChunk GetClipString | |
1 0.000005 syn keyword vbMethods GetData GetDrive GetDriveName GetFile GetFileName | |
1 0.000004 syn keyword vbMethods GetFirstVisible GetFolder GetFormat GetHeader | |
1 0.000007 syn keyword vbMethods GetLineFromChar GetNumTicks GetParentFolderName | |
1 0.000004 syn keyword vbMethods GetRows GetSelectedPart GetSelection | |
1 0.000004 syn keyword vbMethods GetSpecialFolder GetTempName GetText | |
1 0.000005 syn keyword vbMethods GetVisibleCount GoBack GoForward Hide HitTest | |
1 0.000005 syn keyword vbMethods HoldFields Idle Import InitializeLabels Insert | |
1 0.000007 syn keyword vbMethods InsertColumnLabels InsertColumns InsertFile | |
1 0.000004 syn keyword vbMethods InsertLines InsertObjDlg InsertRowLabels | |
1 0.000005 syn keyword vbMethods InsertRows Item Keys KillDoc Layout Line Lines | |
1 0.000005 syn keyword vbMethods LinkExecute LinkPoke LinkRequest LinkSend Listen | |
1 0.000005 syn keyword vbMethods LoadFile LoadResData LoadResPicture LoadResString | |
1 0.000004 syn keyword vbMethods LogEvent MakeCompileFile MakeCompiledFile | |
1 0.000004 syn keyword vbMethods MakeReplica MoreResults Move MoveData MoveFile | |
1 0.000004 syn keyword vbMethods MoveFirst MoveFolder MoveLast MoveNext | |
1 0.000004 syn keyword vbMethods MovePrevious NavigateTo NewPage NewPassword | |
1 0.000005 syn keyword vbMethods NextRecordset OLEDrag OnAddinsUpdate OnConnection | |
1 0.000004 syn keyword vbMethods OnDisconnection OnStartupComplete Open | |
1 0.000004 syn keyword vbMethods OpenAsTextStream OpenConnection OpenDatabase | |
1 0.000006 syn keyword vbMethods OpenQueryDef OpenRecordset OpenResultset OpenURL | |
1 0.000005 syn keyword vbMethods Overlay PSet PaintPicture PastSpecialDlg Paste | |
1 0.000004 syn keyword vbMethods PeekData Play Point PopulatePartial PopupMenu | |
1 0.000005 syn keyword vbMethods Print PrintForm PrintReport PropertyChanged Quit | |
1 0.000004 syn keyword vbMethods Raise RandomDataFill RandomFillColumns | |
1 0.000005 syn keyword vbMethods RandomFillRows ReFill Read ReadAll ReadFromFile | |
1 0.000005 syn keyword vbMethods ReadLine ReadProperty Rebind Refresh RefreshLink | |
1 0.000004 syn keyword vbMethods RegisterDatabase ReleaseInstance Reload Remove | |
1 0.000004 syn keyword vbMethods RemoveAddInFromToolbar RemoveAll RemoveItem Render | |
1 0.000004 syn keyword vbMethods RepairDatabase ReplaceLine Reply ReplyAll Requery | |
1 0.000007 syn keyword vbMethods ResetCustom ResetCustomLabel ResolveName | |
1 0.000007 syn keyword vbMethods RestoreToolbar Resync Rollback RollbackTrans | |
1 0.000103 syn keyword vbMethods RowBookmark RowContaining RowTop Save SaveAs | |
1 0.000005 syn keyword vbMethods SaveFile SaveToFile SaveToOle1File SaveToolbar | |
1 0.000005 syn keyword vbMethods Scale ScaleX ScaleY Scroll SelPrint SelectAll | |
1 0.000006 syn keyword vbMethods SelectPart Send SendData Set SetAutoServerSettings | |
1 0.000005 syn keyword vbMethods SetData SetFocus SetOption SetSelection SetSize | |
1 0.000211 syn keyword vbMethods SetText SetViewport Show ShowColor ShowFont | |
1 0.000007 syn keyword vbMethods ShowHelp ShowOpen ShowPrinter ShowSave | |
1 0.000005 syn keyword vbMethods ShowWhatsThis SignOff SignOn Size Skip SkipLine | |
1 0.000004 syn keyword vbMethods Span Split SplitContaining StartLabelEdit | |
1 0.000004 syn keyword vbMethods StartLogging Stop Synchronize Tag TextHeight | |
1 0.000004 syn keyword vbMethods TextWidth ToDefaults Trace TwipsToChartPart | |
1 0.000004 syn keyword vbMethods TypeByChartType URLFor Update UpdateControls | |
1 0.000030 syn keyword vbMethods UpdateRecord UpdateRow Upto ValidateControls Value | |
1 0.000004 syn keyword vbMethods WhatsThisMode Write WriteBlankLines WriteLine | |
1 0.000003 syn keyword vbMethods WriteProperty WriteTemplate ZOrder | |
1 0.000003 syn keyword vbMethods rdoCreateEnvironment rdoRegisterDataSource | |
1 0.000010 syn keyword vbStatement Alias AppActivate As Base Beep Begin Call ChDir | |
1 0.000008 syn keyword vbStatement ChDrive Close Const Date Declare DefBool DefByte | |
1 0.000006 syn keyword vbStatement DefCur DefDate DefDbl DefDec DefInt DefLng DefObj | |
1 0.000005 syn keyword vbStatement DefSng DefStr DefVar Deftype DeleteSetting Dim Do | |
1 0.000005 syn keyword vbStatement Each ElseIf End Enum Erase Error Event Exit | |
1 0.000005 syn keyword vbStatement Explicit FileCopy For ForEach Function Get GoSub | |
1 0.000035 syn keyword vbStatement GoTo Gosub Implements Kill LSet Let Lib LineInput | |
1 0.000008 syn keyword vbStatement Load Lock Loop Mid MkDir Name Next On OnError Open | |
1 0.000005 syn keyword vbStatement Option Preserve Private Property Public Put RSet | |
1 0.000004 syn keyword vbStatement RaiseEvent Randomize ReDim Redim Reset Resume | |
1 0.000309 syn keyword vbStatement Return RmDir SavePicture SaveSetting Seek SendKeys | |
1 0.000010 syn keyword vbStatement Sendkeys Set SetAttr Static Step Stop Sub Time | |
1 0.000005 syn keyword vbStatement Type Unload Unlock Until Wend While Width With | |
1 0.000004 syn keyword vbStatement Write | |
1 0.000010 syn keyword vbKeyword As Binary ByRef ByVal Date Empty Error Friend Get | |
1 0.000006 syn keyword vbKeyword Input Is Len Lock Me Mid New Nothing Null On | |
1 0.000005 syn keyword vbKeyword Option Optional ParamArray Print Private Property | |
1 0.000085 syn keyword vbKeyword Public PublicNotCreateable OnNewProcessSingleUse | |
1 0.000007 syn keyword vbKeyword InSameProcessMultiUse GlobalMultiUse Resume Seek | |
1 0.000005 syn keyword vbKeyword Set Static Step String Time WithEvents | |
1 0.000162 syn keyword vbTodo contained TODO | |
"Datatypes | |
1 0.000013 syn keyword vbTypes Boolean Byte Currency Date Decimal Double Empty | |
1 0.000006 syn keyword vbTypes Integer Long Object Single String Variant | |
"VB defined values | |
1 0.000130 syn keyword vbDefine dbBigInt dbBinary dbBoolean dbByte dbChar | |
1 0.000007 syn keyword vbDefine dbCurrency dbDate dbDecimal dbDouble dbFloat | |
1 0.000245 syn keyword vbDefine dbGUID dbInteger dbLong dbLongBinary dbMemo | |
1 0.000009 syn keyword vbDefine dbNumeric dbSingle dbText dbTime dbTimeStamp | |
1 0.000003 syn keyword vbDefine dbVarBinary | |
"VB defined values | |
1 0.000005 syn keyword vbDefine vb3DDKShadow vb3DFace vb3DHighlight vb3DLight | |
1 0.000004 syn keyword vbDefine vb3DShadow vbAbort vbAbortRetryIgnore | |
1 0.000004 syn keyword vbDefine vbActiveBorder vbActiveTitleBar vbAlias | |
1 0.000004 syn keyword vbDefine vbApplicationModal vbApplicationWorkspace | |
1 0.000005 syn keyword vbDefine vbAppTaskManager vbAppWindows vbArchive vbArray | |
1 0.000005 syn keyword vbDefine vbBack vbBinaryCompare vbBlack vbBlue vbBoolean | |
1 0.000004 syn keyword vbDefine vbButtonFace vbButtonShadow vbButtonText vbByte | |
1 0.000005 syn keyword vbDefine vbCalGreg vbCalHijri vbCancel vbCr vbCritical | |
1 0.000113 syn keyword vbDefine vbCrLf vbCurrency vbCyan vbDatabaseCompare | |
1 0.000009 syn keyword vbDefine vbDataObject vbDate vbDecimal vbDefaultButton1 | |
1 0.000006 syn keyword vbDefine vbDefaultButton2 vbDefaultButton3 vbDefaultButton4 | |
1 0.000116 syn keyword vbDefine vbDesktop vbDirectory vbDouble vbEmpty vbError | |
1 0.000006 syn keyword vbDefine vbExclamation vbFirstFourDays vbFirstFullWeek | |
1 0.000005 syn keyword vbDefine vbFirstJan1 vbFormCode vbFormControlMenu | |
1 0.000004 syn keyword vbDefine vbFormFeed vbFormMDIForm vbFriday vbFromUnicode | |
1 0.000005 syn keyword vbDefine vbGrayText vbGreen vbHidden vbHide vbHighlight | |
1 0.000004 syn keyword vbDefine vbHighlightText vbHiragana vbIgnore vbIMEAlphaDbl | |
1 0.000004 syn keyword vbDefine vbIMEAlphaSng vbIMEDisable vbIMEHiragana | |
1 0.000004 syn keyword vbDefine vbIMEKatakanaDbl vbIMEKatakanaSng vbIMEModeAlpha | |
1 0.000004 syn keyword vbDefine vbIMEModeAlphaFull vbIMEModeDisable | |
1 0.000004 syn keyword vbDefine vbIMEModeHangul vbIMEModeHangulFull | |
1 0.000004 syn keyword vbDefine vbIMEModeHiragana vbIMEModeKatakana | |
1 0.000004 syn keyword vbDefine vbIMEModeKatakanaHalf vbIMEModeNoControl | |
1 0.000005 syn keyword vbDefine vbIMEModeOff vbIMEModeOn vbIMENoOp vbIMEOff | |
1 0.000004 syn keyword vbDefine vbIMEOn vbInactiveBorder vbInactiveCaptionText | |
1 0.000004 syn keyword vbDefine vbInactiveTitleBar vbInfoBackground vbInformation | |
1 0.000004 syn keyword vbDefine vbInfoText vbInteger vbKatakana vbKey0 vbKey1 | |
1 0.000035 syn keyword vbDefine vbKey2 vbKey3 vbKey4 vbKey5 vbKey6 vbKey7 vbKey8 | |
1 0.000005 syn keyword vbDefine vbKey9 vbKeyA vbKeyAdd vbKeyB vbKeyBack vbKeyC | |
1 0.000013 syn keyword vbDefine vbKeyCancel vbKeyCapital vbKeyClear vbKeyControl | |
1 0.000120 syn keyword vbDefine vbKeyD vbKeyDecimal vbKeyDelete vbKeyDivide | |
1 0.000008 syn keyword vbDefine vbKeyDown vbKeyE vbKeyEnd vbKeyEscape vbKeyExecute | |
1 0.000006 syn keyword vbDefine vbKeyF vbKeyF1 vbKeyF10 vbKeyF11 vbKeyF12 vbKeyF13 | |
1 0.000006 syn keyword vbDefine vbKeyF14 vbKeyF15 vbKeyF16 vbKeyF2 vbKeyF3 vbKeyF4 | |
1 0.000006 syn keyword vbDefine vbKeyF5 vbKeyF6 vbKeyF7 vbKeyF8 vbKeyF9 vbKeyG | |
1 0.000006 syn keyword vbDefine vbKeyH vbKeyHelp vbKeyHome vbKeyI vbKeyInsert | |
1 0.000006 syn keyword vbDefine vbKeyJ vbKeyK vbKeyL vbKeyLButton vbKeyLeft vbKeyM | |
1 0.000005 syn keyword vbDefine vbKeyMButton vbKeyMenu vbKeyMultiply vbKeyN | |
1 0.000005 syn keyword vbDefine vbKeyNumlock vbKeyNumpad0 vbKeyNumpad1 | |
1 0.000005 syn keyword vbDefine vbKeyNumpad2 vbKeyNumpad3 vbKeyNumpad4 | |
1 0.000004 syn keyword vbDefine vbKeyNumpad5 vbKeyNumpad6 vbKeyNumpad7 | |
1 0.000007 syn keyword vbDefine vbKeyNumpad8 vbKeyNumpad9 vbKeyO vbKeyP | |
1 0.000005 syn keyword vbDefine vbKeyPageDown vbKeyPageUp vbKeyPause vbKeyPrint | |
1 0.000005 syn keyword vbDefine vbKeyQ vbKeyR vbKeyRButton vbKeyReturn vbKeyRight | |
1 0.000008 syn keyword vbDefine vbKeyS vbKeySelect vbKeySeparator vbKeyShift | |
1 0.000005 syn keyword vbDefine vbKeySnapshot vbKeySpace vbKeySubtract vbKeyT | |
1 0.000120 syn keyword vbDefine vbKeyTab vbKeyU vbKeyUp vbKeyV vbKeyW vbKeyX | |
1 0.000005 syn keyword vbDefine vbKeyY vbKeyZ vbLf vbLong vbLowerCase vbMagenta | |
1 0.000003 syn keyword vbDefine vbMaximizedFocus vbMenuBar vbMenuText | |
1 0.000004 syn keyword vbDefine vbMinimizedFocus vbMinimizedNoFocus vbMonday | |
1 0.000003 syn keyword vbDefine vbMsgBox vbMsgBoxHelpButton vbMsgBoxRight | |
1 0.000003 syn keyword vbDefine vbMsgBoxRtlReading vbMsgBoxSetForeground | |
1 0.000004 syn keyword vbDefine vbMsgBoxText vbNarrow vbNewLine vbNo vbNormal | |
1 0.000004 syn keyword vbDefine vbNormalFocus vbNormalNoFocus vbNull vbNullChar | |
1 0.000004 syn keyword vbDefine vbNullString vbObject vbObjectError vbOK | |
1 0.000070 syn keyword vbDefine vbOKCancel vbOKOnly vbProperCase vbQuestion | |
1 0.000006 syn keyword vbDefine vbReadOnly vbRed vbRetry vbRetryCancel vbSaturday | |
1 0.000004 syn keyword vbDefine vbScrollBars vbSingle vbString vbSunday vbSystem | |
1 0.000004 syn keyword vbDefine vbSystemModal vbTab vbTextCompare vbThursday | |
1 0.000004 syn keyword vbDefine vbTitleBarText vbTuesday vbUnicode vbUpperCase | |
1 0.000004 syn keyword vbDefine vbUseSystem vbUseSystemDayOfWeek vbVariant | |
1 0.000007 syn keyword vbDefine vbVerticalTab vbVolume vbWednesday vbWhite vbWide | |
1 0.000005 syn keyword vbDefine vbWindowBackground vbWindowFrame vbWindowText | |
1 0.000032 syn keyword vbDefine vbYellow vbYes vbYesNo vbYesNoCancel | |
"Numbers | |
"integer number, or floating point number without a dot. | |
1 0.000015 syn match vbNumber "\<\d\+\>" | |
"floating point number, with dot | |
1 0.000005 syn match vbNumber "\<\d\+\.\d*\>" | |
"floating point number, starting with a dot | |
1 0.000091 syn match vbNumber "\.\d\+\>" | |
"syn match vbNumber "{[[:xdigit:]-]\+}\|&[hH][[:xdigit:]]\+&" | |
"syn match vbNumber ":[[:xdigit:]]\+" | |
"syn match vbNumber "[-+]\=\<\d\+\>" | |
1 0.000011 syn match vbFloat "[-+]\=\<\d\+[eE][\-+]\=\d\+" | |
1 0.000013 syn match vbFloat "[-+]\=\<\d\+\.\d*\([eE][\-+]\=\d\+\)\=" | |
1 0.000006 syn match vbFloat "[-+]\=\<\.\d\+\([eE][\-+]\=\d\+\)\=" | |
" String and Character contstants | |
1 0.000009 syn region vbString start=+"+ end=+"\|$+ | |
1 0.000012 syn region vbComment start="\(^\|\s\)REM\s" end="$" contains=vbTodo | |
1 0.000040 syn region vbComment start="\(^\|\s\)\'" end="$" contains=vbTodo | |
1 0.000007 syn match vbLineNumber "^\d\+\(\s\|$\)" | |
1 0.000009 syn match vbTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1 | |
1 0.000087 syn match vbTypeSpecifier "#[a-zA-Z0-9]"me=e-1 | |
" Define the default highlighting. | |
" Only when an item doesn't have highlighting yet | |
1 0.000005 hi def link vbBoolean Boolean | |
1 0.000002 hi def link vbLineNumber Comment | |
1 0.000002 hi def link vbComment Comment | |
1 0.000002 hi def link vbConditional Conditional | |
1 0.000002 hi def link vbConst Constant | |
1 0.000002 hi def link vbDefine Constant | |
1 0.000004 hi def link vbError Error | |
1 0.000002 hi def link vbFunction Identifier | |
1 0.000004 hi def link vbIdentifier Identifier | |
1 0.000002 hi def link vbNumber Number | |
1 0.000002 hi def link vbFloat Float | |
1 0.000003 hi def link vbMethods PreProc | |
1 0.000003 hi def link vbOperator Operator | |
1 0.000003 hi def link vbRepeat Repeat | |
1 0.000003 hi def link vbString String | |
1 0.000004 hi def link vbStatement Statement | |
1 0.000002 hi def link vbKeyword Statement | |
1 0.000002 hi def link vbEvents Special | |
1 0.000002 hi def link vbTodo Todo | |
1 0.000002 hi def link vbTypes Type | |
1 0.000002 hi def link vbTypeSpecifier Type | |
1 0.000012 let b:current_syntax = "vb" | |
" vim: ts=8 | |
SCRIPT /usr/share/nvim/runtime/syntax/css.vim | |
Sourced 1 time | |
Total time: 0.014297 | |
Self time: 0.014297 | |
count total (s) self (s) | |
" Vim syntax file | |
" Language: Cascading Style Sheets | |
" Previous Contributor List: | |
" Claudio Fleiner <claudio@fleiner.com> (Maintainer) | |
" Yeti (Add full CSS2, HTML4 support) | |
" Nikolai Weibull (Add CSS2 support) | |
" Maintainer: Jules Wang <w.jq0722@gmail.com> | |
" URL: https://github.com/JulesWang/css.vim | |
" Last Change: 2017 Jan 14 | |
" cssClassName updated by Ryuichi Hayashida Jan 2016 | |
" quit when a syntax file was already loaded | |
1 0.000011 if !exists("main_syntax") | |
if exists("b:current_syntax") | |
finish | |
endif | |
let main_syntax = 'css' | |
elseif exists("b:current_syntax") && b:current_syntax == "css" | |
finish | |
endif | |
1 0.000017 let s:cpo_save = &cpo | |
1 0.000096 set cpo&vim | |
1 0.000004 syn case ignore | |
" HTML4 tags | |
1 0.000013 syn keyword cssTagName abbr address area a b base | |
1 0.000006 syn keyword cssTagName bdo blockquote body br button | |
1 0.000007 syn keyword cssTagName caption cite code col colgroup dd del | |
1 0.000006 syn keyword cssTagName dfn div dl dt em fieldset form | |
1 0.000006 syn keyword cssTagName h1 h2 h3 h4 h5 h6 head hr html img i | |
1 0.000008 syn keyword cssTagName iframe input ins isindex kbd label legend li | |
1 0.000006 syn keyword cssTagName link map menu meta noscript ol optgroup | |
1 0.000010 syn keyword cssTagName option p param pre q s samp script small | |
1 0.000007 syn keyword cssTagName span strong sub sup tbody td | |
1 0.000006 syn keyword cssTagName textarea tfoot th thead title tr ul u var | |
1 0.000003 syn keyword cssTagName object svg | |
1 0.000011 syn match cssTagName /\<select\>\|\<style\>\|\<table\>/ | |
" 34 HTML5 tags | |
1 0.000006 syn keyword cssTagName article aside audio bdi canvas command data | |
1 0.000006 syn keyword cssTagName datalist details dialog embed figcaption figure footer | |
1 0.000005 syn keyword cssTagName header hgroup keygen main mark menuitem meter nav | |
1 0.000005 syn keyword cssTagName output progress rt rp ruby section | |
1 0.000005 syn keyword cssTagName source summary time track video wbr | |
" Tags not supported in HTML5 | |
" acronym applet basefont big center dir | |
" font frame frameset noframes strike tt | |
1 0.000005 syn match cssTagName "\*" | |
" selectors | |
1 0.000008 syn match cssSelectorOp "[,>+~]" | |
1 0.000010 syn match cssSelectorOp2 "[~|^$*]\?=" contained | |
1 0.000102 syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ | |
" .class and #id | |
1 0.000172 syn match cssClassName "\.-\=[A-Za-z_][A-Za-z0-9_-]*" contains=cssClassNameDot | |
1 0.000009 syn match cssClassNameDot contained '\.' | |
1 0.000002 try | |
1 0.000014 syn match cssIdentifier "#[A-Za-z�-�_@][A-Za-z�-�0-9_@-]*" | |
1 0.000002 catch /^.*/ | |
syn match cssIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*" | |
endtry | |
" digits | |
1 0.000019 syn match cssValueInteger contained "[-+]\=\d\+" contains=cssUnitDecorators | |
1 0.000010 syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\=" contains=cssUnitDecorators | |
1 0.000017 syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\)\>" contains=cssUnitDecorators | |
1 0.000011 syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)\>" contains=cssUnitDecorators | |
1 0.000009 syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)\>" contains=cssUnitDecorators | |
1 0.000009 syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)\>" contains=cssUnitDecorators | |
1 0.000013 syn match cssIncludeKeyword /@\(-[a-z]\+-\)\=\(media\|keyframes\|import\|charset\|namespace\|page\)/ contained | |
" @media | |
1 0.000050 syn region cssInclude start=/@media\>/ end=/\ze{/ skipwhite skipnl contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType,cssIncludeKeyword,cssMediaComma,cssComment nextgroup=cssMediaBlock | |
1 0.000013 syn keyword cssMediaType contained screen print aural braille embossed handheld projection tty tv speech all contained skipwhite skipnl | |
1 0.000006 syn keyword cssMediaKeyword only not and contained | |
1 0.001545 syn region cssMediaBlock transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssTagName,cssClassName,cssIdentifier,cssPseudoClass,cssSelectorOp,cssSelectorOp2,cssAttributeSelector fold | |
1 0.000010 syn match cssMediaComma "," skipwhite skipnl contained | |
" Reference: http://www.w3.org/TR/css3-mediaqueries/ | |
1 0.000008 syn keyword cssMediaProp contained width height orientation scan grid | |
1 0.000010 syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio/ | |
1 0.000012 syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/ | |
1 0.000008 syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/ | |
1 0.000011 syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/ | |
1 0.000005 syn keyword cssMediaAttr contained portrait landscape progressive interlace | |
" @page | |
" http://www.w3.org/TR/css3-page/ | |
1 0.000020 syn match cssPage "@page\>[^{]*{\@=" contains=cssPagePseudo,cssIncludeKeyword nextgroup=cssPageWrap transparent skipwhite skipnl | |
1 0.000009 syn match cssPagePseudo /:\(left\|right\|first\|blank\)/ contained skipwhite skipnl | |
1 0.001509 syn region cssPageWrap contained transparent matchgroup=cssBraces start="{" end="}" contains=cssPageMargin,cssPageProp,cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks | |
1 0.000193 syn match cssPageMargin /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition skipwhite skipnl | |
1 0.000008 syn keyword cssPageProp contained content size | |
" http://www.w3.org/TR/CSS2/page.html#break-inside | |
1 0.000005 syn keyword cssPageProp contained orphans widows | |
" @keyframe | |
" http://www.w3.org/TR/css3-animations/#keyframes | |
1 0.000022 syn match cssKeyFrame "@\(-[a-z]\+-\)\=keyframes\>[^{]*{\@=" nextgroup=cssKeyFrameWrap contains=cssVendor,cssIncludeKeyword skipwhite skipnl transparent | |
1 0.000013 syn region cssKeyFrameWrap contained transparent matchgroup=cssBraces start="{" end="}" contains=cssKeyFrameSelector | |
1 0.000007 syn match cssKeyFrameSelector /\(\d*%\|from\|to\)\=/ contained skipwhite skipnl nextgroup=cssDefinition | |
" @import | |
1 0.000020 syn region cssInclude start=/@import\>/ end=/\ze;/ transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword,cssURL,cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType | |
1 0.000016 syn region cssInclude start=/@charset\>/ end=/\ze;/ transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword | |
1 0.000013 syn region cssInclude start=/@namespace\>/ end=/\ze;/ transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword | |
" @font-face | |
" http://www.w3.org/TR/css3-fonts/#at-font-face-rule | |
1 0.000160 syn match cssFontDescriptor "@font-face\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl | |
1 0.000515 syn region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssCommonAttr,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,cssFontDescriptorAttr,cssNoise | |
1 0.000011 syn match cssFontDescriptorProp contained "\<font-family\>" | |
1 0.000005 syn keyword cssFontDescriptorProp contained src | |
1 0.000008 syn match cssFontDescriptorProp contained "\<font-\(style\|weight\|stretch\)\>" | |
1 0.000005 syn match cssFontDescriptorProp contained "\<unicode-range\>" | |
1 0.000010 syn match cssFontDescriptorProp contained "\<font-\(variant\|feature-settings\)\>" | |
" src functions | |
1 0.000021 syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline keepend | |
" font-sytle and font-weight attributes | |
1 0.000007 syn keyword cssFontDescriptorAttr contained normal italic oblique bold | |
" font-stretch attributes | |
1 0.000011 syn match cssFontDescriptorAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>" | |
" unicode-range attributes | |
1 0.000007 syn match cssFontDescriptorAttr contained "U+[0-9A-Fa-f?]\+" | |
1 0.000005 syn match cssFontDescriptorAttr contained "U+\x\+-\x\+" | |
" font-feature-settings attributes | |
1 0.000004 syn keyword cssFontDescriptorAttr contained on off | |
" The 16 basic color names | |
1 0.000012 syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow | |
" 130 more color names | |
1 0.000005 syn keyword cssColor contained aliceblue antiquewhite aquamarine azure | |
1 0.000011 syn keyword cssColor contained beige bisque blanchedalmond blueviolet brown burlywood | |
1 0.000010 syn keyword cssColor contained cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan | |
1 0.000010 syn match cssColor contained /\<dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)\>/ | |
1 0.000008 syn match cssColor contained /\<dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)\>/ | |
1 0.000006 syn match cssColor contained /\<darkslate\(blue\|gray\|grey\)\>/ | |
1 0.000004 syn match cssColor contained /\<dark\(turquoise\|violet\)\>/ | |
1 0.000005 syn keyword cssColor contained deeppink deepskyblue dimgray dimgrey dodgerblue firebrick | |
1 0.000004 syn keyword cssColor contained floralwhite forestgreen gainsboro ghostwhite gold | |
1 0.000004 syn keyword cssColor contained goldenrod greenyellow grey honeydew hotpink | |
1 0.000005 syn keyword cssColor contained indianred indigo ivory khaki lavender lavenderblush lawngreen | |
1 0.000004 syn keyword cssColor contained lemonchiffon limegreen linen magenta | |
1 0.000009 syn match cssColor contained /\<light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)\>/ | |
1 0.000008 syn match cssColor contained /\<light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)\>/ | |
1 0.000007 syn match cssColor contained /\<light\(slategray\|slategrey\|steelblue\)\>/ | |
1 0.000008 syn match cssColor contained /\<medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)\>/ | |
1 0.000008 syn match cssColor contained /\<medium\(slateblue\|springgreen\|turquoise\|violetred\)\>/ | |
1 0.000005 syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajowhite | |
1 0.000004 syn keyword cssColor contained oldlace olivedrab orange orangered orchid | |
1 0.000006 syn match cssColor contained /\<pale\(goldenrod\|green\|turquoise\|violetred\)\>/ | |
1 0.000004 syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue | |
1 0.000005 syn keyword cssColor contained rosybrown royalblue saddlebrown salmon sandybrown | |
1 0.000004 syn keyword cssColor contained seagreen seashell sienna skyblue slateblue | |
1 0.000004 syn keyword cssColor contained slategray slategrey snow springgreen steelblue tan | |
1 0.000003 syn keyword cssColor contained thistle tomato turquoise violet wheat | |
1 0.000002 syn keyword cssColor contained whitesmoke yellowgreen | |
" FIXME: These are actually case-insensitive too, but (a) specs recommend using | |
" mixed-case (b) it's hard to highlight the word `Background' correctly in | |
" all situations | |
1 0.000003 syn case match | |
1 0.000008 syn keyword cssColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFace ButtonHighlight ButtonShadow ButtonText CaptionText GrayText Highlight HighlightText InactiveBorder InactiveCaption InactiveCaptionText InfoBackground InfoText Menu MenuText Scrollbar ThreeDDarkShadow ThreeDFace ThreeDHighlight ThreeDLightShadow ThreeDShadow Window WindowFrame WindowText Background | |
1 0.000001 syn case ignore | |
1 0.000004 syn match cssImportant contained "!\s*important\>" | |
1 0.000003 syn match cssColor contained "\<transparent\>" | |
1 0.000004 syn match cssColor contained "\<currentColor\>" | |
1 0.000003 syn match cssColor contained "\<white\>" | |
1 0.000006 syn match cssColor contained "#[0-9A-Fa-f]\{3\}\>" contains=cssUnitDecorators | |
1 0.000004 syn match cssColor contained "#[0-9A-Fa-f]\{6\}\>" contains=cssUnitDecorators | |
1 0.000007 syn region cssURL contained matchgroup=cssFunctionName start="\<url\s*(" end=")" contains=cssStringQ,cssStringQQ oneline | |
1 0.000014 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma | |
1 0.000012 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction | |
1 0.000013 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma | |
1 0.000016 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(matrix\(3d\)\=\|scale\(3d\|X\|Y\|Z\)\=\|translate\(3d\|X\|Y\|Z\)\=\|skew\(X\|Y\)\=\|rotate\(3d\|X\|Y\|Z\)\=\|perspective\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma | |
1 0.000006 syn keyword cssGradientAttr contained top bottom left right cover center middle ellipse at | |
1 0.000002 syn match cssFunctionComma contained "," | |
" Common Prop and Attr | |
1 0.000004 syn keyword cssCommonAttr contained auto none inherit all default normal | |
1 0.000005 syn keyword cssCommonAttr contained top bottom center stretch hidden visible | |
"------------------------------------------------ | |
" CSS Animations | |
" http://www.w3.org/TR/css3-animations/ | |
1 0.000013 syn match cssAnimationProp contained "\<animation\(-\(delay\|direction\|duration\|fill-mode\|name\|play-state\|timing-function\|iteration-count\)\)\=\>" | |
" animation-direction attributes | |
1 0.000005 syn keyword cssAnimationAttr contained alternate reverse | |
1 0.000004 syn match cssAnimationAttr contained "\<alternate-reverse\>" | |
" animation-fill-mode attributes | |
1 0.000003 syn keyword cssAnimationAttr contained forwards backwards both | |
" animation-play-state attributes | |
1 0.000002 syn keyword cssAnimationAttr contained running paused | |
" animation-iteration-count attributes | |
1 0.000122 syn keyword cssAnimationAttr contained infinite | |
"------------------------------------------------ | |
" CSS Backgrounds and Borders Module Level 3 | |
" http://www.w3.org/TR/css3-background/ | |
1 0.000018 syn match cssBackgroundProp contained "\<background\(-\(attachment\|clip\|color\|image\|origin\|position\|repeat\|size\)\)\=\>" | |
" background-attachment attributes | |
1 0.000010 syn keyword cssBackgroundAttr contained scroll fixed local | |
" background-position attributes | |
1 0.000005 syn keyword cssBackgroundAttr contained left center right top bottom | |
" background-repeat attributes | |
1 0.000008 syn match cssBackgroundAttr contained "\<no-repeat\>" | |
1 0.000006 syn match cssBackgroundAttr contained "\<repeat\(-[xy]\)\=\>" | |
1 0.000003 syn keyword cssBackgroundAttr contained space round | |
" background-size attributes | |
1 0.000003 syn keyword cssBackgroundAttr contained cover contain | |
1 0.000015 syn match cssBorderProp contained "\<border\(-\(top\|right\|bottom\|left\)\)\=\(-\(width\|color\|style\)\)\=\>" | |
1 0.000009 syn match cssBorderProp contained "\<border\(-\(top\|bottom\)-\(left\|right\)\)\=-radius\>" | |
1 0.000011 syn match cssBorderProp contained "\<border-image\(-\(outset\|repeat\|slice\|source\|width\)\)\=\>" | |
1 0.000006 syn match cssBorderProp contained "\<box-decoration-break\>" | |
1 0.000004 syn match cssBorderProp contained "\<box-shadow\>" | |
" border-image attributes | |
1 0.000008 syn keyword cssBorderAttr contained stretch round space fill | |
" border-style attributes | |
1 0.000007 syn keyword cssBorderAttr contained dotted dashed solid double groove ridge inset outset | |
" border-width attributes | |
1 0.000004 syn keyword cssBorderAttr contained thin thick medium | |
" box-decoration-break attributes | |
1 0.000003 syn keyword cssBorderAttr contained clone slice | |
"------------------------------------------------ | |
1 0.000010 syn match cssBoxProp contained "\<padding\(-\(top\|right\|bottom\|left\)\)\=\>" | |
1 0.000008 syn match cssBoxProp contained "\<margin\(-\(top\|right\|bottom\|left\)\)\=\>" | |
1 0.000007 syn match cssBoxProp contained "\<overflow\(-\(x\|y\|style\)\)\=\>" | |
1 0.000005 syn match cssBoxProp contained "\<rotation\(-point\)\=\>" | |
1 0.000007 syn keyword cssBoxAttr contained visible hidden scroll auto | |
1 0.000006 syn match cssBoxAttr contained "\<no-\(display\|content\)\>" | |
1 0.000006 syn keyword cssColorProp contained opacity | |
1 0.000005 syn match cssColorProp contained "\<color-profile\>" | |
1 0.000005 syn match cssColorProp contained "\<rendering-intent\>" | |
1 0.000015 syn match cssDimensionProp contained "\<\(min\|max\)-\(width\|height\)\>" | |
1 0.000004 syn keyword cssDimensionProp contained height | |
1 0.000003 syn keyword cssDimensionProp contained width | |
" shadow and sizing are in other property groups | |
1 0.000013 syn match cssFlexibleBoxProp contained "\<box-\(align\|direction\|flex\|ordinal-group\|orient\|pack\|shadow\|sizing\)\>" | |
1 0.000007 syn keyword cssFlexibleBoxAttr contained start end baseline | |
1 0.000003 syn keyword cssFlexibleBoxAttr contained reverse | |
1 0.000004 syn keyword cssFlexibleBoxAttr contained single multiple | |
1 0.000003 syn keyword cssFlexibleBoxAttr contained horizontal | |
1 0.000008 syn match cssFlexibleBoxAttr contained "\<vertical\(-align\)\@!\>" "escape vertical-align | |
1 0.000005 syn match cssFlexibleBoxAttr contained "\<\(inline\|block\)-axis\>" | |
" CSS Fonts Module Level 3 | |
" http://www.w3.org/TR/css-fonts-3/ | |
1 0.000018 syn match cssFontProp contained "\<font\(-\(family\|\|feature-settings\|kerning\|language-override\|size\(-adjust\)\=\|stretch\|style\|synthesis\|variant\(-\(alternates\|caps\|east-asian\|ligatures\|numeric\|position\)\)\=\|weight\)\)\=\>" | |
" font attributes | |
1 0.000004 syn keyword cssFontAttr contained icon menu caption | |
1 0.000007 syn match cssFontAttr contained "\<small-\(caps\|caption\)\>" | |
1 0.000003 syn match cssFontAttr contained "\<message-box\>" | |
1 0.000003 syn match cssFontAttr contained "\<status-bar\>" | |
1 0.000002 syn keyword cssFontAttr contained larger smaller | |
1 0.000005 syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>" | |
" font-family attributes | |
1 0.000004 syn match cssFontAttr contained "\<\(sans-\)\=serif\>" | |
1 0.000020 syn keyword cssFontAttr contained Antiqua Arial Black Book Charcoal Comic Courier Dingbats Gadget Geneva Georgia Grande Helvetica Impact Linotype Lucida MS Monaco Neue New Palatino Roboto Roman Symbol Tahoma Times Trebuchet Verdana Webdings Wingdings York Zapf | |
1 0.000003 syn keyword cssFontAttr contained cursive fantasy monospace | |
" font-feature-settings attributes | |
1 0.000002 syn keyword cssFontAttr contained on off | |
" font-stretch attributes | |
1 0.000008 syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>" | |
" font-style attributes | |
1 0.000003 syn keyword cssFontAttr contained italic oblique | |
" font-synthesis attributes | |
1 0.000003 syn keyword cssFontAttr contained weight style | |
" font-weight attributes | |
1 0.000004 syn keyword cssFontAttr contained bold bolder lighter | |
" TODO: font-variant-* attributes | |
"------------------------------------------------ | |
" Webkit specific property/attributes | |
1 0.000011 syn match cssFontProp contained "\<font-smooth\>" | |
1 0.000108 syn match cssFontAttr contained "\<\(subpixel-\)\=\antialiased\>" | |
" CSS Multi-column Layout Module | |
" http://www.w3.org/TR/css3-multicol/ | |
1 0.000016 syn match cssMultiColumnProp contained "\<break-\(after\|before\|inside\)\>" | |
1 0.000070 syn match cssMultiColumnProp contained "\<column-\(count\|fill\|gap\|rule\(-\(color\|style\|width\)\)\=\|span\|width\)\>" | |
1 0.000006 syn keyword cssMultiColumnProp contained columns | |
1 0.000007 syn keyword cssMultiColumnAttr contained balance medium | |
1 0.000006 syn keyword cssMultiColumnAttr contained always avoid left right page column | |
1 0.000007 syn match cssMultiColumnAttr contained "\<avoid-\(page\|column\)\>" | |
" http://www.w3.org/TR/css3-break/#page-break | |
1 0.000009 syn match cssMultiColumnProp contained "\<page\(-break-\(before\|after\|inside\)\)\=\>" | |
" TODO find following items in w3c docs. | |
1 0.000007 syn keyword cssGeneratedContentProp contained quotes crop | |
1 0.000007 syn match cssGeneratedContentProp contained "\<counter-\(reset\|increment\)\>" | |
1 0.000004 syn match cssGeneratedContentProp contained "\<move-to\>" | |
1 0.000005 syn match cssGeneratedContentProp contained "\<page-policy\>" | |
1 0.000010 syn match cssGeneratedContentAttr contained "\<\(no-\)\=\(open\|close\)-quote\>" | |
1 0.000010 syn match cssGridProp contained "\<grid-\(columns\|rows\)\>" | |
1 0.000010 syn match cssHyerlinkProp contained "\<target\(-\(name\|new\|position\)\)\=\>" | |
1 0.000010 syn match cssListProp contained "\<list-style\(-\(type\|position\|image\)\)\=\>" | |
1 0.000010 syn match cssListAttr contained "\<\(lower\|upper\)-\(roman\|alpha\|greek\|latin\)\>" | |
1 0.000005 syn match cssListAttr contained "\<\(hiragana\|katakana\)\(-iroha\)\=\>" | |
1 0.000005 syn match cssListAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic\)\>" | |
1 0.000006 syn keyword cssListAttr contained disc circle square hebrew armenian georgian | |
1 0.000003 syn keyword cssListAttr contained inside outside | |
1 0.000009 syn keyword cssPositioningProp contained bottom clear clip display float left | |
1 0.000004 syn keyword cssPositioningProp contained position right top visibility | |
1 0.000005 syn match cssPositioningProp contained "\<z-index\>" | |
1 0.000007 syn keyword cssPositioningAttr contained block compact | |
1 0.000012 syn match cssPositioningAttr contained "\<table\(-\(row-group\|\(header\|footer\)-group\|row\|column\(-group\)\=\|cell\|caption\)\)\=\>" | |
1 0.000003 syn keyword cssPositioningAttr contained left right both | |
1 0.000003 syn match cssPositioningAttr contained "\<list-item\>" | |
1 0.000005 syn match cssPositioningAttr contained "\<inline\(-\(block\|box\|table\)\)\=\>" | |
1 0.000003 syn keyword cssPositioningAttr contained static relative absolute fixed | |
1 0.000006 syn keyword cssPrintAttr contained landscape portrait crop cross always avoid | |
1 0.000009 syn match cssTableProp contained "\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\)\>" | |
1 0.000006 syn keyword cssTableAttr contained fixed collapse separate show hide once always | |
1 0.000004 syn keyword cssTextProp contained color direction | |
1 0.000016 syn match cssTextProp "\<\(\(word\|letter\)-spacing\|text\(-\(decoration\|transform\|align\|index\|shadow\)\)\=\|vertical-align\|unicode-bidi\|line-height\)\>" | |
1 0.000008 syn match cssTextProp contained "\<text-\(justify\|outline\|warp\|align-last\|size-adjust\|rendering\|stroke\|indent\)\>" | |
1 0.000004 syn match cssTextProp contained "\<word-\(break\|\wrap\)\>" | |
1 0.000003 syn match cssTextProp contained "\<white-space\>" | |
1 0.000003 syn match cssTextProp contained "\<hanging-punctuation\>" | |
1 0.000003 syn match cssTextProp contained "\<punctuation-trim\>" | |
1 0.000005 syn match cssTextAttr contained "\<line-through\>" | |
1 0.000005 syn match cssTextAttr contained "\<\(text-\)\=\(top\|bottom\)\>" | |
1 0.000003 syn keyword cssTextAttr contained ltr rtl embed nowrap | |
1 0.000004 syn keyword cssTextAttr contained underline overline blink sub super middle | |
1 0.000003 syn keyword cssTextAttr contained capitalize uppercase lowercase | |
1 0.000003 syn keyword cssTextAttr contained justify baseline sub super | |
1 0.000003 syn keyword cssTextAttr contained optimizeLegibility optimizeSpeed | |
1 0.000004 syn match cssTextAttr contained "\<pre\(-\(line\|wrap\)\)\=\>" | |
1 0.000003 syn match cssTextAttr contained "\<\(allow\|force\)-end\>" | |
1 0.000003 syn keyword cssTextAttr contained start end adjacent | |
1 0.000004 syn match cssTextAttr contained "\<inter-\(word\|ideographic\|cluster\)\>" | |
1 0.000004 syn keyword cssTextAttr contained distribute kashida first last | |
1 0.000004 syn keyword cssTextAttr contained clip ellipsis unrestricted suppress | |
1 0.000003 syn match cssTextAttr contained "\<break-all\>" | |
1 0.000521 syn match cssTextAttr contained "\<break-word\>" | |
1 0.000007 syn keyword cssTextAttr contained hyphenate | |
1 0.000246 syn match cssTextAttr contained "\<bidi-override\>" | |
1 0.000250 syn match cssTransformProp contained "\<transform\(-\(origin\|style\)\)\=\>" | |
1 0.000008 syn match cssTransformProp contained "\<perspective\(-origin\)\=\>" | |
1 0.000005 syn match cssTransformProp contained "\<backface-visibility\>" | |
" CSS Transitions | |
" http://www.w3.org/TR/css3-transitions/ | |
1 0.000013 syn match cssTransitionProp contained "\<transition\(-\(delay\|duration\|property\|timing-function\)\)\=\>" | |
" transition-time-function attributes | |
1 0.000021 syn match cssTransitionAttr contained "\<linear\(-gradient\)\@!\>" | |
1 0.000006 syn match cssTransitionAttr contained "\<ease\(-\(in-out\|out\|in\)\)\=\>" | |
1 0.000005 syn match cssTransitionAttr contained "\<step\(-start\|-end\)\=\>" | |
"------------------------------------------------ | |
" CSS Basic User Interface Module Level 3 (CSS3 UI) | |
" http://www.w3.org/TR/css3-ui/ | |
1 0.000007 syn match cssUIProp contained "\<box-sizing\>" | |
1 0.000150 syn match cssUIAttr contained "\<\(content\|padding\|border\)\(-box\)\=\>" | |
1 0.000005 syn keyword cssUIProp contained cursor | |
1 0.000010 syn match cssUIAttr contained "\<\(\([ns]\=[ew]\=\)\|col\|row\|nesw\|nwse\)-resize\>" | |
1 0.000005 syn keyword cssUIAttr contained crosshair help move pointer alias copy | |
1 0.000005 syn keyword cssUIAttr contained progress wait text cell move | |
1 0.000005 syn match cssUIAttr contained "\<context-menu\>" | |
1 0.000004 syn match cssUIAttr contained "\<no-drop\>" | |
1 0.000004 syn match cssUIAttr contained "\<not-allowed\>" | |
1 0.000005 syn match cssUIAttr contained "\<all-scroll\>" | |
1 0.000005 syn match cssUIAttr contained "\<\(vertical-\)\=text\>" | |
1 0.000005 syn match cssUIAttr contained "\<zoom\(-in\|-out\)\=\>" | |
1 0.000004 syn match cssUIProp contained "\<ime-mode\>" | |
1 0.000004 syn keyword cssUIAttr contained active inactive disabled | |
1 0.000007 syn match cssUIProp contained "\<nav-\(down\|index\|left\|right\|up\)\=\>" | |
1 0.000008 syn match cssUIProp contained "\<outline\(-\(width\|style\|color\|offset\)\)\=\>" | |
1 0.000003 syn keyword cssUIAttr contained invert | |
1 0.000004 syn keyword cssUIProp contained icon resize | |
1 0.000008 syn keyword cssUIAttr contained both horizontal vertical | |
1 0.000004 syn match cssUIProp contained "\<text-overflow\>" | |
1 0.000003 syn keyword cssUIAttr contained clip ellipsis | |
" Already highlighted Props: font content | |
"------------------------------------------------ | |
" Webkit/iOS specific attributes | |
1 0.000003 syn match cssUIAttr contained '\(preserve-3d\)' | |
" IE specific attributes | |
1 0.000008 syn match cssIEUIAttr contained '\(bicubic\)' | |
" Webkit/iOS specific properties | |
1 0.000006 syn match cssUIProp contained '\(tap-highlight-color\|user-select\|touch-callout\)' | |
" IE specific properties | |
1 0.000007 syn match cssIEUIProp contained '\(interpolation-mode\|zoom\|filter\)' | |
" Webkit/Firebox specific properties/attributes | |
1 0.000002 syn keyword cssUIProp contained appearance | |
1 0.000004 syn keyword cssUIAttr contained window button field icon document menu | |
1 0.000013 syn match cssAuralProp contained "\<\(pause\|cue\)\(-\(before\|after\)\)\=\>" | |
1 0.000012 syn match cssAuralProp contained "\<\(play-during\|speech-rate\|voice-family\|pitch\(-range\)\=\|speak\(-\(punctuation\|numeral\|header\)\)\=\)\>" | |
1 0.000005 syn keyword cssAuralProp contained volume during azimuth elevation stress richness | |
1 0.000118 syn match cssAuralAttr contained "\<\(x-\)\=\(soft\|loud\)\>" | |
1 0.000004 syn keyword cssAuralAttr contained silent | |
1 0.000004 syn match cssAuralAttr contained "\<spell-out\>" | |
1 0.000003 syn keyword cssAuralAttr contained non mix | |
1 0.000004 syn match cssAuralAttr contained "\<\(left\|right\)-side\>" | |
1 0.000005 syn match cssAuralAttr contained "\<\(far\|center\)-\(left\|center\|right\)\>" | |
1 0.000003 syn keyword cssAuralAttr contained leftwards rightwards behind | |
1 0.000005 syn keyword cssAuralAttr contained below level above lower higher | |
1 0.000007 syn match cssAuralAttr contained "\<\(x-\)\=\(slow\|fast\|low\|high\)\>" | |
1 0.000004 syn keyword cssAuralAttr contained faster slower | |
1 0.000091 syn keyword cssAuralAttr contained male female child code digits continuous | |
" mobile text | |
1 0.000080 syn match cssMobileTextProp contained "\<text-size-adjust\>" | |
1 0.000006 syn match cssBraces contained "[{}]" | |
1 0.000005 syn match cssError contained "{@<>" | |
1 0.002883 syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,cssNoise fold | |
1 0.000014 syn match cssBraceError "}" | |
1 0.000008 syn match cssAttrComma "," | |
" Pseudo class | |
" http://www.w3.org/TR/css3-selectors/ | |
1 0.000043 syn match cssPseudoClass ":[A-Za-z0-9_-]*" contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn | |
1 0.000008 syn keyword cssPseudoClassId contained link visited active hover before after left right | |
1 0.000006 syn keyword cssPseudoClassId contained root empty target enable disabled checked invalid | |
1 0.000006 syn match cssPseudoClassId contained "\<first-\(line\|letter\)\>" | |
1 0.000008 syn match cssPseudoClassId contained "\<\(first\|last\|only\)-\(of-type\|child\)\>" | |
1 0.000013 syn region cssPseudoClassFn contained matchgroup=cssFunctionName start="\<\(not\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(" end=")" | |
" ------------------------------------ | |
" Vendor specific properties | |
1 0.000004 syn match cssPseudoClassId contained "\<selection\>" | |
1 0.000005 syn match cssPseudoClassId contained "\<focus\(-inner\)\=\>" | |
1 0.000008 syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>" | |
" Misc highlight groups | |
1 0.000077 syntax match cssUnitDecorators /\(#\|-\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|ch\|rem\|vh\|vw\|vmin\|vmax\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)/ contained | |
1 0.000005 syntax match cssNoise contained /\(:\|;\|\/\)/ | |
" Comment | |
1 0.000008 syn region cssComment start="/\*" end="\*/" contains=@Spell fold | |
1 0.000007 syn match cssUnicodeEscape "\\\x\{1,6}\s\?" | |
1 0.000006 syn match cssSpecialCharQQ +\\\\\|\\"+ contained | |
1 0.000063 syn match cssSpecialCharQ +\\\\\|\\'+ contained | |
1 0.000050 syn region cssStringQQ start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cssUnicodeEscape,cssSpecialCharQQ | |
1 0.000015 syn region cssStringQ start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=cssUnicodeEscape,cssSpecialCharQ | |
" Vendor Prefix | |
1 0.000006 syn match cssVendor contained "\(-\(webkit\|moz\|o\|ms\)-\)" | |
" Various CSS Hack characters | |
" In earlier versions of IE (6 and 7), one can prefix property names | |
" with a _ or * to isolate those definitions to particular versions of IE | |
" This is purely decorative and therefore we assign to the same highlight | |
" group to cssVendor, for more information: | |
" http://www.paulirish.com/2009/browser-specific-css-hacks/ | |
1 0.000004 syn match cssHacks contained /\(_\|*\)/ | |
" Attr Enhance | |
" Some keywords are both Prop and Attr, so we have to handle them | |
1 0.000823 syn region cssAttrRegion start=/:/ end=/\ze\(;\|)\|}\)/ contained contains=css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise | |
" Hack for transition | |
" 'transition' has Props after ':'. | |
1 0.001195 syn region cssAttrRegion start=/transition\s*:/ end=/\ze\(;\|)\|}\)/ contained contains=css.*Prop,css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise | |
1 0.000009 if main_syntax == "css" | |
syn sync minlines=10 | |
endif | |
" Define the default highlighting. | |
" Only when an item doesn't have highlighting yet | |
1 0.000019 hi def link cssComment Comment | |
1 0.000004 hi def link cssVendor Comment | |
1 0.000009 hi def link cssHacks Comment | |
1 0.000004 hi def link cssTagName Statement | |
1 0.000006 hi def link cssDeprecated Error | |
1 0.000004 hi def link cssSelectorOp Special | |
1 0.000004 hi def link cssSelectorOp2 Special | |
1 0.000003 hi def link cssAttrComma Special | |
1 0.000004 hi def link cssAnimationProp cssProp | |
1 0.000002 hi def link cssBackgroundProp cssProp | |
1 0.000002 hi def link cssBorderProp cssProp | |
1 0.000002 hi def link cssBoxProp cssProp | |
1 0.000002 hi def link cssColorProp cssProp | |
1 0.000004 hi def link cssContentForPagedMediaProp cssProp | |
1 0.000002 hi def link cssDimensionProp cssProp | |
1 0.000002 hi def link cssFlexibleBoxProp cssProp | |
1 0.000002 hi def link cssFontProp cssProp | |
1 0.000002 hi def link cssGeneratedContentProp cssProp | |
1 0.000002 hi def link cssGridProp cssProp | |
1 0.000002 hi def link cssHyerlinkProp cssProp | |
1 0.000004 hi def link cssLineboxProp cssProp | |
1 0.000002 hi def link cssListProp cssProp | |
1 0.000004 hi def link cssMarqueeProp cssProp | |
1 0.000002 hi def link cssMultiColumnProp cssProp | |
1 0.000004 hi def link cssPagedMediaProp cssProp | |
1 0.000002 hi def link cssPositioningProp cssProp | |
1 0.000004 hi def link cssPrintProp cssProp | |
1 0.000004 hi def link cssRubyProp cssProp | |
1 0.000004 hi def link cssSpeechProp cssProp | |
1 0.000002 hi def link cssTableProp cssProp | |
1 0.000002 hi def link cssTextProp cssProp | |
1 0.000002 hi def link cssTransformProp cssProp | |
1 0.000002 hi def link cssTransitionProp cssProp | |
1 0.000002 hi def link cssUIProp cssProp | |
1 0.000002 hi def link cssIEUIProp cssProp | |
1 0.000002 hi def link cssAuralProp cssProp | |
1 0.000030 hi def link cssRenderProp cssProp | |
1 0.000003 hi def link cssMobileTextProp cssProp | |
1 0.000005 hi def link cssAnimationAttr cssAttr | |
1 0.000002 hi def link cssBackgroundAttr cssAttr | |
1 0.000002 hi def link cssBorderAttr cssAttr | |
1 0.000002 hi def link cssBoxAttr cssAttr | |
1 0.000004 hi def link cssContentForPagedMediaAttr cssAttr | |
1 0.000004 hi def link cssDimensionAttr cssAttr | |
1 0.000002 hi def link cssFlexibleBoxAttr cssAttr | |
1 0.000002 hi def link cssFontAttr cssAttr | |
1 0.000002 hi def link cssGeneratedContentAttr cssAttr | |
1 0.000004 hi def link cssGridAttr cssAttr | |
1 0.000004 hi def link cssHyerlinkAttr cssAttr | |
1 0.000004 hi def link cssLineboxAttr cssAttr | |
1 0.000002 hi def link cssListAttr cssAttr | |
1 0.000004 hi def link cssMarginAttr cssAttr | |
1 0.000004 hi def link cssMarqueeAttr cssAttr | |
1 0.000002 hi def link cssMultiColumnAttr cssAttr | |
1 0.000004 hi def link cssPaddingAttr cssAttr | |
1 0.000004 hi def link cssPagedMediaAttr cssAttr | |
1 0.000002 hi def link cssPositioningAttr cssAttr | |
1 0.000002 hi def link cssGradientAttr cssAttr | |
1 0.000002 hi def link cssPrintAttr cssAttr | |
1 0.000004 hi def link cssRubyAttr cssAttr | |
1 0.000004 hi def link cssSpeechAttr cssAttr | |
1 0.000002 hi def link cssTableAttr cssAttr | |
1 0.000002 hi def link cssTextAttr cssAttr | |
1 0.000006 hi def link cssTransformAttr cssAttr | |
1 0.000002 hi def link cssTransitionAttr cssAttr | |
1 0.000002 hi def link cssUIAttr cssAttr | |
1 0.000002 hi def link cssIEUIAttr cssAttr | |
1 0.000002 hi def link cssAuralAttr cssAttr | |
1 0.000004 hi def link cssRenderAttr cssAttr | |
1 0.000002 hi def link cssCommonAttr cssAttr | |
1 0.000004 hi def link cssPseudoClassId PreProc | |
1 0.000006 hi def link cssPseudoClassLang Constant | |
1 0.000004 hi def link cssValueLength Number | |
1 0.000004 hi def link cssValueInteger Number | |
1 0.000004 hi def link cssValueNumber Number | |
1 0.000004 hi def link cssValueAngle Number | |
1 0.000004 hi def link cssValueTime Number | |
1 0.000004 hi def link cssValueFrequency Number | |
1 0.000004 hi def link cssFunction Constant | |
1 0.000004 hi def link cssURL String | |
1 0.000004 hi def link cssFunctionName Function | |
1 0.000004 hi def link cssFunctionComma Function | |
1 0.000004 hi def link cssColor Constant | |
1 0.000004 hi def link cssIdentifier Function | |
1 0.000004 hi def link cssInclude Include | |
1 0.000005 hi def link cssIncludeKeyword atKeyword | |
1 0.000027 hi def link cssImportant Special | |
1 0.000006 hi def link cssBraces Function | |
1 0.000004 hi def link cssBraceError Error | |
1 0.000004 hi def link cssError Error | |
1 0.000004 hi def link cssUnicodeEscape Special | |
1 0.000004 hi def link cssStringQQ String | |
1 0.000004 hi def link cssStringQ String | |
1 0.000004 hi def link cssAttributeSelector String | |
1 0.000006 hi def link cssMedia atKeyword | |
1 0.000013 hi def link cssMediaType Special | |
1 0.000005 hi def link cssMediaComma Normal | |
1 0.000004 hi def link cssMediaKeyword Statement | |
1 0.000003 hi def link cssMediaProp cssProp | |
1 0.000003 hi def link cssMediaAttr cssAttr | |
1 0.000002 hi def link cssPage atKeyword | |
1 0.000005 hi def link cssPagePseudo PreProc | |
1 0.000002 hi def link cssPageMargin atKeyword | |
1 0.000002 hi def link cssPageProp cssProp | |
1 0.000002 hi def link cssKeyFrame atKeyword | |
1 0.000005 hi def link cssKeyFrameSelector Constant | |
1 0.000004 hi def link cssFontDescriptor Special | |
1 0.000004 hi def link cssFontDescriptorFunction Constant | |
1 0.000002 hi def link cssFontDescriptorProp cssProp | |
1 0.000002 hi def link cssFontDescriptorAttr cssAttr | |
1 0.000005 hi def link cssUnicodeRange Constant | |
1 0.000004 hi def link cssClassName Function | |
1 0.000004 hi def link cssClassNameDot Function | |
1 0.000004 hi def link cssProp StorageClass | |
1 0.000004 hi def link cssAttr Constant | |
1 0.000005 hi def link cssUnitDecorators Number | |
1 0.000005 hi def link cssNoise Noise | |
1 0.000004 hi def link atKeyword PreProc | |
1 0.000007 let b:current_syntax = "css" | |
1 0.000005 if main_syntax == 'css' | |
unlet main_syntax | |
endif | |
1 0.000014 let &cpo = s:cpo_save | |
1 0.000004 unlet s:cpo_save | |
" vim: ts=8 | |
SCRIPT /usr/share/nvim/runtime/syntax/sql.vim | |
Sourced 1 time | |
Total time: 0.002023 | |
Self time: 0.001375 | |
count total (s) self (s) | |
" Vim syntax file loader | |
" Language: SQL | |
" Maintainer: David Fishburn <fishburn at ianywhere dot com> | |
" Last Change: Thu Sep 15 2005 10:30:02 AM | |
" Version: 1.0 | |
" Description: Checks for a: | |
" buffer local variable, | |
" global variable, | |
" If the above exist, it will source the type specified. | |
" If none exist, it will source the default sql.vim file. | |
" | |
" quit when a syntax file was already loaded | |
1 0.000010 if exists("b:current_syntax") | |
finish | |
endif | |
" Default to the standard Vim distribution file | |
1 0.000004 let filename = 'sqloracle' | |
" Check for overrides. Buffer variables have the highest priority. | |
1 0.000004 if exists("b:sql_type_override") | |
" Check the runtimepath to see if the file exists | |
if globpath(&runtimepath, 'syntax/'.b:sql_type_override.'.vim') != '' | |
let filename = b:sql_type_override | |
endif | |
elseif exists("g:sql_type_default") | |
if globpath(&runtimepath, 'syntax/'.g:sql_type_default.'.vim') != '' | |
let filename = g:sql_type_default | |
endif | |
endif | |
" Source the appropriate file | |
1 0.001312 exec 'runtime syntax/'.filename.'.vim' | |
" vim:sw=4: | |
SCRIPT /usr/share/nvim/runtime/syntax/sqloracle.vim | |
Sourced 1 time | |
Total time: 0.000629 | |
Self time: 0.000629 | |
count total (s) self (s) | |
" Vim syntax file | |
" Language: SQL, PL/SQL (Oracle 11g) | |
" Maintainer: Christian Brabandt | |
" Repository: https://github.com/chrisbra/vim-sqloracle-syntax | |
" License: Vim | |
" Previous Maintainer: Paul Moore | |
" Last Change: 2016 Jul 22 | |
" Changes: | |
" 02.04.2016: Support for when keyword | |
" 03.04.2016: Support for join related keywords | |
" 22.07.2016: Support Oracle Q-Quote-Syntax | |
1 0.000014 if exists("b:current_syntax") | |
finish | |
endif | |
1 0.000003 syn case ignore | |
" The SQL reserved words, defined as keywords. | |
1 0.000014 syn keyword sqlSpecial false null true | |
1 0.000013 syn keyword sqlKeyword access add as asc begin by case check cluster column | |
1 0.000008 syn keyword sqlKeyword cache compress connect current cursor decimal default desc | |
1 0.000007 syn keyword sqlKeyword else elsif end exception exclusive file for from | |
1 0.000005 syn keyword sqlKeyword function group having identified if immediate increment | |
1 0.000006 syn keyword sqlKeyword index initial initrans into is level link logging loop | |
1 0.000004 syn keyword sqlKeyword maxextents maxtrans mode modify monitoring | |
1 0.000007 syn keyword sqlKeyword nocache nocompress nologging noparallel nowait of offline on online start | |
1 0.000006 syn keyword sqlKeyword parallel successful synonym table tablespace then to trigger uid | |
1 0.000004 syn keyword sqlKeyword unique user validate values view when whenever | |
1 0.000006 syn keyword sqlKeyword where with option order pctfree pctused privileges procedure | |
1 0.000005 syn keyword sqlKeyword public resource return row rowlabel rownum rows | |
1 0.000005 syn keyword sqlKeyword session share size smallint type using | |
1 0.000004 syn keyword sqlKeyword join cross inner outer left right | |
1 0.000006 syn keyword sqlOperator not and or | |
1 0.000005 syn keyword sqlOperator in any some all between exists | |
1 0.000002 syn keyword sqlOperator like escape | |
1 0.000002 syn keyword sqlOperator union intersect minus | |
1 0.000002 syn keyword sqlOperator prior distinct | |
1 0.000002 syn keyword sqlOperator sysdate out | |
1 0.000005 syn keyword sqlStatement analyze audit comment commit | |
1 0.000005 syn keyword sqlStatement delete drop execute explain grant lock noaudit | |
1 0.000003 syn keyword sqlStatement rename revoke rollback savepoint set | |
1 0.000002 syn keyword sqlStatement truncate | |
" next ones are contained, so folding works. | |
1 0.000004 syn keyword sqlStatement create update alter select insert contained | |
1 0.000006 syn keyword sqlType boolean char character date float integer long | |
1 0.000004 syn keyword sqlType mlslabel number raw rowid varchar varchar2 varray | |
" Strings: | |
1 0.000014 syn region sqlString matchgroup=Quote start=+"+ skip=+\\\\\|\\"+ end=+"+ | |
1 0.000007 syn region sqlString matchgroup=Quote start=+'+ skip=+\\\\\|\\'+ end=+'+ | |
1 0.000007 syn region sqlString matchgroup=Quote start=+n\?q'\z([^[(<{]\)+ end=+\z1'+ | |
1 0.000006 syn region sqlString matchgroup=Quote start=+n\?q'<+ end=+>'+ | |
1 0.000005 syn region sqlString matchgroup=Quote start=+n\?q'{+ end=+}'+ | |
1 0.000027 syn region sqlString matchgroup=Quote start=+n\?q'(+ end=+)'+ | |
1 0.000005 syn region sqlString matchgroup=Quote start=+n\?q'\[+ end=+]'+ | |
" Numbers: | |
1 0.000007 syn match sqlNumber "-\=\<\d*\.\=[0-9_]\>" | |
" Comments: | |
1 0.000010 syn region sqlComment start="/\*" end="\*/" contains=sqlTodo,@Spell fold | |
1 0.000005 syn match sqlComment "--.*$" contains=sqlTodo,@Spell | |
" Setup Folding: | |
" this is a hack, to get certain statements folded. | |
" the keywords create/update/alter/select/insert need to | |
" have contained option. | |
1 0.000013 syn region sqlFold start='^\s*\zs\c\(Create\|Update\|Alter\|Select\|Insert\)' end=';$\|^$' transparent fold contains=ALL | |
1 0.000002 syn sync ccomment sqlComment | |
" Functions: | |
" (Oracle 11g) | |
" Aggregate Functions | |
1 0.000015 syn keyword sqlFunction avg collect corr corr_s corr_k count covar_pop covar_samp cume_dist dense_rank first | |
1 0.000007 syn keyword sqlFunction group_id grouping grouping_id last max median min percentile_cont percentile_disc percent_rank rank | |
1 0.000005 syn keyword sqlFunction regr_slope regr_intercept regr_count regr_r2 regr_avgx regr_avgy regr_sxx regr_syy regr_sxy | |
1 0.000005 syn keyword sqlFunction stats_binomial_test stats_crosstab stats_f_test stats_ks_test stats_mode stats_mw_test | |
1 0.000006 syn keyword sqlFunction stats_one_way_anova stats_t_test_one stats_t_test_paired stats_t_test_indep stats_t_test_indepu | |
1 0.000004 syn keyword sqlFunction stats_wsr_test stddev stddev_pop stddev_samp sum | |
1 0.000004 syn keyword sqlFunction sys_xmlagg var_pop var_samp variance xmlagg | |
" Char Functions | |
1 0.000006 syn keyword sqlFunction ascii chr concat initcap instr length lower lpad ltrim | |
1 0.000006 syn keyword sqlFunction nls_initcap nls_lower nlssort nls_upper regexp_instr regexp_replace | |
1 0.000008 syn keyword sqlFunction regexp_substr replace rpad rtrim soundex substr translate treat trim upper | |
" Comparison Functions | |
1 0.000004 syn keyword sqlFunction greatest least | |
" Conversion Functions | |
1 0.000007 syn keyword sqlFunction asciistr bin_to_num cast chartorowid compose convert | |
1 0.000007 syn keyword sqlFunction decompose hextoraw numtodsinterval numtoyminterval rawtohex rawtonhex rowidtochar | |
1 0.000009 syn keyword sqlFunction rowidtonchar scn_to_timestamp timestamp_to_scn to_binary_double to_binary_float | |
1 0.000008 syn keyword sqlFunction to_char to_char to_char to_clob to_date to_dsinterval to_lob to_multi_byte | |
1 0.000007 syn keyword sqlFunction to_nchar to_nchar to_nchar to_nclob to_number to_dsinterval to_single_byte | |
1 0.000006 syn keyword sqlFunction to_timestamp to_timestamp_tz to_yminterval to_yminterval translate unistr | |
" DataMining Functions | |
1 0.000005 syn keyword sqlFunction cluster_id cluster_probability cluster_set feature_id feature_set | |
1 0.000004 syn keyword sqlFunction feature_value prediction prediction_bounds prediction_cost | |
1 0.000004 syn keyword sqlFunction prediction_details prediction_probability prediction_set | |
" Datetime Functions | |
1 0.000005 syn keyword sqlFunction add_months current_date current_timestamp dbtimezone extract | |
1 0.000004 syn keyword sqlFunction from_tz last_day localtimestamp months_between new_time | |
1 0.000005 syn keyword sqlFunction next_day numtodsinterval numtoyminterval round sessiontimezone | |
1 0.000005 syn keyword sqlFunction sys_extract_utc sysdate systimestamp to_char to_timestamp | |
1 0.000005 syn keyword sqlFunction to_timestamp_tz to_dsinterval to_yminterval trunc tz_offset | |
" Numeric Functions | |
1 0.000026 syn keyword sqlFunction abs acos asin atan atan2 bitand ceil cos cosh exp | |
1 0.000006 syn keyword sqlFunction floor ln log mod nanvl power remainder round sign | |
1 0.000005 syn keyword sqlFunction sin sinh sqrt tan tanh trunc width_bucket | |
" NLS Functions | |
1 0.000005 syn keyword sqlFunction ls_charset_decl_len nls_charset_id nls_charset_name | |
" Various Functions | |
1 0.000006 syn keyword sqlFunction bfilename cardin coalesce collect decode dump empty_blob empty_clob | |
1 0.000005 syn keyword sqlFunction lnnvl nullif nvl nvl2 ora_hash powermultiset powermultiset_by_cardinality | |
1 0.000006 syn keyword sqlFunction sys_connect_by_path sys_context sys_guid sys_typeid uid user userenv vsizeality | |
" XML Functions | |
1 0.000005 syn keyword sqlFunction appendchildxml deletexml depth extract existsnode extractvalue insertchildxml | |
1 0.000006 syn keyword sqlFunction insertxmlbefore path sys_dburigen sys_xmlagg sys_xmlgen updatexml xmlagg xmlcast | |
1 0.000005 syn keyword sqlFunction xmlcdata xmlcolattval xmlcomment xmlconcat xmldiff xmlelement xmlexists xmlforest | |
1 0.000005 syn keyword sqlFunction xmlparse xmlpatch xmlpi xmlquery xmlroot xmlsequence xmlserialize xmltable xmltransform | |
" Todo: | |
1 0.000004 syn keyword sqlTodo TODO FIXME XXX DEBUG NOTE contained | |
" Define the default highlighting. | |
1 0.000024 hi def link Quote Special | |
1 0.000004 hi def link sqlComment Comment | |
1 0.000003 hi def link sqlFunction Function | |
1 0.000002 hi def link sqlKeyword sqlSpecial | |
1 0.000003 hi def link sqlNumber Number | |
1 0.000002 hi def link sqlOperator sqlStatement | |
1 0.000003 hi def link sqlSpecial Special | |
1 0.000003 hi def link sqlStatement Statement | |
1 0.000003 hi def link sqlString String | |
1 0.000003 hi def link sqlType Type | |
1 0.000003 hi def link sqlTodo Todo | |
1 0.000004 let b:current_syntax = "sql" | |
" vim: ts=8 | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale/events.vim | |
Sourced 1 time | |
Total time: 0.000062 | |
Self time: 0.000062 | |
count total (s) self (s) | |
" Author: w0rp <devw0rp@gmail.com> | |
1 0.000007 function! ale#events#SaveEvent(buffer) abort | |
call setbufvar(a:buffer, 'ale_save_event_fired', 1) | |
let l:should_lint = ale#Var(a:buffer, 'enabled') && g:ale_lint_on_save | |
if g:ale_fix_on_save | |
let l:will_fix = ale#fix#Fix('save_file') | |
let l:should_lint = l:should_lint && !l:will_fix | |
endif | |
if l:should_lint | |
call ale#Queue(0, 'lint_file', a:buffer) | |
endif | |
endfunction | |
1 0.000005 function! s:LintOnEnter(buffer) abort | |
if ale#Var(a:buffer, 'enabled') | |
\&& g:ale_lint_on_enter | |
\&& has_key(b:, 'ale_file_changed') | |
call remove(b:, 'ale_file_changed') | |
call ale#Queue(0, 'lint_file', a:buffer) | |
endif | |
endfunction | |
1 0.000002 function! ale#events#EnterEvent(buffer) abort | |
let l:filetype = getbufvar(a:buffer, '&filetype') | |
call setbufvar(a:buffer, 'ale_original_filetype', l:filetype) | |
call s:LintOnEnter(a:buffer) | |
endfunction | |
1 0.000003 function! ale#events#FileTypeEvent(buffer, new_filetype) abort | |
let l:filetype = getbufvar(a:buffer, 'ale_original_filetype', '') | |
" If we're setting the filetype for the first time after it was blank, | |
" and the option for linting on enter is off, then we should set this | |
" filetype as the original filetype. Otherwise ALE will still appear to | |
" lint files because of the BufEnter event, etc. | |
if empty(l:filetype) && !ale#Var(a:buffer, 'lint_on_enter') | |
call setbufvar(a:buffer, 'ale_original_filetype', a:new_filetype) | |
elseif a:new_filetype isnot# l:filetype | |
call ale#Queue(300, 'lint_file', a:buffer) | |
endif | |
endfunction | |
1 0.000002 function! ale#events#FileChangedEvent(buffer) abort | |
call setbufvar(a:buffer, 'ale_file_changed', 1) | |
if bufnr('') == a:buffer | |
call s:LintOnEnter(a:buffer) | |
endif | |
endfunction | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale/util.vim | |
Sourced 1 time | |
Total time: 0.000210 | |
Self time: 0.000210 | |
count total (s) self (s) | |
" Author: w0rp <devw0rp@gmail.com> | |
" Description: Contains miscellaneous functions | |
" A wrapper function for mode() so we can test calls for it. | |
1 0.000006 function! ale#util#Mode(...) abort | |
return call('mode', a:000) | |
endfunction | |
" A wrapper function for feedkeys so we can test calls for it. | |
1 0.000002 function! ale#util#FeedKeys(...) abort | |
return call('feedkeys', a:000) | |
endfunction | |
1 0.000005 if !exists('g:ale#util#nul_file') | |
" A null file for sending output to nothing. | |
1 0.000003 let g:ale#util#nul_file = '/dev/null' | |
1 0.000009 if has('win32') | |
let g:ale#util#nul_file = 'nul' | |
endif | |
1 0.000001 endif | |
" Return the number of lines for a given buffer. | |
1 0.000002 function! ale#util#GetLineCount(buffer) abort | |
return len(getbufline(a:buffer, 1, '$')) | |
endfunction | |
1 0.000002 function! ale#util#GetFunction(string_or_ref) abort | |
if type(a:string_or_ref) == type('') | |
return function(a:string_or_ref) | |
endif | |
return a:string_or_ref | |
endfunction | |
" Compare two loclist items for ALE, sorted by their buffers, filenames, and | |
" line numbers and column numbers. | |
1 0.000002 function! ale#util#LocItemCompare(left, right) abort | |
if a:left.bufnr < a:right.bufnr | |
return -1 | |
endif | |
if a:left.bufnr > a:right.bufnr | |
return 1 | |
endif | |
if a:left.bufnr == -1 | |
if a:left.filename < a:right.filename | |
return -1 | |
endif | |
if a:left.filename > a:right.filename | |
return 1 | |
endif | |
endif | |
if a:left.lnum < a:right.lnum | |
return -1 | |
endif | |
if a:left.lnum > a:right.lnum | |
return 1 | |
endif | |
if a:left.col < a:right.col | |
return -1 | |
endif | |
if a:left.col > a:right.col | |
return 1 | |
endif | |
return 0 | |
endfunction | |
" Compare two loclist items, including the text for the items. | |
" | |
" This function can be used for de-duplicating lists. | |
1 0.000002 function! ale#util#LocItemCompareWithText(left, right) abort | |
let l:cmp_value = ale#util#LocItemCompare(a:left, a:right) | |
if l:cmp_value | |
return l:cmp_value | |
endif | |
if a:left.text < a:right.text | |
return -1 | |
endif | |
if a:left.text > a:right.text | |
return 1 | |
endif | |
return 0 | |
endfunction | |
" This function will perform a binary search and a small sequential search | |
" on the list to find the last problem in the buffer and line which is | |
" on or before the column. The index of the problem will be returned. | |
" | |
" -1 will be returned if nothing can be found. | |
1 0.000002 function! ale#util#BinarySearch(loclist, buffer, line, column) abort | |
let l:min = 0 | |
let l:max = len(a:loclist) - 1 | |
while 1 | |
if l:max < l:min | |
return -1 | |
endif | |
let l:mid = (l:min + l:max) / 2 | |
let l:item = a:loclist[l:mid] | |
" Binary search for equal buffers, equal lines, then near columns. | |
if l:item.bufnr < a:buffer | |
let l:min = l:mid + 1 | |
elseif l:item.bufnr > a:buffer | |
let l:max = l:mid - 1 | |
elseif l:item.lnum < a:line | |
let l:min = l:mid + 1 | |
elseif l:item.lnum > a:line | |
let l:max = l:mid - 1 | |
else | |
" This part is a small sequential search. | |
let l:index = l:mid | |
" Search backwards to find the first problem on the line. | |
while l:index > 0 | |
\&& a:loclist[l:index - 1].bufnr == a:buffer | |
\&& a:loclist[l:index - 1].lnum == a:line | |
let l:index -= 1 | |
endwhile | |
" Find the last problem on or before this column. | |
while l:index < l:max | |
\&& a:loclist[l:index + 1].bufnr == a:buffer | |
\&& a:loclist[l:index + 1].lnum == a:line | |
\&& a:loclist[l:index + 1].col <= a:column | |
let l:index += 1 | |
endwhile | |
return l:index | |
endif | |
endwhile | |
endfunction | |
" A function for testing if a function is running inside a sandbox. | |
" See :help sandbox | |
1 0.000001 function! ale#util#InSandbox() abort | |
try | |
function! s:SandboxCheck() abort | |
endfunction | |
catch /^Vim\%((\a\+)\)\=:E48/ | |
" E48 is the sandbox error. | |
return 1 | |
endtry | |
return 0 | |
endfunction | |
" Get the number of milliseconds since some vague, but consistent, point in | |
" the past. | |
" | |
" This function can be used for timing execution, etc. | |
" | |
" The time will be returned as a Number. | |
1 0.000002 function! ale#util#ClockMilliseconds() abort | |
return float2nr(reltimefloat(reltime()) * 1000) | |
endfunction | |
" Given a single line, or a List of lines, and a single pattern, or a List | |
" of patterns, return all of the matches for the lines(s) from the given | |
" patterns, using matchlist(). | |
" | |
" Only the first pattern which matches a line will be returned. | |
1 0.000002 function! ale#util#GetMatches(lines, patterns) abort | |
let l:matches = [] | |
let l:lines = type(a:lines) == type([]) ? a:lines : [a:lines] | |
let l:patterns = type(a:patterns) == type([]) ? a:patterns : [a:patterns] | |
for l:line in l:lines | |
for l:pattern in l:patterns | |
let l:match = matchlist(l:line, l:pattern) | |
if !empty(l:match) | |
call add(l:matches, l:match) | |
break | |
endif | |
endfor | |
endfor | |
return l:matches | |
endfunction | |
1 0.000003 function! s:LoadArgCount(function) abort | |
let l:Function = a:function | |
redir => l:output | |
silent! function Function | |
redir END | |
if !exists('l:output') | |
return 0 | |
endif | |
let l:match = matchstr(split(l:output, "\n")[0], '\v\([^)]+\)')[1:-2] | |
let l:arg_list = filter(split(l:match, ', '), 'v:val isnot# ''...''') | |
return len(l:arg_list) | |
endfunction | |
" Given the name of a function, a Funcref, or a lambda, return the number | |
" of named arguments for a function. | |
1 0.000002 function! ale#util#FunctionArgCount(function) abort | |
let l:Function = ale#util#GetFunction(a:function) | |
let l:count = s:LoadArgCount(l:Function) | |
" If we failed to get the count, forcibly load the autoload file, if the | |
" function is an autoload function. autoload functions aren't normally | |
" defined until they are called. | |
if l:count == 0 | |
let l:function_name = matchlist(string(l:Function), 'function([''"]\(.\+\)[''"])')[1] | |
if l:function_name =~# '#' | |
execute 'runtime autoload/' . join(split(l:function_name, '#')[:-2], '/') . '.vim' | |
let l:count = s:LoadArgCount(l:Function) | |
endif | |
endif | |
return l:count | |
endfunction | |
" Escape a string so the characters in it will be safe for use inside of PCRE | |
" or RE2 regular expressions without characters having special meanings. | |
1 0.000002 function! ale#util#EscapePCRE(unsafe_string) abort | |
return substitute(a:unsafe_string, '\([\-\[\]{}()*+?.^$|]\)', '\\\1', 'g') | |
endfunction | |
" Given a String or a List of String values, try and decode the string(s) | |
" as a JSON value which can be decoded with json_decode. If the JSON string | |
" is invalid, the default argument value will be returned instead. | |
" | |
" This function is useful in code where the data can't be trusted to be valid | |
" JSON, and where throwing exceptions is mostly just irritating. | |
1 0.000002 function! ale#util#FuzzyJSONDecode(data, default) abort | |
if empty(a:data) | |
return a:default | |
endif | |
let l:str = type(a:data) == type('') ? a:data : join(a:data, '') | |
try | |
return json_decode(l:str) | |
catch /E474/ | |
return a:default | |
endtry | |
endfunction | |
" Write a file, including carriage return characters for DOS files. | |
" | |
" The buffer number is required for determining the fileformat setting for | |
" the buffer. | |
1 0.000002 function! ale#util#Writefile(buffer, lines, filename) abort | |
let l:corrected_lines = getbufvar(a:buffer, '&fileformat') is# 'dos' | |
\ ? map(copy(a:lines), 'v:val . "\r"') | |
\ : a:lines | |
call writefile(l:corrected_lines, a:filename) " no-custom-checks | |
endfunction | |
1 0.000002 if !exists('s:patial_timers') | |
1 0.000003 let s:partial_timers = {} | |
1 0.000001 endif | |
1 0.000002 function! s:ApplyPartialTimer(timer_id) abort | |
let [l:Callback, l:args] = remove(s:partial_timers, a:timer_id) | |
call call(l:Callback, [a:timer_id] + l:args) | |
endfunction | |
" Given a delay, a callback, a List of arguments, start a timer with | |
" timer_start() and call the callback provided with [timer_id] + args. | |
" | |
" The timer must not be stopped with timer_stop(). | |
" Use ale#util#StopPartialTimer() instead, which can stop any timer, and will | |
" clear any arguments saved for executing callbacks later. | |
1 0.000002 function! ale#util#StartPartialTimer(delay, callback, args) abort | |
let l:timer_id = timer_start(a:delay, function('s:ApplyPartialTimer')) | |
let s:partial_timers[l:timer_id] = [a:callback, a:args] | |
return l:timer_id | |
endfunction | |
1 0.000002 function! ale#util#StopPartialTimer(timer_id) abort | |
call timer_stop(a:timer_id) | |
if has_key(s:partial_timers, a:timer_id) | |
call remove(s:partial_timers, a:timer_id) | |
endif | |
endfunction | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale/linter.vim | |
Sourced 1 time | |
Total time: 0.000291 | |
Self time: 0.000291 | |
count total (s) self (s) | |
" Author: w0rp <devw0rp@gmail.com> | |
" Description: Linter registration and lazy-loading | |
" Retrieves linters as requested by the engine, loading them if needed. | |
1 0.000007 let s:linters = {} | |
" Default filetype aliases. | |
" The user defined aliases will be merged with this Dictionary. | |
1 0.000008 let s:default_ale_linter_aliases = { | |
\ 'Dockerfile': 'dockerfile', | |
\ 'csh': 'sh', | |
\ 'plaintex': 'tex', | |
\ 'systemverilog': 'verilog', | |
\ 'zsh': 'sh', | |
\} | |
" Default linters to run for particular filetypes. | |
" The user defined linter selections will be merged with this Dictionary. | |
" | |
" No linters are used for plaintext files by default. | |
" | |
" Only cargo is enabled for Rust by default. | |
" rpmlint is disabled by default because it can result in code execution. | |
1 0.000010 let s:default_ale_linters = { | |
\ 'csh': ['shell'], | |
\ 'go': ['gofmt', 'golint', 'go vet'], | |
\ 'help': [], | |
\ 'python': ['flake8', 'mypy', 'pylint'], | |
\ 'rust': ['cargo'], | |
\ 'spec': [], | |
\ 'text': [], | |
\ 'zsh': ['shell'], | |
\} | |
" Testing/debugging helper to unload all linters. | |
1 0.000005 function! ale#linter#Reset() abort | |
let s:linters = {} | |
endfunction | |
1 0.000004 function! s:IsCallback(value) abort | |
return type(a:value) == type('') || type(a:value) == type(function('type')) | |
endfunction | |
1 0.000002 function! s:IsBoolean(value) abort | |
return type(a:value) == type(0) && (a:value == 0 || a:value == 1) | |
endfunction | |
1 0.000002 function! ale#linter#PreProcess(linter) abort | |
if type(a:linter) != type({}) | |
throw 'The linter object must be a Dictionary' | |
endif | |
let l:obj = { | |
\ 'add_newline': get(a:linter, 'add_newline', 0), | |
\ 'name': get(a:linter, 'name'), | |
\ 'lsp': get(a:linter, 'lsp', ''), | |
\} | |
if type(l:obj.name) != type('') | |
throw '`name` must be defined to name the linter' | |
endif | |
let l:needs_address = l:obj.lsp is# 'socket' | |
let l:needs_executable = l:obj.lsp isnot# 'socket' | |
let l:needs_command = l:obj.lsp isnot# 'socket' | |
let l:needs_lsp_details = !empty(l:obj.lsp) | |
if empty(l:obj.lsp) | |
let l:obj.callback = get(a:linter, 'callback') | |
if !s:IsCallback(l:obj.callback) | |
throw '`callback` must be defined with a callback to accept output' | |
endif | |
endif | |
if index(['', 'socket', 'stdio', 'tsserver'], l:obj.lsp) < 0 | |
throw '`lsp` must be either `''lsp''` or `''tsserver''` if defined' | |
endif | |
if !l:needs_executable | |
if has_key(a:linter, 'executable') | |
\|| has_key(a:linter, 'executable_callback') | |
throw '`executable` and `executable_callback` cannot be used when lsp == ''socket''' | |
endif | |
elseif has_key(a:linter, 'executable_callback') | |
let l:obj.executable_callback = a:linter.executable_callback | |
if !s:IsCallback(l:obj.executable_callback) | |
throw '`executable_callback` must be a callback if defined' | |
endif | |
elseif has_key(a:linter, 'executable') | |
let l:obj.executable = a:linter.executable | |
if type(l:obj.executable) != type('') | |
throw '`executable` must be a string if defined' | |
endif | |
else | |
throw 'Either `executable` or `executable_callback` must be defined' | |
endif | |
if !l:needs_command | |
if has_key(a:linter, 'command') | |
\|| has_key(a:linter, 'command_callback') | |
\|| has_key(a:linter, 'command_chain') | |
throw '`command` and `command_callback` and `command_chain` cannot be used when lsp == ''socket''' | |
endif | |
elseif has_key(a:linter, 'command_chain') | |
let l:obj.command_chain = a:linter.command_chain | |
if type(l:obj.command_chain) != type([]) | |
throw '`command_chain` must be a List' | |
endif | |
if empty(l:obj.command_chain) | |
throw '`command_chain` must contain at least one item' | |
endif | |
let l:link_index = 0 | |
for l:link in l:obj.command_chain | |
let l:err_prefix = 'The `command_chain` item ' . l:link_index . ' ' | |
if !s:IsCallback(get(l:link, 'callback')) | |
throw l:err_prefix . 'must define a `callback` function' | |
endif | |
if has_key(l:link, 'output_stream') | |
if type(l:link.output_stream) != type('') | |
\|| index(['stdout', 'stderr', 'both'], l:link.output_stream) < 0 | |
throw l:err_prefix . '`output_stream` flag must be ' | |
\ . "'stdout', 'stderr', or 'both'" | |
endif | |
endif | |
if has_key(l:link, 'read_buffer') && !s:IsBoolean(l:link.read_buffer) | |
throw l:err_prefix . 'value for `read_buffer` must be `0` or `1`' | |
endif | |
let l:link_index += 1 | |
endfor | |
elseif has_key(a:linter, 'command_callback') | |
let l:obj.command_callback = a:linter.command_callback | |
if !s:IsCallback(l:obj.command_callback) | |
throw '`command_callback` must be a callback if defined' | |
endif | |
elseif has_key(a:linter, 'command') | |
let l:obj.command = a:linter.command | |
if type(l:obj.command) != type('') | |
throw '`command` must be a string if defined' | |
endif | |
else | |
throw 'Either `command`, `executable_callback`, `command_chain` ' | |
\ . 'must be defined' | |
endif | |
if ( | |
\ has_key(a:linter, 'command') | |
\ + has_key(a:linter, 'command_chain') | |
\ + has_key(a:linter, 'command_callback') | |
\) > 1 | |
throw 'Only one of `command`, `command_callback`, or `command_chain` ' | |
\ . 'should be set' | |
endif | |
if !l:needs_address | |
if has_key(a:linter, 'address_callback') | |
throw '`address_callback` cannot be used when lsp != ''socket''' | |
endif | |
elseif has_key(a:linter, 'address_callback') | |
let l:obj.address_callback = a:linter.address_callback | |
if !s:IsCallback(l:obj.address_callback) | |
throw '`address_callback` must be a callback if defined' | |
endif | |
else | |
throw '`address_callback` must be defined for getting the LSP address' | |
endif | |
if l:needs_lsp_details | |
let l:obj.language_callback = get(a:linter, 'language_callback') | |
if !s:IsCallback(l:obj.language_callback) | |
throw '`language_callback` must be a callback for LSP linters' | |
endif | |
let l:obj.project_root_callback = get(a:linter, 'project_root_callback') | |
if !s:IsCallback(l:obj.project_root_callback) | |
throw '`project_root_callback` must be a callback for LSP linters' | |
endif | |
endif | |
let l:obj.output_stream = get(a:linter, 'output_stream', 'stdout') | |
if type(l:obj.output_stream) != type('') | |
\|| index(['stdout', 'stderr', 'both'], l:obj.output_stream) < 0 | |
throw "`output_stream` must be 'stdout', 'stderr', or 'both'" | |
endif | |
" An option indicating that this linter should only be run against the | |
" file on disk. | |
let l:obj.lint_file = get(a:linter, 'lint_file', 0) | |
if !s:IsBoolean(l:obj.lint_file) | |
throw '`lint_file` must be `0` or `1`' | |
endif | |
" An option indicating that the buffer should be read. | |
let l:obj.read_buffer = get(a:linter, 'read_buffer', !l:obj.lint_file) | |
if !s:IsBoolean(l:obj.read_buffer) | |
throw '`read_buffer` must be `0` or `1`' | |
endif | |
if l:obj.lint_file && l:obj.read_buffer | |
throw 'Only one of `lint_file` or `read_buffer` can be `1`' | |
endif | |
let l:obj.aliases = get(a:linter, 'aliases', []) | |
if type(l:obj.aliases) != type([]) | |
\|| len(filter(copy(l:obj.aliases), 'type(v:val) != type('''')')) > 0 | |
throw '`aliases` must be a List of String values' | |
endif | |
return l:obj | |
endfunction | |
1 0.000003 function! ale#linter#Define(filetype, linter) abort | |
if !has_key(s:linters, a:filetype) | |
let s:linters[a:filetype] = [] | |
endif | |
let l:new_linter = ale#linter#PreProcess(a:linter) | |
call add(s:linters[a:filetype], l:new_linter) | |
endfunction | |
1 0.000002 function! ale#linter#GetAll(filetypes) abort | |
let l:combined_linters = [] | |
for l:filetype in a:filetypes | |
" Load linter defintions from files if we haven't loaded them yet. | |
if !has_key(s:linters, l:filetype) | |
execute 'silent! runtime! ale_linters/' . l:filetype . '/*.vim' | |
" Always set an empty List for the loaded linters if we don't find | |
" any. This will prevent us from executing the runtime command | |
" many times, redundantly. | |
if !has_key(s:linters, l:filetype) | |
let s:linters[l:filetype] = [] | |
endif | |
endif | |
call extend(l:combined_linters, get(s:linters, l:filetype, [])) | |
endfor | |
return l:combined_linters | |
endfunction | |
1 0.000002 function! s:GetAliasedFiletype(original_filetype) abort | |
" Check for aliased filetypes first in a buffer variable, | |
" then the global variable, | |
" then in the default mapping, | |
" otherwise use the original filetype. | |
for l:dict in [ | |
\ get(b:, 'ale_linter_aliases', {}), | |
\ g:ale_linter_aliases, | |
\ s:default_ale_linter_aliases, | |
\] | |
if has_key(l:dict, a:original_filetype) | |
return l:dict[a:original_filetype] | |
endif | |
endfor | |
return a:original_filetype | |
endfunction | |
1 0.000002 function! ale#linter#ResolveFiletype(original_filetype) abort | |
let l:filetype = s:GetAliasedFiletype(a:original_filetype) | |
if type(l:filetype) != type([]) | |
return [l:filetype] | |
endif | |
return l:filetype | |
endfunction | |
1 0.000002 function! s:GetLinterNames(original_filetype) abort | |
for l:dict in [ | |
\ get(b:, 'ale_linters', {}), | |
\ g:ale_linters, | |
\ s:default_ale_linters, | |
\] | |
if has_key(l:dict, a:original_filetype) | |
return l:dict[a:original_filetype] | |
endif | |
endfor | |
return 'all' | |
endfunction | |
1 0.000002 function! ale#linter#Get(original_filetypes) abort | |
let l:possibly_duplicated_linters = [] | |
" Handle dot-separated filetypes. | |
for l:original_filetype in split(a:original_filetypes, '\.') | |
let l:filetype = ale#linter#ResolveFiletype(l:original_filetype) | |
let l:linter_names = s:GetLinterNames(l:original_filetype) | |
let l:all_linters = ale#linter#GetAll(l:filetype) | |
let l:filetype_linters = [] | |
if type(l:linter_names) == type('') && l:linter_names is# 'all' | |
let l:filetype_linters = l:all_linters | |
elseif type(l:linter_names) == type([]) | |
" Select only the linters we or the user has specified. | |
for l:linter in l:all_linters | |
let l:name_list = [l:linter.name] + l:linter.aliases | |
for l:name in l:name_list | |
if index(l:linter_names, l:name) >= 0 | |
call add(l:filetype_linters, l:linter) | |
break | |
endif | |
endfor | |
endfor | |
endif | |
call extend(l:possibly_duplicated_linters, l:filetype_linters) | |
endfor | |
let l:name_list = [] | |
let l:combined_linters = [] | |
" Make sure we override linters so we don't get two with the same name, | |
" like 'eslint' for both 'javascript' and 'typescript' | |
" | |
" Note that the reverse calls here modify the List variables. | |
for l:linter in reverse(l:possibly_duplicated_linters) | |
if index(l:name_list, l:linter.name) < 0 | |
call add(l:name_list, l:linter.name) | |
call add(l:combined_linters, l:linter) | |
endif | |
endfor | |
return reverse(l:combined_linters) | |
endfunction | |
" Given a buffer and linter, get the executable String for the linter. | |
1 0.000002 function! ale#linter#GetExecutable(buffer, linter) abort | |
return has_key(a:linter, 'executable_callback') | |
\ ? ale#util#GetFunction(a:linter.executable_callback)(a:buffer) | |
\ : a:linter.executable | |
endfunction | |
" Given a buffer and linter, get the command String for the linter. | |
" The command_chain key is not supported. | |
1 0.000002 function! ale#linter#GetCommand(buffer, linter) abort | |
return has_key(a:linter, 'command_callback') | |
\ ? ale#util#GetFunction(a:linter.command_callback)(a:buffer) | |
\ : a:linter.command | |
endfunction | |
" Given a buffer and linter, get the address for connecting to the server. | |
1 0.000002 function! ale#linter#GetAddress(buffer, linter) abort | |
return has_key(a:linter, 'address_callback') | |
\ ? ale#util#GetFunction(a:linter.address_callback)(a:buffer) | |
\ : a:linter.address | |
endfunction | |
" Given a buffer, an LSP linter, and a callback to register for handling | |
" messages, start up an LSP linter and get ready to receive errors or | |
" completions. | |
1 0.000002 function! ale#linter#StartLSP(buffer, linter, callback) abort | |
let l:command = '' | |
let l:address = '' | |
let l:root = ale#util#GetFunction(a:linter.project_root_callback)(a:buffer) | |
if empty(l:root) && a:linter.lsp isnot# 'tsserver' | |
" If there's no project root, then we can't check files with LSP, | |
" unless we are using tsserver, which doesn't use project roots. | |
return {} | |
endif | |
if a:linter.lsp is# 'socket' | |
let l:address = ale#linter#GetAddress(a:buffer, a:linter) | |
let l:conn_id = ale#lsp#ConnectToAddress( | |
\ l:address, | |
\ l:root, | |
\ a:callback, | |
\) | |
else | |
let l:executable = ale#linter#GetExecutable(a:buffer, a:linter) | |
if !executable(l:executable) | |
return {} | |
endif | |
let l:command = ale#job#PrepareCommand( | |
\ ale#linter#GetCommand(a:buffer, a:linter), | |
\) | |
let l:conn_id = ale#lsp#StartProgram( | |
\ l:executable, | |
\ l:command, | |
\ l:root, | |
\ a:callback, | |
\) | |
endif | |
let l:language_id = ale#util#GetFunction(a:linter.language_callback)(a:buffer) | |
if !l:conn_id | |
if g:ale_history_enabled && !empty(l:command) | |
call ale#history#Add(a:buffer, 'failed', l:conn_id, l:command) | |
endif | |
return {} | |
endif | |
if ale#lsp#OpenDocumentIfNeeded(l:conn_id, a:buffer, l:root, l:language_id) | |
if g:ale_history_enabled && !empty(l:command) | |
call ale#history#Add(a:buffer, 'started', l:conn_id, l:command) | |
endif | |
endif | |
" The change message needs to be sent for tsserver before doing anything. | |
if a:linter.lsp is# 'tsserver' | |
call ale#lsp#Send(l:conn_id, ale#lsp#tsserver_message#Change(a:buffer)) | |
endif | |
return { | |
\ 'connection_id': l:conn_id, | |
\ 'command': l:command, | |
\ 'project_root': l:root, | |
\ 'language_id': l:language_id, | |
\} | |
endfunction | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/ale_linters/php/hack.vim | |
Sourced 1 time | |
Total time: 0.000376 | |
Self time: 0.000128 | |
count total (s) self (s) | |
" Author: Zefei Xuan <https://github.com/zefei> | |
" Description: Hack type checking (http://hacklang.org/) | |
1 0.000082 function! ale_linters#php#hack#Handle(buffer, lines) abort | |
let l:pattern = '^\(.*\):\(\d\+\):\(\d\+\),\(\d\+\): \(.\+])\)$' | |
let l:output = [] | |
for l:match in ale#util#GetMatches(a:lines, l:pattern) | |
if a:buffer != bufnr(l:match[1]) | |
continue | |
endif | |
call add(l:output, { | |
\ 'lnum': l:match[2] + 0, | |
\ 'col': l:match[3] + 0, | |
\ 'text': l:match[5], | |
\}) | |
endfor | |
return l:output | |
endfunction | |
1 0.000278 0.000030 call ale#linter#Define('php', { | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/ale_linters/php/langserver.vim | |
Sourced 1 time | |
Total time: 0.000399 | |
Self time: 0.000127 | |
count total (s) self (s) | |
" Author: Eric Stern <eric@ericstern.com> | |
" Description: PHP Language server integration for ALE | |
1 0.000036 0.000014 call ale#Set('php_langserver_executable', 'php-language-server.php') | |
1 0.000019 0.000005 call ale#Set('php_langserver_use_global', 0) | |
1 0.000068 function! ale_linters#php#langserver#GetExecutable(buffer) abort | |
return ale#node#FindExecutable(a:buffer, 'php_langserver', [ | |
\ 'vendor/bin/php-language-server.php', | |
\]) | |
endfunction | |
1 0.000003 function! ale_linters#php#langserver#GetCommand(buffer) abort | |
return 'php ' . ale#Escape(ale_linters#php#langserver#GetExecutable(a:buffer)) | |
endfunction | |
1 0.000002 function! ale_linters#php#langserver#GetLanguage(buffer) abort | |
return 'php' | |
endfunction | |
1 0.000003 function! ale_linters#php#langserver#GetProjectRoot(buffer) abort | |
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git') | |
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : '' | |
endfunction | |
1 0.000250 0.000013 call ale#linter#Define('php', { | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/ale_linters/php/php.vim | |
Sourced 1 time | |
Total time: 0.000453 | |
Self time: 0.000103 | |
count total (s) self (s) | |
" Author: Spencer Wood <https://github.com/scwood>, Adriaan Zonnenberg <amz@adriaan.xyz> | |
" Description: This file adds support for checking PHP with php-cli | |
1 0.000066 function! ale_linters#php#php#Handle(buffer, lines) abort | |
" Matches patterns like the following: | |
" | |
" Parse error: syntax error, unexpected ';', expecting ']' in - on line 15 | |
let l:pattern = '\v^%(Fatal|Parse) error:\s+(.+unexpected ''(.+)%(expecting.+)@<!''.*|.+) in - on line (\d+)' | |
let l:output = [] | |
for l:match in ale#util#GetMatches(a:lines, l:pattern) | |
let l:col = empty(l:match[2]) ? 0 : stridx(getline(l:match[3]), l:match[2]) + 1 | |
let l:obj = { | |
\ 'lnum': l:match[3] + 0, | |
\ 'col': l:col, | |
\ 'text': l:match[1], | |
\} | |
if l:col != 0 | |
let l:obj.end_col = l:col + strlen(l:match[2]) - 1 | |
endif | |
call add(l:output, l:obj) | |
endfor | |
return l:output | |
endfunction | |
1 0.000366 0.000016 call ale#linter#Define('php', { | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/ale_linters/php/phpcs.vim | |
Sourced 1 time | |
Total time: 0.000666 | |
Self time: 0.000187 | |
count total (s) self (s) | |
" Author: jwilliams108 <https://github.com/jwilliams108>, Eric Stern <https://github.com/firehed> | |
" Description: phpcs for PHP files | |
1 0.000012 let g:ale_php_phpcs_standard = get(g:, 'ale_php_phpcs_standard', '') | |
1 0.000025 0.000008 call ale#Set('php_phpcs_executable', 'phpcs') | |
1 0.000018 0.000005 call ale#Set('php_phpcs_use_global', 0) | |
1 0.000102 function! ale_linters#php#phpcs#GetExecutable(buffer) abort | |
return ale#node#FindExecutable(a:buffer, 'php_phpcs', [ | |
\ 'vendor/bin/phpcs', | |
\ 'phpcs' | |
\]) | |
endfunction | |
1 0.000004 function! ale_linters#php#phpcs#GetCommand(buffer) abort | |
let l:executable = ale_linters#php#phpcs#GetExecutable(a:buffer) | |
let l:standard = ale#Var(a:buffer, 'php_phpcs_standard') | |
let l:standard_option = !empty(l:standard) | |
\ ? '--standard=' . l:standard | |
\ : '' | |
return ale#Escape(l:executable) | |
\ . ' -s --report=emacs --stdin-path=%s ' . l:standard_option | |
endfunction | |
1 0.000004 function! ale_linters#php#phpcs#Handle(buffer, lines) abort | |
" Matches against lines like the following: | |
" | |
" /path/to/some-filename.php:18:3: error - Line indented incorrectly; expected 4 spaces, found 2 (Generic.WhiteSpace.ScopeIndent.IncorrectExact) | |
let l:pattern = '^.*:\(\d\+\):\(\d\+\): \(.\+\) - \(.\+\) \(\(.\+\)\)$' | |
let l:output = [] | |
for l:match in ale#util#GetMatches(a:lines, l:pattern) | |
let l:text = l:match[4] | |
let l:type = l:match[3] | |
call add(l:output, { | |
\ 'lnum': l:match[1] + 0, | |
\ 'col': l:match[2] + 0, | |
\ 'text': l:text, | |
\ 'type': l:type is# 'error' ? 'E' : 'W', | |
\}) | |
endfor | |
return l:output | |
endfunction | |
1 0.000465 0.000017 call ale#linter#Define('php', { | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/ale_linters/php/phpmd.vim | |
Sourced 1 time | |
Total time: 0.000467 | |
Self time: 0.000133 | |
count total (s) self (s) | |
" Author: medains <https://github.com/medains> | |
" Description: phpmd for PHP files | |
" Set to change the ruleset | |
1 0.000011 let g:ale_php_phpmd_ruleset = get(g:, 'ale_php_phpmd_ruleset', 'cleancode,codesize,controversial,design,naming,unusedcode') | |
1 0.000082 function! ale_linters#php#phpmd#GetCommand(buffer) abort | |
return 'phpmd %s text ' | |
\ . ale#Var(a:buffer, 'php_phpmd_ruleset') | |
\ . ' --ignore-violations-on-exit %t' | |
endfunction | |
1 0.000004 function! ale_linters#php#phpmd#Handle(buffer, lines) abort | |
" Matches against lines like the following: | |
" | |
" /path/to/some-filename.php:18 message | |
let l:pattern = '^.*:\(\d\+\)\t\(.\+\)$' | |
let l:output = [] | |
for l:match in ale#util#GetMatches(a:lines, l:pattern) | |
call add(l:output, { | |
\ 'lnum': l:match[1] + 0, | |
\ 'text': l:match[2], | |
\ 'type': 'W', | |
\}) | |
endfor | |
return l:output | |
endfunction | |
1 0.000348 0.000014 call ale#linter#Define('php', { | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/ale_linters/php/phpstan.vim | |
Sourced 1 time | |
Total time: 0.000402 | |
Self time: 0.000124 | |
count total (s) self (s) | |
" Author: medains <https://github.com/medains>, ardis <https://github.com/ardisdreelath> | |
" Description: phpstan for PHP files | |
" Set to change the ruleset | |
1 0.000010 let g:ale_php_phpstan_executable = get(g:, 'ale_php_phpstan_executable', 'phpstan') | |
1 0.000004 let g:ale_php_phpstan_level = get(g:, 'ale_php_phpstan_level', '4') | |
1 0.000003 let g:ale_php_phpstan_configuration = get(g:, 'ale_php_phpstan_configuration', '') | |
1 0.000064 function! ale_linters#php#phpstan#GetExecutable(buffer) abort | |
return ale#Var(a:buffer, 'php_phpstan_executable') | |
endfunction | |
1 0.000002 function! ale_linters#php#phpstan#GetCommand(buffer) abort | |
let l:executable = ale_linters#php#phpstan#GetExecutable(a:buffer) | |
let l:configuration = ale#Var(a:buffer, 'php_phpstan_configuration') | |
let l:configuration_option = !empty(l:configuration) | |
\ ? ' -c ' . l:configuration | |
\ : '' | |
return ale#Escape(l:executable) | |
\ . ' analyze -l' | |
\ . ale#Var(a:buffer, 'php_phpstan_level') | |
\ . ' --errorFormat raw' | |
\ . l:configuration_option | |
\ . ' %s' | |
endfunction | |
1 0.000002 function! ale_linters#php#phpstan#Handle(buffer, lines) abort | |
" Matches against lines like the following: | |
" | |
" filename.php:15:message | |
" C:\folder\filename.php:15:message | |
let l:pattern = '^\([a-zA-Z]:\)\?[^:]\+:\(\d\+\):\(.*\)$' | |
let l:output = [] | |
for l:match in ale#util#GetMatches(a:lines, l:pattern) | |
call add(l:output, { | |
\ 'lnum': l:match[2] + 0, | |
\ 'text': l:match[3], | |
\ 'type': 'W', | |
\}) | |
endfor | |
return l:output | |
endfunction | |
1 0.000290 0.000012 call ale#linter#Define('php', { | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale/engine.vim | |
Sourced 1 time | |
Total time: 0.000763 | |
Self time: 0.000763 | |
count total (s) self (s) | |
" Author: w0rp <devw0rp@gmail.com> | |
" Description: Backend execution and job management | |
" Executes linters in the background, using NeoVim or Vim 8 jobs | |
" Stores information for each job including: | |
" | |
" linter: The linter dictionary for the job. | |
" buffer: The buffer number for the job. | |
" output: The array of lines for the output of the job. | |
1 0.000013 if !has_key(s:, 'job_info_map') | |
1 0.000005 let s:job_info_map = {} | |
1 0.000002 endif | |
" Associates LSP connection IDs with linter names. | |
1 0.000003 if !has_key(s:, 'lsp_linter_map') | |
1 0.000003 let s:lsp_linter_map = {} | |
1 0.000001 endif | |
1 0.000003 if !has_key(s:, 'executable_cache_map') | |
1 0.000002 let s:executable_cache_map = {} | |
1 0.000001 endif | |
1 0.000005 function! ale#engine#ResetExecutableCache() abort | |
let s:executable_cache_map = {} | |
endfunction | |
" Check if files are executable, and if they are, remember that they are | |
" for subsequent calls. We'll keep checking until programs can be executed. | |
1 0.000003 function! ale#engine#IsExecutable(buffer, executable) abort | |
if has_key(s:executable_cache_map, a:executable) | |
return 1 | |
endif | |
let l:result = 0 | |
if executable(a:executable) | |
let s:executable_cache_map[a:executable] = 1 | |
let l:result = 1 | |
endif | |
if g:ale_history_enabled | |
call ale#history#Add(a:buffer, l:result, 'executable', a:executable) | |
endif | |
return l:result | |
endfunction | |
1 0.000003 function! ale#engine#InitBufferInfo(buffer) abort | |
if !has_key(g:ale_buffer_info, a:buffer) | |
" job_list will hold the list of job IDs | |
" active_linter_list will hold the list of active linter names | |
" loclist holds the loclist items after all jobs have completed. | |
" temporary_file_list holds temporary files to be cleaned up | |
" temporary_directory_list holds temporary directories to be cleaned up | |
let g:ale_buffer_info[a:buffer] = { | |
\ 'job_list': [], | |
\ 'active_linter_list': [], | |
\ 'loclist': [], | |
\ 'temporary_file_list': [], | |
\ 'temporary_directory_list': [], | |
\} | |
return 1 | |
endif | |
return 0 | |
endfunction | |
" Return 1 if ALE is busy checking a given buffer | |
1 0.000003 function! ale#engine#IsCheckingBuffer(buffer) abort | |
let l:info = get(g:ale_buffer_info, a:buffer, {}) | |
return !empty(get(l:info, 'active_linter_list', [])) | |
endfunction | |
" Register a temporary file to be managed with the ALE engine for | |
" a current job run. | |
1 0.000003 function! ale#engine#ManageFile(buffer, filename) abort | |
call add(g:ale_buffer_info[a:buffer].temporary_file_list, a:filename) | |
endfunction | |
" Same as the above, but manage an entire directory. | |
1 0.000003 function! ale#engine#ManageDirectory(buffer, directory) abort | |
call add(g:ale_buffer_info[a:buffer].temporary_directory_list, a:directory) | |
endfunction | |
" Create a new temporary directory and manage it in one go. | |
1 0.000002 function! ale#engine#CreateDirectory(buffer) abort | |
let l:temporary_directory = tempname() | |
" Create the temporary directory for the file, unreadable by 'other' | |
" users. | |
call mkdir(l:temporary_directory, '', 0750) | |
call ale#engine#ManageDirectory(a:buffer, l:temporary_directory) | |
return l:temporary_directory | |
endfunction | |
1 0.000003 function! ale#engine#RemoveManagedFiles(buffer) abort | |
let l:info = get(g:ale_buffer_info, a:buffer, {}) | |
" We can't delete anything in a sandbox, so wait until we escape from | |
" it to delete temporary files and directories. | |
if ale#util#InSandbox() | |
return | |
endif | |
" Delete files with a call akin to a plan `rm` command. | |
if has_key(l:info, 'temporary_file_list') | |
for l:filename in l:info.temporary_file_list | |
call delete(l:filename) | |
endfor | |
let l:info.temporary_file_list = [] | |
endif | |
" Delete directories like `rm -rf`. | |
" Directories are handled differently from files, so paths that are | |
" intended to be single files can be set up for automatic deletion without | |
" accidentally deleting entire directories. | |
if has_key(l:info, 'temporary_directory_list') | |
for l:directory in l:info.temporary_directory_list | |
call delete(l:directory, 'rf') | |
endfor | |
let l:info.temporary_directory_list = [] | |
endif | |
endfunction | |
1 0.000005 function! s:GatherOutput(job_id, line) abort | |
if has_key(s:job_info_map, a:job_id) | |
call add(s:job_info_map[a:job_id].output, a:line) | |
endif | |
endfunction | |
1 0.000003 function! s:HandleLoclist(linter_name, buffer, loclist) abort | |
let l:buffer_info = get(g:ale_buffer_info, a:buffer, {}) | |
if empty(l:buffer_info) | |
return | |
endif | |
" Remove this linter from the list of active linters. | |
" This may have already been done when the job exits. | |
call filter(l:buffer_info.active_linter_list, 'v:val isnot# a:linter_name') | |
" Make some adjustments to the loclists to fix common problems, and also | |
" to set default values for loclist items. | |
let l:linter_loclist = ale#engine#FixLocList(a:buffer, a:linter_name, a:loclist) | |
" Remove previous items for this linter. | |
call filter(g:ale_buffer_info[a:buffer].loclist, 'v:val.linter_name isnot# a:linter_name') | |
" Add the new items. | |
call extend(g:ale_buffer_info[a:buffer].loclist, l:linter_loclist) | |
" Sort the loclist again. | |
" We need a sorted list so we can run a binary search against it | |
" for efficient lookup of the messages in the cursor handler. | |
call sort(g:ale_buffer_info[a:buffer].loclist, 'ale#util#LocItemCompare') | |
if ale#ShouldDoNothing(a:buffer) | |
return | |
endif | |
call ale#engine#SetResults(a:buffer, g:ale_buffer_info[a:buffer].loclist) | |
endfunction | |
1 0.000002 function! s:HandleExit(job_id, exit_code) abort | |
if !has_key(s:job_info_map, a:job_id) | |
return | |
endif | |
let l:job_info = s:job_info_map[a:job_id] | |
let l:linter = l:job_info.linter | |
let l:output = l:job_info.output | |
let l:buffer = l:job_info.buffer | |
let l:next_chain_index = l:job_info.next_chain_index | |
if g:ale_history_enabled | |
call ale#history#SetExitCode(l:buffer, a:job_id, a:exit_code) | |
endif | |
" Remove this job from the list. | |
call ale#job#Stop(a:job_id) | |
call remove(s:job_info_map, a:job_id) | |
call filter(g:ale_buffer_info[l:buffer].job_list, 'v:val isnot# a:job_id') | |
call filter(g:ale_buffer_info[l:buffer].active_linter_list, 'v:val isnot# l:linter.name') | |
" Stop here if we land in the handle for a job completing if we're in | |
" a sandbox. | |
if ale#util#InSandbox() | |
return | |
endif | |
if has('nvim') && !empty(l:output) && empty(l:output[-1]) | |
call remove(l:output, -1) | |
endif | |
if l:next_chain_index < len(get(l:linter, 'command_chain', [])) | |
call s:InvokeChain(l:buffer, l:linter, l:next_chain_index, l:output) | |
return | |
endif | |
" Log the output of the command for ALEInfo if we should. | |
if g:ale_history_enabled && g:ale_history_log_output | |
call ale#history#RememberOutput(l:buffer, a:job_id, l:output[:]) | |
endif | |
let l:loclist = ale#util#GetFunction(l:linter.callback)(l:buffer, l:output) | |
call s:HandleLoclist(l:linter.name, l:buffer, l:loclist) | |
endfunction | |
1 0.000003 function! s:HandleLSPDiagnostics(conn_id, response) abort | |
let l:linter_name = s:lsp_linter_map[a:conn_id] | |
let l:filename = ale#path#FromURI(a:response.params.uri) | |
let l:buffer = bufnr(l:filename) | |
if l:buffer <= 0 | |
return | |
endif | |
let l:loclist = ale#lsp#response#ReadDiagnostics(a:response) | |
call s:HandleLoclist(l:linter_name, l:buffer, l:loclist) | |
endfunction | |
1 0.000003 function! s:HandleTSServerDiagnostics(response, error_type) abort | |
let l:buffer = bufnr(a:response.body.file) | |
let l:info = get(g:ale_buffer_info, l:buffer, {}) | |
if empty(l:info) | |
return | |
endif | |
let l:thislist = ale#lsp#response#ReadTSServerDiagnostics(a:response) | |
" tsserver sends syntax and semantic errors in separate messages, so we | |
" have to collect the messages separately for each buffer and join them | |
" back together again. | |
if a:error_type is# 'syntax' | |
let l:info.syntax_loclist = l:thislist | |
else | |
let l:info.semantic_loclist = l:thislist | |
endif | |
let l:loclist = get(l:info, 'semantic_loclist', []) | |
\ + get(l:info, 'syntax_loclist', []) | |
call s:HandleLoclist('tsserver', l:buffer, l:loclist) | |
endfunction | |
1 0.000002 function! s:HandleLSPErrorMessage(error_message) abort | |
echoerr 'Error from LSP:' | |
for l:line in split(a:error_message, "\n") | |
echoerr l:line | |
endfor | |
endfunction | |
1 0.000003 function! ale#engine#HandleLSPResponse(conn_id, response) abort | |
let l:method = get(a:response, 'method', '') | |
if get(a:response, 'jsonrpc', '') is# '2.0' && has_key(a:response, 'error') | |
" Uncomment this line to print LSP error messages. | |
" call s:HandleLSPErrorMessage(a:response.error.message) | |
elseif l:method is# 'textDocument/publishDiagnostics' | |
call s:HandleLSPDiagnostics(a:conn_id, a:response) | |
elseif get(a:response, 'type', '') is# 'event' | |
\&& get(a:response, 'event', '') is# 'semanticDiag' | |
call s:HandleTSServerDiagnostics(a:response, 'semantic') | |
elseif get(a:response, 'type', '') is# 'event' | |
\&& get(a:response, 'event', '') is# 'syntaxDiag' | |
call s:HandleTSServerDiagnostics(a:response, 'syntax') | |
endif | |
endfunction | |
1 0.000003 function! ale#engine#SetResults(buffer, loclist) abort | |
let l:linting_is_done = !ale#engine#IsCheckingBuffer(a:buffer) | |
" Set signs first. This could potentially fix some line numbers. | |
" The List could be sorted again here by SetSigns. | |
if g:ale_set_signs | |
call ale#sign#SetSigns(a:buffer, a:loclist) | |
endif | |
if g:ale_set_quickfix || g:ale_set_loclist | |
call ale#list#SetLists(a:buffer, a:loclist) | |
endif | |
if exists('*ale#statusline#Update') | |
" Don't load/run if not already loaded. | |
call ale#statusline#Update(a:buffer, a:loclist) | |
endif | |
if g:ale_set_highlights | |
call ale#highlight#SetHighlights(a:buffer, a:loclist) | |
endif | |
if g:ale_echo_cursor | |
" Try and echo the warning now. | |
" This will only do something meaningful if we're in normal mode. | |
call ale#cursor#EchoCursorWarning() | |
endif | |
if l:linting_is_done | |
" Reset the save event marker, used for opening windows, etc. | |
call setbufvar(a:buffer, 'ale_save_event_fired', 0) | |
" Automatically remove all managed temporary files and directories | |
" now that all jobs have completed. | |
call ale#engine#RemoveManagedFiles(a:buffer) | |
" Call user autocommands. This allows users to hook into ALE's lint cycle. | |
silent doautocmd User ALELint | |
endif | |
endfunction | |
1 0.000003 function! s:RemapItemTypes(type_map, loclist) abort | |
for l:item in a:loclist | |
let l:key = l:item.type | |
\ . (get(l:item, 'sub_type', '') is# 'style' ? 'S' : '') | |
let l:new_key = get(a:type_map, l:key, '') | |
if l:new_key is# 'E' | |
\|| l:new_key is# 'ES' | |
\|| l:new_key is# 'W' | |
\|| l:new_key is# 'WS' | |
\|| l:new_key is# 'I' | |
let l:item.type = l:new_key[0] | |
if l:new_key is# 'ES' || l:new_key is# 'WS' | |
let l:item.sub_type = 'style' | |
elseif has_key(l:item, 'sub_type') | |
call remove(l:item, 'sub_type') | |
endif | |
endif | |
endfor | |
endfunction | |
" Save the temporary directory so we can figure out if files are in it. | |
1 0.000008 let s:temp_dir = fnamemodify(tempname(), ':h') | |
1 0.000003 function! ale#engine#FixLocList(buffer, linter_name, loclist) abort | |
let l:bufnr_map = {} | |
let l:new_loclist = [] | |
" Some errors have line numbers beyond the end of the file, | |
" so we need to adjust them so they set the error at the last line | |
" of the file instead. | |
let l:last_line_number = ale#util#GetLineCount(a:buffer) | |
for l:old_item in a:loclist | |
" Copy the loclist item with some default values and corrections. | |
" | |
" line and column numbers will be converted to numbers. | |
" The buffer will default to the buffer being checked. | |
" The vcol setting will default to 0, a byte index. | |
" The error type will default to 'E' for errors. | |
" The error number will default to -1. | |
" | |
" The line number and text are the only required keys. | |
" | |
" The linter_name will be set on the errors so it can be used in | |
" output, filtering, etc.. | |
let l:item = { | |
\ 'bufnr': a:buffer, | |
\ 'text': l:old_item.text, | |
\ 'lnum': str2nr(l:old_item.lnum), | |
\ 'col': str2nr(get(l:old_item, 'col', 0)), | |
\ 'vcol': get(l:old_item, 'vcol', 0), | |
\ 'type': get(l:old_item, 'type', 'E'), | |
\ 'nr': get(l:old_item, 'nr', -1), | |
\ 'linter_name': a:linter_name, | |
\} | |
if has_key(l:old_item, 'filename') | |
\&& !ale#path#IsTempName(l:old_item.filename) | |
" Use the filename given. | |
" Temporary files are assumed to be for this buffer, | |
" and the filename is not included then, because it looks bad | |
" in the loclist window. | |
let l:filename = l:old_item.filename | |
let l:item.filename = l:filename | |
if has_key(l:old_item, 'bufnr') | |
" If a buffer number is also given, include that too. | |
" If Vim detects that he buffer number is valid, it will | |
" be used instead of the filename. | |
let l:item.bufnr = l:old_item.bufnr | |
elseif has_key(l:bufnr_map, l:filename) | |
" Get the buffer number from the map, which can be faster. | |
let l:item.bufnr = l:bufnr_map[l:filename] | |
else | |
" Look up the buffer number. | |
let l:item.bufnr = bufnr(l:filename) | |
let l:bufnr_map[l:filename] = l:item.bufnr | |
endif | |
elseif has_key(l:old_item, 'bufnr') | |
let l:item.bufnr = l:old_item.bufnr | |
endif | |
if has_key(l:old_item, 'detail') | |
let l:item.detail = l:old_item.detail | |
endif | |
" Pass on a end_col key if set, used for highlights. | |
if has_key(l:old_item, 'end_col') | |
let l:item.end_col = str2nr(l:old_item.end_col) | |
endif | |
if has_key(l:old_item, 'end_lnum') | |
let l:item.end_lnum = str2nr(l:old_item.end_lnum) | |
endif | |
if has_key(l:old_item, 'sub_type') | |
let l:item.sub_type = l:old_item.sub_type | |
endif | |
if l:item.lnum < 1 | |
" When errors appear before line 1, put them at line 1. | |
let l:item.lnum = 1 | |
elseif l:item.bufnr == a:buffer && l:item.lnum > l:last_line_number | |
" When errors go beyond the end of the file, put them at the end. | |
" This is only done for the current buffer. | |
let l:item.lnum = l:last_line_number | |
endif | |
call add(l:new_loclist, l:item) | |
endfor | |
let l:type_map = get(ale#Var(a:buffer, 'type_map'), a:linter_name, {}) | |
if !empty(l:type_map) | |
call s:RemapItemTypes(l:type_map, l:new_loclist) | |
endif | |
return l:new_loclist | |
endfunction | |
" Given part of a command, replace any % with %%, so that no characters in | |
" the string will be replaced with filenames, etc. | |
1 0.000003 function! ale#engine#EscapeCommandPart(command_part) abort | |
return substitute(a:command_part, '%', '%%', 'g') | |
endfunction | |
1 0.000003 function! s:CreateTemporaryFileForJob(buffer, temporary_file) abort | |
if empty(a:temporary_file) | |
" There is no file, so we didn't create anything. | |
return 0 | |
endif | |
let l:temporary_directory = fnamemodify(a:temporary_file, ':h') | |
" Create the temporary directory for the file, unreadable by 'other' | |
" users. | |
call mkdir(l:temporary_directory, '', 0750) | |
" Automatically delete the directory later. | |
call ale#engine#ManageDirectory(a:buffer, l:temporary_directory) | |
" Write the buffer out to a file. | |
let l:lines = getbufline(a:buffer, 1, '$') | |
call ale#util#Writefile(a:buffer, l:lines, a:temporary_file) | |
return 1 | |
endfunction | |
" Run a job. | |
" | |
" Returns 1 when the job was started successfully. | |
1 0.000003 function! s:RunJob(options) abort | |
let l:command = a:options.command | |
let l:buffer = a:options.buffer | |
let l:linter = a:options.linter | |
let l:output_stream = a:options.output_stream | |
let l:next_chain_index = a:options.next_chain_index | |
let l:read_buffer = a:options.read_buffer | |
let l:info = g:ale_buffer_info[l:buffer] | |
if empty(l:command) | |
return 0 | |
endif | |
let [l:temporary_file, l:command] = ale#command#FormatCommand(l:buffer, l:command, l:read_buffer) | |
if s:CreateTemporaryFileForJob(l:buffer, l:temporary_file) | |
" If a temporary filename has been formatted in to the command, then | |
" we do not need to send the Vim buffer to the command. | |
let l:read_buffer = 0 | |
endif | |
" Add a newline to commands which need it. | |
" This is only used for Flow for now, and is not documented. | |
if l:linter.add_newline | |
if has('win32') | |
let l:command = l:command . '; echo.' | |
else | |
let l:command = l:command . '; echo' | |
endif | |
endif | |
let l:command = ale#job#PrepareCommand(l:command) | |
let l:job_options = { | |
\ 'mode': 'nl', | |
\ 'exit_cb': function('s:HandleExit'), | |
\} | |
if l:output_stream is# 'stderr' | |
let l:job_options.err_cb = function('s:GatherOutput') | |
elseif l:output_stream is# 'both' | |
let l:job_options.out_cb = function('s:GatherOutput') | |
let l:job_options.err_cb = function('s:GatherOutput') | |
else | |
let l:job_options.out_cb = function('s:GatherOutput') | |
endif | |
if get(g:, 'ale_run_synchronously') == 1 | |
" Find a unique Job value to use, which will be the same as the ID for | |
" running commands synchronously. This is only for test code. | |
let l:job_id = len(s:job_info_map) + 1 | |
while has_key(s:job_info_map, l:job_id) | |
let l:job_id += 1 | |
endwhile | |
else | |
let l:job_id = ale#job#Start(l:command, l:job_options) | |
endif | |
let l:status = 'failed' | |
" Only proceed if the job is being run. | |
if l:job_id | |
" Add the job to the list of jobs, so we can track them. | |
call add(l:info.job_list, l:job_id) | |
if index(l:info.active_linter_list, l:linter.name) < 0 | |
call add(l:info.active_linter_list, l:linter.name) | |
endif | |
let l:status = 'started' | |
" Store the ID for the job in the map to read back again. | |
let s:job_info_map[l:job_id] = { | |
\ 'linter': l:linter, | |
\ 'buffer': l:buffer, | |
\ 'output': [], | |
\ 'next_chain_index': l:next_chain_index, | |
\} | |
endif | |
if g:ale_history_enabled | |
call ale#history#Add(l:buffer, l:status, l:job_id, l:command) | |
endif | |
if get(g:, 'ale_run_synchronously') == 1 | |
" Run a command synchronously if this test option is set. | |
let s:job_info_map[l:job_id].output = systemlist( | |
\ type(l:command) == type([]) | |
\ ? join(l:command[0:1]) . ' ' . ale#Escape(l:command[2]) | |
\ : l:command | |
\) | |
call l:job_options.exit_cb(l:job_id, v:shell_error) | |
endif | |
return l:job_id != 0 | |
endfunction | |
" Determine which commands to run for a link in a command chain, or | |
" just a regular command. | |
1 0.000003 function! ale#engine#ProcessChain(buffer, linter, chain_index, input) abort | |
let l:output_stream = get(a:linter, 'output_stream', 'stdout') | |
let l:read_buffer = a:linter.read_buffer | |
let l:chain_index = a:chain_index | |
let l:input = a:input | |
if has_key(a:linter, 'command_chain') | |
while l:chain_index < len(a:linter.command_chain) | |
" Run a chain of commands, one asynchronous command after the other, | |
" so that many programs can be run in a sequence. | |
let l:chain_item = a:linter.command_chain[l:chain_index] | |
if l:chain_index == 0 | |
" The first callback in the chain takes only a buffer number. | |
let l:command = ale#util#GetFunction(l:chain_item.callback)( | |
\ a:buffer | |
\) | |
else | |
" The second callback in the chain takes some input too. | |
let l:command = ale#util#GetFunction(l:chain_item.callback)( | |
\ a:buffer, | |
\ l:input | |
\) | |
endif | |
if !empty(l:command) | |
" We hit a command to run, so we'll execute that | |
" The chain item can override the output_stream option. | |
if has_key(l:chain_item, 'output_stream') | |
let l:output_stream = l:chain_item.output_stream | |
endif | |
" The chain item can override the read_buffer option. | |
if has_key(l:chain_item, 'read_buffer') | |
let l:read_buffer = l:chain_item.read_buffer | |
elseif l:chain_index != len(a:linter.command_chain) - 1 | |
" Don't read the buffer for commands besides the last one | |
" in the chain by default. | |
let l:read_buffer = 0 | |
endif | |
break | |
endif | |
" Command chain items can return an empty string to indicate that | |
" a command should be skipped, so we should try the next item | |
" with no input. | |
let l:input = [] | |
let l:chain_index += 1 | |
endwhile | |
else | |
let l:command = ale#linter#GetCommand(a:buffer, a:linter) | |
endif | |
return { | |
\ 'command': l:command, | |
\ 'buffer': a:buffer, | |
\ 'linter': a:linter, | |
\ 'output_stream': l:output_stream, | |
\ 'next_chain_index': l:chain_index + 1, | |
\ 'read_buffer': l:read_buffer, | |
\} | |
endfunction | |
1 0.000003 function! s:InvokeChain(buffer, linter, chain_index, input) abort | |
let l:options = ale#engine#ProcessChain(a:buffer, a:linter, a:chain_index, a:input) | |
return s:RunJob(l:options) | |
endfunction | |
1 0.000002 function! s:StopCurrentJobs(buffer, include_lint_file_jobs) abort | |
let l:info = get(g:ale_buffer_info, a:buffer, {}) | |
let l:new_job_list = [] | |
let l:new_active_linter_list = [] | |
for l:job_id in get(l:info, 'job_list', []) | |
let l:job_info = get(s:job_info_map, l:job_id, {}) | |
if !empty(l:job_info) | |
if a:include_lint_file_jobs || !l:job_info.linter.lint_file | |
call ale#job#Stop(l:job_id) | |
call remove(s:job_info_map, l:job_id) | |
else | |
call add(l:new_job_list, l:job_id) | |
" Linters with jobs still running are still active. | |
call add(l:new_active_linter_list, l:job_info.linter.name) | |
endif | |
endif | |
endfor | |
" Remove duplicates from the active linter list. | |
call uniq(sort(l:new_active_linter_list)) | |
" Update the List, so it includes only the jobs we still need. | |
let l:info.job_list = l:new_job_list | |
" Update the active linter list, clearing out anything not running. | |
let l:info.active_linter_list = l:new_active_linter_list | |
endfunction | |
1 0.000002 function! s:CheckWithLSP(buffer, linter) abort | |
let l:info = g:ale_buffer_info[a:buffer] | |
let l:lsp_details = ale#linter#StartLSP( | |
\ a:buffer, | |
\ a:linter, | |
\ function('ale#engine#HandleLSPResponse'), | |
\) | |
if empty(l:lsp_details) | |
return 0 | |
endif | |
let l:id = l:lsp_details.connection_id | |
let l:root = l:lsp_details.project_root | |
" Remember the linter this connection is for. | |
let s:lsp_linter_map[l:id] = a:linter.name | |
let l:change_message = a:linter.lsp is# 'tsserver' | |
\ ? ale#lsp#tsserver_message#Geterr(a:buffer) | |
\ : ale#lsp#message#DidChange(a:buffer) | |
let l:request_id = ale#lsp#Send(l:id, l:change_message, l:root) | |
if l:request_id != 0 | |
if index(l:info.active_linter_list, a:linter.name) < 0 | |
call add(l:info.active_linter_list, a:linter.name) | |
endif | |
endif | |
return l:request_id != 0 | |
endfunction | |
1 0.000003 function! s:RemoveProblemsForDisabledLinters(buffer, linters) abort | |
" Figure out which linters are still enabled, and remove | |
" problems for linters which are no longer enabled. | |
let l:name_map = {} | |
for l:linter in a:linters | |
let l:name_map[l:linter.name] = 1 | |
endfor | |
call filter( | |
\ get(g:ale_buffer_info[a:buffer], 'loclist', []), | |
\ 'get(l:name_map, get(v:val, ''linter_name''))', | |
\) | |
endfunction | |
1 0.000003 function! s:AddProblemsFromOtherBuffers(buffer, linters) abort | |
let l:filename = expand('#' . a:buffer . ':p') | |
let l:loclist = [] | |
let l:name_map = {} | |
" Build a map of the active linters. | |
for l:linter in a:linters | |
let l:name_map[l:linter.name] = 1 | |
endfor | |
" Find the items from other buffers, for the linters that are enabled. | |
for l:info in values(g:ale_buffer_info) | |
for l:item in l:info.loclist | |
if has_key(l:item, 'filename') | |
\&& l:item.filename is# l:filename | |
\&& has_key(l:name_map, l:item.linter_name) | |
" Copy the items and set the buffer numbers to this one. | |
let l:new_item = copy(l:item) | |
let l:new_item.bufnr = a:buffer | |
call add(l:loclist, l:new_item) | |
endif | |
endfor | |
endfor | |
if !empty(l:loclist) | |
call sort(l:loclist, function('ale#util#LocItemCompareWithText')) | |
call uniq(l:loclist, function('ale#util#LocItemCompareWithText')) | |
" Set the loclist variable, used by some parts of ALE. | |
let g:ale_buffer_info[a:buffer].loclist = l:loclist | |
call ale#engine#SetResults(a:buffer, l:loclist) | |
endif | |
endfunction | |
" Run a linter for a buffer. | |
" | |
" Returns 1 if the linter was successfully run. | |
1 0.000003 function! s:RunLinter(buffer, linter) abort | |
if !empty(a:linter.lsp) | |
return s:CheckWithLSP(a:buffer, a:linter) | |
else | |
let l:executable = ale#linter#GetExecutable(a:buffer, a:linter) | |
if ale#engine#IsExecutable(a:buffer, l:executable) | |
return s:InvokeChain(a:buffer, a:linter, 0, []) | |
endif | |
endif | |
return 0 | |
endfunction | |
1 0.000003 function! ale#engine#RunLinters(buffer, linters, should_lint_file) abort | |
" Initialise the buffer information if needed. | |
let l:new_buffer = ale#engine#InitBufferInfo(a:buffer) | |
call s:StopCurrentJobs(a:buffer, a:should_lint_file) | |
call s:RemoveProblemsForDisabledLinters(a:buffer, a:linters) | |
" We can only clear the results if we aren't checking the buffer. | |
let l:can_clear_results = !ale#engine#IsCheckingBuffer(a:buffer) | |
for l:linter in a:linters | |
" Only run lint_file linters if we should. | |
if !l:linter.lint_file || a:should_lint_file | |
if s:RunLinter(a:buffer, l:linter) | |
" If a single linter ran, we shouldn't clear everything. | |
let l:can_clear_results = 0 | |
endif | |
else | |
" If we skipped running a lint_file linter still in the list, | |
" we shouldn't clear everything. | |
let l:can_clear_results = 0 | |
endif | |
endfor | |
" Clear the results if we can. This needs to be done when linters are | |
" disabled, or ALE itself is disabled. | |
if l:can_clear_results | |
call ale#engine#SetResults(a:buffer, []) | |
elseif l:new_buffer | |
call s:AddProblemsFromOtherBuffers(a:buffer, a:linters) | |
endif | |
endfunction | |
" Clean up a buffer. | |
" | |
" This function will stop all current jobs for the buffer, | |
" clear the state of everything, and remove the Dictionary for managing | |
" the buffer. | |
1 0.000002 function! ale#engine#Cleanup(buffer) abort | |
if !has_key(g:ale_buffer_info, a:buffer) | |
return | |
endif | |
call ale#engine#RunLinters(a:buffer, [], 1) | |
call remove(g:ale_buffer_info, a:buffer) | |
endfunction | |
" Given a buffer number, return the warnings and errors for a given buffer. | |
1 0.000002 function! ale#engine#GetLoclist(buffer) abort | |
if !has_key(g:ale_buffer_info, a:buffer) | |
return [] | |
endif | |
return g:ale_buffer_info[a:buffer].loclist | |
endfunction | |
" This function can be called with a timeout to wait for all jobs to finish. | |
" If the jobs to not finish in the given number of milliseconds, | |
" an exception will be thrown. | |
" | |
" The time taken will be a very rough approximation, and more time may be | |
" permitted than is specified. | |
1 0.000002 function! ale#engine#WaitForJobs(deadline) abort | |
let l:start_time = ale#util#ClockMilliseconds() | |
if l:start_time == 0 | |
throw 'Failed to read milliseconds from the clock!' | |
endif | |
let l:job_list = [] | |
" Gather all of the jobs from every buffer. | |
for l:info in values(g:ale_buffer_info) | |
call extend(l:job_list, l:info.job_list) | |
endfor | |
" NeoVim has a built-in API for this, so use that. | |
if has('nvim') | |
let l:nvim_code_list = jobwait(l:job_list, a:deadline) | |
if index(l:nvim_code_list, -1) >= 0 | |
throw 'Jobs did not complete on time!' | |
endif | |
return | |
endif | |
let l:should_wait_more = 1 | |
while l:should_wait_more | |
let l:should_wait_more = 0 | |
for l:job_id in l:job_list | |
if ale#job#IsRunning(l:job_id) | |
let l:now = ale#util#ClockMilliseconds() | |
if l:now - l:start_time > a:deadline | |
" Stop waiting after a timeout, so we don't wait forever. | |
throw 'Jobs did not complete on time!' | |
endif | |
" Wait another 10 milliseconds | |
let l:should_wait_more = 1 | |
sleep 10ms | |
break | |
endif | |
endfor | |
endwhile | |
" Sleep for a small amount of time after all jobs finish. | |
" This seems to be enough to let handlers after jobs end run, and | |
" prevents the occasional failure where this function exits after jobs | |
" end, but before handlers are run. | |
sleep 10ms | |
" We must check the buffer data again to see if new jobs started | |
" for command_chain linters. | |
let l:has_new_jobs = 0 | |
" Check again to see if any jobs are running. | |
for l:info in values(g:ale_buffer_info) | |
for l:job_id in l:info.job_list | |
if ale#job#IsRunning(l:job_id) | |
let l:has_new_jobs = 1 | |
break | |
endif | |
endfor | |
endfor | |
if l:has_new_jobs | |
" We have to wait more. Offset the timeout by the time taken so far. | |
let l:now = ale#util#ClockMilliseconds() | |
let l:new_deadline = a:deadline - (l:now - l:start_time) | |
if l:new_deadline <= 0 | |
" Enough time passed already, so stop immediately. | |
throw 'Jobs did not complete on time!' | |
endif | |
call ale#engine#WaitForJobs(l:new_deadline) | |
endif | |
endfunction | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale/node.vim | |
Sourced 1 time | |
Total time: 0.000119 | |
Self time: 0.000079 | |
count total (s) self (s) | |
" Author: w0rp <devw0rp@gmail.com> | |
" Description: Functions for working with Node executables. | |
1 0.000056 0.000016 call ale#Set('windows_node_executable_path', 'node.exe') | |
" Given a buffer number, a base variable name, and a list of paths to search | |
" for in ancestor directories, detect the executable path for a Node program. | |
" | |
" The use_global and executable options for the relevant program will be used. | |
1 0.000005 function! ale#node#FindExecutable(buffer, base_var_name, path_list) abort | |
if ale#Var(a:buffer, a:base_var_name . '_use_global') | |
return ale#Var(a:buffer, a:base_var_name . '_executable') | |
endif | |
for l:path in a:path_list | |
let l:executable = ale#path#FindNearestFile(a:buffer, l:path) | |
if !empty(l:executable) | |
return l:executable | |
endif | |
endfor | |
return ale#Var(a:buffer, a:base_var_name . '_executable') | |
endfunction | |
" Create a executable string which executes a Node.js script command with a | |
" Node.js executable if needed. | |
" | |
" The executable string should not be escaped before passing it to this | |
" function, the executable string will be escaped when returned by this | |
" function. | |
" | |
" The executable is only prefixed for Windows machines | |
1 0.000003 function! ale#node#Executable(buffer, executable) abort | |
if ale#Has('win32') && a:executable =~? '\.js$' | |
let l:node = ale#Var(a:buffer, 'windows_node_executable_path') | |
return ale#Escape(l:node) . ' ' . ale#Escape(a:executable) | |
endif | |
return ale#Escape(a:executable) | |
endfunction | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale/path.vim | |
Sourced 1 time | |
Total time: 0.000165 | |
Self time: 0.000165 | |
count total (s) self (s) | |
" Author: w0rp <devw0rp@gmail.com> | |
" Description: Functions for working with paths in the filesystem. | |
1 0.000007 function! ale#path#Simplify(path) abort | |
" //foo is turned into /foo to stop Windows doing stupid things with | |
" search paths. | |
return substitute(simplify(a:path), '^//\+', '/', 'g') " no-custom-checks | |
endfunction | |
" This function is mainly used for testing. | |
" Simplify() a path, and change forward slashes to back slashes on Windows. | |
" | |
" If an additional 'add_drive' argument is given, the current drive letter | |
" will be prefixed to any absolute paths on Windows. | |
1 0.000003 function! ale#path#Winify(path, ...) abort | |
let l:new_path = ale#path#Simplify(a:path) | |
if has('win32') | |
let l:new_path = substitute(l:new_path, '/', '\\', 'g') | |
" Add a drive letter to \foo\bar paths, if needed. | |
if a:0 && a:1 is# 'add_drive' && l:new_path[:0] is# '\' | |
let l:new_path = fnamemodify('.', ':p')[:1] . l:new_path | |
endif | |
endif | |
return l:new_path | |
endfunction | |
" Given a buffer and a filename, find the nearest file by searching upwards | |
" through the paths relative to the given buffer. | |
1 0.000003 function! ale#path#FindNearestFile(buffer, filename) abort | |
let l:buffer_filename = fnamemodify(bufname(a:buffer), ':p') | |
let l:relative_path = findfile(a:filename, l:buffer_filename . ';') | |
if !empty(l:relative_path) | |
return fnamemodify(l:relative_path, ':p') | |
endif | |
return '' | |
endfunction | |
" Given a buffer and a directory name, find the nearest directory by searching upwards | |
" through the paths relative to the given buffer. | |
1 0.000002 function! ale#path#FindNearestDirectory(buffer, directory_name) abort | |
let l:buffer_filename = fnamemodify(bufname(a:buffer), ':p') | |
let l:relative_path = finddir(a:directory_name, l:buffer_filename . ';') | |
if !empty(l:relative_path) | |
return fnamemodify(l:relative_path, ':p') | |
endif | |
return '' | |
endfunction | |
" Given a buffer, a string to search for, an a global fallback for when | |
" the search fails, look for a file in parent paths, and if that fails, | |
" use the global fallback path instead. | |
1 0.000002 function! ale#path#ResolveLocalPath(buffer, search_string, global_fallback) abort | |
" Search for a locally installed file first. | |
let l:path = ale#path#FindNearestFile(a:buffer, a:search_string) | |
" If the serach fails, try the global executable instead. | |
if empty(l:path) | |
let l:path = a:global_fallback | |
endif | |
return l:path | |
endfunction | |
" Output 'cd <directory> && ' | |
" This function can be used changing the directory for a linter command. | |
1 0.000002 function! ale#path#CdString(directory) abort | |
return 'cd ' . ale#Escape(a:directory) . ' && ' | |
endfunction | |
" Output 'cd <buffer_filename_directory> && ' | |
" This function can be used changing the directory for a linter command. | |
1 0.000002 function! ale#path#BufferCdString(buffer) abort | |
return ale#path#CdString(fnamemodify(bufname(a:buffer), ':p:h')) | |
endfunction | |
" Return 1 if a path is an absolute path. | |
1 0.000002 function! ale#path#IsAbsolute(filename) abort | |
" Check for /foo and C:\foo, etc. | |
return a:filename[:0] is# '/' || a:filename[1:2] is# ':\' | |
endfunction | |
1 0.000009 let s:temp_dir = fnamemodify(tempname(), ':h') | |
" Given a filename, return 1 if the file represents some temporary file | |
" created by Vim. | |
1 0.000002 function! ale#path#IsTempName(filename) abort | |
return a:filename[:len(s:temp_dir) - 1] is# s:temp_dir | |
endfunction | |
" Given a base directory, which must not have a trailing slash, and a | |
" filename, which may have an absolute path a path relative to the base | |
" directory, return the absolute path to the file. | |
1 0.000002 function! ale#path#GetAbsPath(base_directory, filename) abort | |
if ale#path#IsAbsolute(a:filename) | |
return a:filename | |
endif | |
let l:sep = has('win32') ? '\' : '/' | |
return ale#path#Simplify(a:base_directory . l:sep . a:filename) | |
endfunction | |
" Given a buffer number and a relative or absolute path, return 1 if the | |
" two paths represent the same file on disk. | |
1 0.000004 function! ale#path#IsBufferPath(buffer, complex_filename) abort | |
" If the path is one of many different names for stdin, we have a match. | |
if a:complex_filename is# '-' | |
\|| a:complex_filename is# 'stdin' | |
\|| a:complex_filename[:0] is# '<' | |
return 1 | |
endif | |
let l:test_filename = ale#path#Simplify(a:complex_filename) | |
if l:test_filename[:1] is# './' | |
let l:test_filename = l:test_filename[2:] | |
endif | |
if l:test_filename[:1] is# '..' | |
" Remove ../../ etc. from the front of the path. | |
let l:test_filename = substitute(l:test_filename, '\v^(\.\.[/\\])+', '/', '') | |
endif | |
" Use the basename for temporary files, as they are likely our files. | |
if ale#path#IsTempName(l:test_filename) | |
let l:test_filename = fnamemodify(l:test_filename, ':t') | |
endif | |
let l:buffer_filename = expand('#' . a:buffer . ':p') | |
return l:buffer_filename is# l:test_filename | |
\ || l:buffer_filename[-len(l:test_filename):] is# l:test_filename | |
endfunction | |
" Given a path, return every component of the path, moving upwards. | |
1 0.000003 function! ale#path#Upwards(path) abort | |
let l:pattern = ale#Has('win32') ? '\v/+|\\+' : '\v/+' | |
let l:sep = ale#Has('win32') ? '\' : '/' | |
let l:parts = split(ale#path#Simplify(a:path), l:pattern) | |
let l:path_list = [] | |
while !empty(l:parts) | |
call add(l:path_list, join(l:parts, l:sep)) | |
let l:parts = l:parts[:-2] | |
endwhile | |
if ale#Has('win32') && a:path =~# '^[a-zA-z]:\' | |
" Add \ to C: for C:\, etc. | |
let l:path_list[-1] .= '\' | |
elseif a:path[0] is# '/' | |
" If the path starts with /, even on Windows, add / and / to all paths. | |
call map(l:path_list, '''/'' . v:val') | |
call add(l:path_list, '/') | |
endif | |
return l:path_list | |
endfunction | |
" Convert a filesystem path to a file:// URI | |
" relatives paths will not be prefixed with the protocol. | |
" For Windows paths, the `:` in C:\ etc. will not be percent-encoded. | |
1 0.000003 function! ale#path#ToURI(path) abort | |
let l:has_drive_letter = a:path[1:2] is# ':\' | |
return substitute( | |
\ ((l:has_drive_letter || a:path[:0] is# '/') ? 'file://' : '') | |
\ . (l:has_drive_letter ? '/' . a:path[:2] : '') | |
\ . ale#uri#Encode(l:has_drive_letter ? a:path[3:] : a:path), | |
\ '\\', | |
\ '/', | |
\ 'g', | |
\) | |
endfunction | |
1 0.000002 function! ale#path#FromURI(uri) abort | |
let l:i = len('file://') | |
let l:encoded_path = a:uri[: l:i - 1] is# 'file://' ? a:uri[l:i :] : a:uri | |
return ale#uri#Decode(l:encoded_path) | |
endfunction | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale/history.vim | |
Sourced 1 time | |
Total time: 0.000209 | |
Self time: 0.000209 | |
count total (s) self (s) | |
" Author: w0rp <devw0rp@gmail.com> | |
" Description: Tools for managing command history | |
" Return a shallow copy of the command history for a given buffer number. | |
1 0.000012 function! ale#history#Get(buffer) abort | |
return copy(getbufvar(a:buffer, 'ale_history', [])) | |
endfunction | |
1 0.000005 function! ale#history#Add(buffer, status, job_id, command) abort | |
if g:ale_max_buffer_history_size <= 0 | |
" Don't save anything if the history isn't a positive number. | |
call setbufvar(a:buffer, 'ale_history', []) | |
return | |
endif | |
let l:history = getbufvar(a:buffer, 'ale_history', []) | |
" Remove the first item if we hit the max history size. | |
if len(l:history) >= g:ale_max_buffer_history_size | |
let l:history = l:history[1:] | |
endif | |
call add(l:history, { | |
\ 'status': a:status, | |
\ 'job_id': a:job_id, | |
\ 'command': a:command, | |
\}) | |
call setbufvar(a:buffer, 'ale_history', l:history) | |
endfunction | |
1 0.000031 function! s:FindHistoryItem(buffer, job_id) abort | |
" Search backwards to find a matching job ID. IDs might be recycled, | |
" so finding the last one should be good enough. | |
for l:obj in reverse(ale#history#Get(a:buffer)) | |
if l:obj.job_id == a:job_id | |
return l:obj | |
endif | |
endfor | |
return {} | |
endfunction | |
" Set an exit code for a command which finished. | |
1 0.000081 function! ale#history#SetExitCode(buffer, job_id, exit_code) abort | |
let l:obj = s:FindHistoryItem(a:buffer, a:job_id) | |
" If we find a match, then set the code and status. | |
let l:obj.exit_code = a:exit_code | |
let l:obj.status = 'finished' | |
endfunction | |
" Set the output for a command which finished. | |
1 0.000024 function! ale#history#RememberOutput(buffer, job_id, output) abort | |
let l:obj = s:FindHistoryItem(a:buffer, a:job_id) | |
let l:obj.output = a:output | |
endfunction | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale/command.vim | |
Sourced 1 time | |
Total time: 0.000061 | |
Self time: 0.000061 | |
count total (s) self (s) | |
" Author: w0rp <devw0rp@gmail.com> | |
" Description: Special command formatting for creating temporary files and | |
" passing buffer filenames easily. | |
1 0.000009 function! s:TemporaryFilename(buffer) abort | |
let l:filename = fnamemodify(bufname(a:buffer), ':t') | |
if empty(l:filename) | |
" If the buffer's filename is empty, create a dummy filename. | |
let l:ft = getbufvar(a:buffer, '&filetype') | |
let l:filename = 'file' . ale#filetypes#GuessExtension(l:ft) | |
endif | |
" Create a temporary filename, <temp_dir>/<original_basename> | |
" The file itself will not be created by this function. | |
return tempname() . (has('win32') ? '\' : '/') . l:filename | |
endfunction | |
" Given a command string, replace every... | |
" %s -> with the current filename | |
" %t -> with the name of an unused file in a temporary directory | |
" %% -> with a literal % | |
1 0.000005 function! ale#command#FormatCommand(buffer, command, pipe_file_if_needed) abort | |
let l:temporary_file = '' | |
let l:command = a:command | |
" First replace all uses of %%, used for literal percent characters, | |
" with an ugly string. | |
let l:command = substitute(l:command, '%%', '<<PERCENTS>>', 'g') | |
" Replace all %s occurrences in the string with the name of the current | |
" file. | |
if l:command =~# '%s' | |
let l:filename = fnamemodify(bufname(a:buffer), ':p') | |
let l:command = substitute(l:command, '%s', '\=ale#Escape(l:filename)', 'g') | |
endif | |
if l:command =~# '%t' | |
" Create a temporary filename, <temp_dir>/<original_basename> | |
" The file itself will not be created by this function. | |
let l:temporary_file = s:TemporaryFilename(a:buffer) | |
let l:command = substitute(l:command, '%t', '\=ale#Escape(l:temporary_file)', 'g') | |
endif | |
" Finish formatting so %% becomes %. | |
let l:command = substitute(l:command, '<<PERCENTS>>', '%', 'g') | |
if a:pipe_file_if_needed && empty(l:temporary_file) | |
" If we are to send the Vim buffer to a command, we'll do it | |
" in the shell. We'll write out the file to a temporary file, | |
" and then read it back in, in the shell. | |
let l:temporary_file = s:TemporaryFilename(a:buffer) | |
let l:command = l:command . ' < ' . ale#Escape(l:temporary_file) | |
endif | |
return [l:temporary_file, l:command] | |
endfunction | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale/job.vim | |
Sourced 1 time | |
Total time: 0.000291 | |
Self time: 0.000291 | |
count total (s) self (s) | |
" Author: w0rp <devw0rp@gmail.com> | |
" Description: APIs for working with Asynchronous jobs, with an API normalised | |
" between Vim 8 and NeoVim. | |
" | |
" Important functions are described below. They are: | |
" | |
" ale#job#Start(command, options) -> job_id | |
" ale#job#IsRunning(job_id) -> 1 if running, 0 otherwise. | |
" ale#job#Stop(job_id) | |
1 0.000010 if !has_key(s:, 'job_map') | |
1 0.000004 let s:job_map = {} | |
1 0.000014 endif | |
" A map from timer IDs to jobs, for tracking jobs that need to be killed | |
" with SIGKILL if they don't terminate right away. | |
1 0.000004 if !has_key(s:, 'job_kill_timers') | |
1 0.000004 let s:job_kill_timers = {} | |
1 0.000001 endif | |
1 0.000006 function! s:KillHandler(timer) abort | |
let l:job = remove(s:job_kill_timers, a:timer) | |
call job_stop(l:job, 'kill') | |
endfunction | |
" Note that jobs and IDs are the same thing on NeoVim. | |
1 0.000005 function! ale#job#JoinNeovimOutput(job, last_line, data, mode, callback) abort | |
let l:lines = a:data[:-2] | |
if len(a:data) > 1 | |
let l:lines[0] = a:last_line . l:lines[0] | |
let l:new_last_line = a:data[-1] | |
else | |
let l:new_last_line = a:last_line . a:data[0] | |
endif | |
if a:mode is# 'raw' | |
if !empty(l:lines) | |
call a:callback(a:job, join(l:lines, "\n") . "\n") | |
endif | |
else | |
for l:line in l:lines | |
call a:callback(a:job, l:line) | |
endfor | |
endif | |
return l:new_last_line | |
endfunction | |
1 0.000003 function! s:NeoVimCallback(job, data, event) abort | |
let l:info = s:job_map[a:job] | |
if a:event is# 'stdout' | |
let l:info.out_cb_line = ale#job#JoinNeovimOutput( | |
\ a:job, | |
\ l:info.out_cb_line, | |
\ a:data, | |
\ l:info.mode, | |
\ ale#util#GetFunction(l:info.out_cb), | |
\) | |
elseif a:event is# 'stderr' | |
let l:info.err_cb_line = ale#job#JoinNeovimOutput( | |
\ a:job, | |
\ l:info.err_cb_line, | |
\ a:data, | |
\ l:info.mode, | |
\ ale#util#GetFunction(l:info.err_cb), | |
\) | |
else | |
if has_key(l:info, 'out_cb') && !empty(l:info.out_cb_line) | |
call ale#util#GetFunction(l:info.out_cb)(a:job, l:info.out_cb_line) | |
endif | |
if has_key(l:info, 'err_cb') && !empty(l:info.err_cb_line) | |
call ale#util#GetFunction(l:info.err_cb)(a:job, l:info.err_cb_line) | |
endif | |
try | |
call ale#util#GetFunction(l:info.exit_cb)(a:job, a:data) | |
finally | |
" Automatically forget about the job after it's done. | |
if has_key(s:job_map, a:job) | |
call remove(s:job_map, a:job) | |
endif | |
endtry | |
endif | |
endfunction | |
1 0.000003 function! s:VimOutputCallback(channel, data) abort | |
let l:job = ch_getjob(a:channel) | |
let l:job_id = ale#job#ParseVim8ProcessID(string(l:job)) | |
" Only call the callbacks for jobs which are valid. | |
if l:job_id > 0 && has_key(s:job_map, l:job_id) | |
call ale#util#GetFunction(s:job_map[l:job_id].out_cb)(l:job_id, a:data) | |
endif | |
endfunction | |
1 0.000002 function! s:VimErrorCallback(channel, data) abort | |
let l:job = ch_getjob(a:channel) | |
let l:job_id = ale#job#ParseVim8ProcessID(string(l:job)) | |
" Only call the callbacks for jobs which are valid. | |
if l:job_id > 0 && has_key(s:job_map, l:job_id) | |
call ale#util#GetFunction(s:job_map[l:job_id].err_cb)(l:job_id, a:data) | |
endif | |
endfunction | |
1 0.000002 function! s:VimCloseCallback(channel) abort | |
let l:job = ch_getjob(a:channel) | |
let l:job_id = ale#job#ParseVim8ProcessID(string(l:job)) | |
let l:info = get(s:job_map, l:job_id, {}) | |
if empty(l:info) | |
return | |
endif | |
" job_status() can trigger the exit handler. | |
" The channel can close before the job has exited. | |
if job_status(l:job) is# 'dead' | |
try | |
if !empty(l:info) && has_key(l:info, 'exit_cb') | |
call ale#util#GetFunction(l:info.exit_cb)(l:job_id, l:info.exit_code) | |
endif | |
finally | |
" Automatically forget about the job after it's done. | |
if has_key(s:job_map, l:job_id) | |
call remove(s:job_map, l:job_id) | |
endif | |
endtry | |
endif | |
endfunction | |
1 0.000003 function! s:VimExitCallback(job, exit_code) abort | |
let l:job_id = ale#job#ParseVim8ProcessID(string(a:job)) | |
let l:info = get(s:job_map, l:job_id, {}) | |
if empty(l:info) | |
return | |
endif | |
let l:info.exit_code = a:exit_code | |
" The program can exit before the data has finished being read. | |
if ch_status(job_getchannel(a:job)) is# 'closed' | |
try | |
if !empty(l:info) && has_key(l:info, 'exit_cb') | |
call ale#util#GetFunction(l:info.exit_cb)(l:job_id, a:exit_code) | |
endif | |
finally | |
" Automatically forget about the job after it's done. | |
if has_key(s:job_map, l:job_id) | |
call remove(s:job_map, l:job_id) | |
endif | |
endtry | |
endif | |
endfunction | |
1 0.000003 function! ale#job#ParseVim8ProcessID(job_string) abort | |
return matchstr(a:job_string, '\d\+') + 0 | |
endfunction | |
1 0.000003 function! ale#job#ValidateArguments(command, options) abort | |
if a:options.mode isnot# 'nl' && a:options.mode isnot# 'raw' | |
throw 'Invalid mode: ' . a:options.mode | |
endif | |
endfunction | |
1 0.000003 function! ale#job#PrepareCommand(command) abort | |
" The command will be executed in a subshell. This fixes a number of | |
" issues, including reading the PATH variables correctly, %PATHEXT% | |
" expansion on Windows, etc. | |
" | |
" NeoVim handles this issue automatically if the command is a String, | |
" but we'll do this explicitly, so we use thes same exact command for both | |
" versions. | |
if ale#Has('win32') | |
return 'cmd /c ' . a:command | |
endif | |
if &shell =~? 'fish$' | |
return ['/bin/sh', '-c', a:command] | |
endif | |
return split(&shell) + split(&shellcmdflag) + [a:command] | |
endfunction | |
" Start a job with options which are agnostic to Vim and NeoVim. | |
" | |
" The following options are accepted: | |
" | |
" out_cb - A callback for receiving stdin. Arguments: (job_id, data) | |
" err_cb - A callback for receiving stderr. Arguments: (job_id, data) | |
" exit_cb - A callback for program exit. Arguments: (job_id, status_code) | |
" mode - A mode for I/O. Can be 'nl' for split lines or 'raw'. | |
1 0.000003 function! ale#job#Start(command, options) abort | |
call ale#job#ValidateArguments(a:command, a:options) | |
let l:job_info = copy(a:options) | |
let l:job_options = {} | |
if has('nvim') | |
if has_key(a:options, 'out_cb') | |
let l:job_options.on_stdout = function('s:NeoVimCallback') | |
let l:job_info.out_cb_line = '' | |
endif | |
if has_key(a:options, 'err_cb') | |
let l:job_options.on_stderr = function('s:NeoVimCallback') | |
let l:job_info.err_cb_line = '' | |
endif | |
if has_key(a:options, 'exit_cb') | |
let l:job_options.on_exit = function('s:NeoVimCallback') | |
endif | |
let l:job_info.job = jobstart(a:command, l:job_options) | |
let l:job_id = l:job_info.job | |
else | |
let l:job_options = { | |
\ 'in_mode': l:job_info.mode, | |
\ 'out_mode': l:job_info.mode, | |
\ 'err_mode': l:job_info.mode, | |
\} | |
if has_key(a:options, 'out_cb') | |
let l:job_options.out_cb = function('s:VimOutputCallback') | |
endif | |
if has_key(a:options, 'err_cb') | |
let l:job_options.err_cb = function('s:VimErrorCallback') | |
endif | |
if has_key(a:options, 'exit_cb') | |
" Set a close callback to which simply calls job_status() | |
" when the channel is closed, which can trigger the exit callback | |
" earlier on. | |
let l:job_options.close_cb = function('s:VimCloseCallback') | |
let l:job_options.exit_cb = function('s:VimExitCallback') | |
endif | |
" Vim 8 will read the stdin from the file's buffer. | |
let l:job_info.job = job_start(a:command, l:job_options) | |
let l:job_id = ale#job#ParseVim8ProcessID(string(l:job_info.job)) | |
endif | |
if l:job_id > 0 | |
" Store the job in the map for later only if we can get the ID. | |
let s:job_map[l:job_id] = l:job_info | |
endif | |
return l:job_id | |
endfunction | |
" Send raw data to the job. | |
1 0.000004 function! ale#job#SendRaw(job_id, string) abort | |
if has('nvim') | |
call jobsend(a:job_id, a:string) | |
else | |
call ch_sendraw(job_getchannel(s:job_map[a:job_id].job), a:string) | |
endif | |
endfunction | |
" Given a job ID, return 1 if the job is currently running. | |
" Invalid job IDs will be ignored. | |
1 0.000002 function! ale#job#IsRunning(job_id) abort | |
if has('nvim') | |
try | |
" In NeoVim, if the job isn't running, jobpid() will throw. | |
call jobpid(a:job_id) | |
return 1 | |
catch | |
endtry | |
elseif has_key(s:job_map, a:job_id) | |
let l:job = s:job_map[a:job_id].job | |
return job_status(l:job) is# 'run' | |
endif | |
return 0 | |
endfunction | |
" Given a Job ID, stop that job. | |
" Invalid job IDs will be ignored. | |
1 0.000002 function! ale#job#Stop(job_id) abort | |
if !has_key(s:job_map, a:job_id) | |
return | |
endif | |
if has('nvim') | |
" FIXME: NeoVim kills jobs on a timer, but will not kill any processes | |
" which are child processes on Unix. Some work needs to be done to | |
" kill child processes to stop long-running processes like pylint. | |
call jobstop(a:job_id) | |
else | |
let l:job = s:job_map[a:job_id].job | |
" We must close the channel for reading the buffer if it is open | |
" when stopping a job. Otherwise, we will get errors in the status line. | |
if ch_status(job_getchannel(l:job)) is# 'open' | |
call ch_close_in(job_getchannel(l:job)) | |
endif | |
" Ask nicely for the job to stop. | |
call job_stop(l:job) | |
if ale#job#IsRunning(l:job) | |
" Set a 100ms delay for killing the job with SIGKILL. | |
let s:job_kill_timers[timer_start(100, function('s:KillHandler'))] = l:job | |
endif | |
endif | |
endfunction | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale/cursor.vim | |
Sourced 1 time | |
Total time: 0.000191 | |
Self time: 0.000191 | |
count total (s) self (s) | |
" Author: w0rp <devw0rp@gmail.com> | |
" Description: Echoes lint message for the current line, if any | |
1 0.000011 let s:cursor_timer = -1 | |
1 0.000004 let s:last_pos = [0, 0, 0] | |
" Return a formatted message according to g:ale_echo_msg_format variable | |
1 0.000023 function! s:GetMessage(linter, type, text) abort | |
let l:msg = g:ale_echo_msg_format | |
let l:type = a:type is# 'E' | |
\ ? g:ale_echo_msg_error_str | |
\ : g:ale_echo_msg_warning_str | |
" Replace handlers if they exist | |
for [l:k, l:v] in items({'linter': a:linter, 'severity': l:type}) | |
let l:msg = substitute(l:msg, '\V%' . l:k . '%', l:v, '') | |
endfor | |
return printf(l:msg, a:text) | |
endfunction | |
1 0.000005 function! s:EchoWithShortMess(setting, message) abort | |
" We need to remember the setting for shormess and reset it again. | |
let l:shortmess_options = getbufvar('%', '&shortmess') | |
try | |
" Turn shortmess on or off. | |
if a:setting is# 'on' | |
setlocal shortmess+=T | |
" echomsg is needed for the message to get truncated and appear in | |
" the message history. | |
exec "norm! :echomsg a:message\n" | |
elseif a:setting is# 'off' | |
setlocal shortmess-=T | |
" Regular echo is needed for printing newline characters. | |
echo a:message | |
else | |
throw 'Invalid setting: ' . string(a:setting) | |
endif | |
finally | |
call setbufvar('%', '&shortmess', l:shortmess_options) | |
endtry | |
endfunction | |
1 0.000004 function! ale#cursor#TruncatedEcho(message) abort | |
let l:message = a:message | |
" Change tabs to spaces. | |
let l:message = substitute(l:message, "\t", ' ', 'g') | |
" Remove any newlines in the message. | |
let l:message = substitute(l:message, "\n", '', 'g') | |
call s:EchoWithShortMess('on', l:message) | |
endfunction | |
1 0.000003 function! s:FindItemAtCursor() abort | |
let l:buf = bufnr('') | |
let l:info = get(g:ale_buffer_info, l:buf, {}) | |
let l:loclist = get(l:info, 'loclist', []) | |
let l:pos = getcurpos() | |
let l:index = ale#util#BinarySearch(l:loclist, l:buf, l:pos[1], l:pos[2]) | |
let l:loc = l:index >= 0 ? l:loclist[l:index] : {} | |
return [l:info, l:loc] | |
endfunction | |
1 0.000003 function! s:StopCursorTimer() abort | |
if s:cursor_timer != -1 | |
call timer_stop(s:cursor_timer) | |
let s:cursor_timer = -1 | |
endif | |
endfunction | |
1 0.000003 function! ale#cursor#EchoCursorWarning(...) abort | |
return ale#CallWithCooldown('dont_echo_until', function('s:EchoImpl'), []) | |
endfunction | |
1 0.000002 function! s:EchoImpl() abort | |
" Only echo the warnings in normal mode, otherwise we will get problems. | |
if mode() isnot# 'n' | |
return | |
endif | |
if ale#ShouldDoNothing(bufnr('')) | |
return | |
endif | |
let [l:info, l:loc] = s:FindItemAtCursor() | |
if !empty(l:loc) | |
let l:msg = s:GetMessage(l:loc.linter_name, l:loc.type, l:loc.text) | |
call ale#cursor#TruncatedEcho(l:msg) | |
let l:info.echoed = 1 | |
elseif get(l:info, 'echoed') | |
" We'll only clear the echoed message when moving off errors once, | |
" so we don't continually clear the echo line. | |
echo | |
let l:info.echoed = 0 | |
endif | |
endfunction | |
1 0.000004 function! ale#cursor#EchoCursorWarningWithDelay() abort | |
" Only echo the warnings in normal mode, otherwise we will get problems. | |
if mode() isnot# 'n' | |
return | |
endif | |
call s:StopCursorTimer() | |
let l:pos = getcurpos()[0:2] | |
" Check the current buffer, line, and column number against the last | |
" recorded position. If the position has actually changed, *then* | |
" we should echo something. Otherwise we can end up doing processing | |
" the echo message far too frequently. | |
if l:pos != s:last_pos | |
let l:delay = ale#Var(bufnr(''), 'echo_delay') | |
let s:last_pos = l:pos | |
let s:cursor_timer = timer_start( | |
\ l:delay, | |
\ function('ale#cursor#EchoCursorWarning') | |
\) | |
endif | |
endfunction | |
1 0.000004 function! ale#cursor#ShowCursorDetail() abort | |
" Only echo the warnings in normal mode, otherwise we will get problems. | |
if mode() isnot# 'n' | |
return | |
endif | |
if ale#ShouldDoNothing(bufnr('')) | |
return | |
endif | |
call s:StopCursorTimer() | |
let [l:info, l:loc] = s:FindItemAtCursor() | |
if !empty(l:loc) | |
let l:message = get(l:loc, 'detail', l:loc.text) | |
call s:EchoWithShortMess('off', l:message) | |
" Set the echo marker, so we can clear it by moving the cursor. | |
let l:info.echoed = 1 | |
endif | |
endfunction | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale/sign.vim | |
Sourced 1 time | |
Total time: 0.000630 | |
Self time: 0.000519 | |
count total (s) self (s) | |
scriptencoding utf8 | |
" Author: w0rp <devw0rp@gmail.com> | |
" Description: Draws error and warning signs into signcolumn | |
1 0.000017 if !hlexists('ALEErrorSign') | |
1 0.000011 highlight link ALEErrorSign error | |
1 0.000001 endif | |
1 0.000006 if !hlexists('ALEStyleErrorSign') | |
1 0.000005 highlight link ALEStyleErrorSign ALEErrorSign | |
1 0.000001 endif | |
1 0.000005 if !hlexists('ALEWarningSign') | |
1 0.000007 highlight link ALEWarningSign todo | |
1 0.000001 endif | |
1 0.000005 if !hlexists('ALEStyleWarningSign') | |
1 0.000005 highlight link ALEStyleWarningSign ALEWarningSign | |
1 0.000001 endif | |
1 0.000004 if !hlexists('ALEInfoSign') | |
1 0.000005 highlight link ALEInfoSign ALEWarningSign | |
1 0.000001 endif | |
1 0.000005 if !hlexists('ALESignColumnWithErrors') | |
1 0.000007 highlight link ALESignColumnWithErrors error | |
1 0.000001 endif | |
1 0.000005 if !hlexists('ALESignColumnWithoutErrors') | |
1 0.000006 function! s:SetSignColumnWithoutErrorsHighlight() abort | |
redir => l:output | |
silent highlight SignColumn | |
redir end | |
let l:highlight_syntax = join(split(l:output)[2:]) | |
let l:match = matchlist(l:highlight_syntax, '\vlinks to (.+)$') | |
if !empty(l:match) | |
execute 'highlight link ALESignColumnWithoutErrors ' . l:match[1] | |
elseif l:highlight_syntax isnot# 'cleared' | |
execute 'highlight ALESignColumnWithoutErrors ' . l:highlight_syntax | |
endif | |
endfunction | |
1 0.000124 0.000013 call s:SetSignColumnWithoutErrorsHighlight() | |
1 0.000005 delfunction s:SetSignColumnWithoutErrorsHighlight | |
1 0.000001 endif | |
" Signs show up on the left for error markers. | |
1 0.000016 execute 'sign define ALEErrorSign text=' . g:ale_sign_error | |
\ . ' texthl=ALEErrorSign linehl=ALEErrorLine' | |
1 0.000010 execute 'sign define ALEStyleErrorSign text=' . g:ale_sign_style_error | |
\ . ' texthl=ALEStyleErrorSign linehl=ALEErrorLine' | |
1 0.000012 execute 'sign define ALEWarningSign text=' . g:ale_sign_warning | |
\ . ' texthl=ALEWarningSign linehl=ALEWarningLine' | |
1 0.000009 execute 'sign define ALEStyleWarningSign text=' . g:ale_sign_style_warning | |
\ . ' texthl=ALEStyleWarningSign linehl=ALEWarningLine' | |
1 0.000013 execute 'sign define ALEInfoSign text=' . g:ale_sign_info | |
\ . ' texthl=ALEInfoSign linehl=ALEInfoLine' | |
1 0.000002 sign define ALEDummySign | |
1 0.000004 let s:error_priority = 1 | |
1 0.000003 let s:warning_priority = 2 | |
1 0.000004 let s:info_priority = 3 | |
1 0.000003 let s:style_error_priority = 4 | |
1 0.000003 let s:style_warning_priority = 5 | |
1 0.000006 function! ale#sign#GetSignName(sublist) abort | |
let l:priority = s:style_warning_priority | |
" Determine the highest priority item for the line. | |
for l:item in a:sublist | |
if l:item.type is# 'I' | |
let l:item_priority = s:info_priority | |
elseif l:item.type is# 'W' | |
if get(l:item, 'sub_type', '') is# 'style' | |
let l:item_priority = s:style_warning_priority | |
else | |
let l:item_priority = s:warning_priority | |
endif | |
else | |
if get(l:item, 'sub_type', '') is# 'style' | |
let l:item_priority = s:style_error_priority | |
else | |
let l:item_priority = s:error_priority | |
endif | |
endif | |
if l:item_priority < l:priority | |
let l:priority = l:item_priority | |
endif | |
endfor | |
if l:priority is# s:error_priority | |
return 'ALEErrorSign' | |
endif | |
if l:priority is# s:warning_priority | |
return 'ALEWarningSign' | |
endif | |
if l:priority is# s:style_error_priority | |
return 'ALEStyleErrorSign' | |
endif | |
if l:priority is# s:style_warning_priority | |
return 'ALEStyleWarningSign' | |
endif | |
if l:priority is# s:info_priority | |
return 'ALEInfoSign' | |
endif | |
" Use the error sign for invalid severities. | |
return 'ALEErrorSign' | |
endfunction | |
" Read sign data for a buffer to a list of lines. | |
1 0.000004 function! ale#sign#ReadSigns(buffer) abort | |
redir => l:output | |
silent execute 'sign place buffer=' . a:buffer | |
redir end | |
return split(l:output, "\n") | |
endfunction | |
" Given a list of lines for sign output, return a List of [line, id, group] | |
1 0.000004 function! ale#sign#ParseSigns(line_list) abort | |
" Matches output like : | |
" line=4 id=1 name=ALEErrorSign | |
" строка=1 id=1000001 имя=ALEErrorSign | |
" 行=1 識別子=1000001 名前=ALEWarningSign | |
" línea=12 id=1000001 nombre=ALEWarningSign | |
" riga=1 id=1000001, nome=ALEWarningSign | |
let l:pattern = '\v^.*\=(\d+).*\=(\d+).*\=(ALE[a-zA-Z]+Sign)' | |
let l:result = [] | |
let l:is_dummy_sign_set = 0 | |
for l:line in a:line_list | |
let l:match = matchlist(l:line, l:pattern) | |
if len(l:match) > 0 | |
if l:match[3] is# 'ALEDummySign' | |
let l:is_dummy_sign_set = 1 | |
else | |
call add(l:result, [ | |
\ str2nr(l:match[1]), | |
\ str2nr(l:match[2]), | |
\ l:match[3], | |
\]) | |
endif | |
endif | |
endfor | |
return [l:is_dummy_sign_set, l:result] | |
endfunction | |
1 0.000004 function! ale#sign#FindCurrentSigns(buffer) abort | |
let l:line_list = ale#sign#ReadSigns(a:buffer) | |
return ale#sign#ParseSigns(l:line_list) | |
endfunction | |
" Given a loclist, group the List into with one List per line. | |
1 0.000005 function! s:GroupLoclistItems(buffer, loclist) abort | |
let l:grouped_items = [] | |
let l:last_lnum = -1 | |
for l:obj in a:loclist | |
if l:obj.bufnr != a:buffer | |
continue | |
endif | |
" Create a new sub-List when we hit a new line. | |
if l:obj.lnum != l:last_lnum | |
call add(l:grouped_items, []) | |
endif | |
call add(l:grouped_items[-1], l:obj) | |
let l:last_lnum = l:obj.lnum | |
endfor | |
return l:grouped_items | |
endfunction | |
1 0.000003 function! s:UpdateLineNumbers(buffer, current_sign_list, loclist) abort | |
let l:line_map = {} | |
let l:line_numbers_changed = 0 | |
for [l:line, l:sign_id, l:name] in a:current_sign_list | |
let l:line_map[l:sign_id] = l:line | |
endfor | |
for l:item in a:loclist | |
if l:item.bufnr == a:buffer | |
let l:lnum = get(l:line_map, get(l:item, 'sign_id', 0), 0) | |
if l:lnum && l:item.lnum != l:lnum | |
let l:item.lnum = l:lnum | |
let l:line_numbers_changed = 1 | |
endif | |
endif | |
endfor | |
" When the line numbers change, sort the list again | |
if l:line_numbers_changed | |
call sort(a:loclist, 'ale#util#LocItemCompare') | |
endif | |
endfunction | |
1 0.000004 function! s:BuildSignMap(buffer, current_sign_list, grouped_items) abort | |
let l:max_signs = ale#Var(a:buffer, 'max_signs') | |
if l:max_signs is 0 | |
let l:selected_grouped_items = [] | |
elseif type(l:max_signs) is type(0) && l:max_signs > 0 | |
let l:selected_grouped_items = a:grouped_items[:l:max_signs - 1] | |
else | |
let l:selected_grouped_items = a:grouped_items | |
endif | |
let l:sign_map = {} | |
let l:sign_offset = g:ale_sign_offset | |
for [l:line, l:sign_id, l:name] in a:current_sign_list | |
let l:sign_info = get(l:sign_map, l:line, { | |
\ 'current_id_list': [], | |
\ 'current_name_list': [], | |
\ 'new_id': 0, | |
\ 'new_name': '', | |
\ 'items': [], | |
\}) | |
" Increment the sign offset for new signs, by the maximum sign ID. | |
if l:sign_id > l:sign_offset | |
let l:sign_offset = l:sign_id | |
endif | |
" Remember the sign names and IDs in separate Lists, so they are easy | |
" to work with. | |
call add(l:sign_info.current_id_list, l:sign_id) | |
call add(l:sign_info.current_name_list, l:name) | |
let l:sign_map[l:line] = l:sign_info | |
endfor | |
for l:group in l:selected_grouped_items | |
let l:line = l:group[0].lnum | |
let l:sign_info = get(l:sign_map, l:line, { | |
\ 'current_id_list': [], | |
\ 'current_name_list': [], | |
\ 'new_id': 0, | |
\ 'new_name': '', | |
\ 'items': [], | |
\}) | |
let l:sign_info.new_name = ale#sign#GetSignName(l:group) | |
let l:sign_info.items = l:group | |
let l:index = index( | |
\ l:sign_info.current_name_list, | |
\ l:sign_info.new_name | |
\) | |
if l:index >= 0 | |
" We have a sign with this name already, so use the same ID. | |
let l:sign_info.new_id = l:sign_info.current_id_list[l:index] | |
else | |
" This sign name replaces the previous name, so use a new ID. | |
let l:sign_info.new_id = l:sign_offset + 1 | |
let l:sign_offset += 1 | |
endif | |
let l:sign_map[l:line] = l:sign_info | |
endfor | |
return l:sign_map | |
endfunction | |
1 0.000004 function! ale#sign#GetSignCommands(buffer, was_sign_set, sign_map) abort | |
let l:command_list = [] | |
let l:is_dummy_sign_set = a:was_sign_set | |
" Set the dummy sign if we need to. | |
" The dummy sign is needed to keep the sign column open while we add | |
" and remove signs. | |
if !l:is_dummy_sign_set && (!empty(a:sign_map) || g:ale_sign_column_always) | |
call add(l:command_list, 'sign place ' | |
\ . g:ale_sign_offset | |
\ . ' line=1 name=ALEDummySign buffer=' | |
\ . a:buffer | |
\) | |
let l:is_dummy_sign_set = 1 | |
endif | |
" Place new items first. | |
for [l:line_str, l:info] in items(a:sign_map) | |
if l:info.new_id | |
" Save the sign IDs we are setting back on our loclist objects. | |
" These IDs will be used to preserve items which are set many times. | |
for l:item in l:info.items | |
let l:item.sign_id = l:info.new_id | |
endfor | |
if index(l:info.current_id_list, l:info.new_id) < 0 | |
call add(l:command_list, 'sign place ' | |
\ . (l:info.new_id) | |
\ . ' line=' . l:line_str | |
\ . ' name=' . (l:info.new_name) | |
\ . ' buffer=' . a:buffer | |
\) | |
endif | |
endif | |
endfor | |
" Remove signs without new IDs. | |
for l:info in values(a:sign_map) | |
for l:current_id in l:info.current_id_list | |
if l:current_id isnot l:info.new_id | |
call add(l:command_list, 'sign unplace ' | |
\ . l:current_id | |
\ . ' buffer=' . a:buffer | |
\) | |
endif | |
endfor | |
endfor | |
" Remove the dummy sign to close the sign column if we need to. | |
if l:is_dummy_sign_set && !g:ale_sign_column_always | |
call add(l:command_list, 'sign unplace ' | |
\ . g:ale_sign_offset | |
\ . ' buffer=' . a:buffer | |
\) | |
endif | |
return l:command_list | |
endfunction | |
" This function will set the signs which show up on the left. | |
1 0.000003 function! ale#sign#SetSigns(buffer, loclist) abort | |
if !bufexists(str2nr(a:buffer)) | |
" Stop immediately when attempting to set signs for a buffer which | |
" does not exist. | |
return | |
endif | |
" Find the current markers | |
let [l:is_dummy_sign_set, l:current_sign_list] = | |
\ ale#sign#FindCurrentSigns(a:buffer) | |
" Update the line numbers for items from before which may have moved. | |
call s:UpdateLineNumbers(a:buffer, l:current_sign_list, a:loclist) | |
" Group items after updating the line numbers. | |
let l:grouped_items = s:GroupLoclistItems(a:buffer, a:loclist) | |
" Build a map of current and new signs, with the lines as the keys. | |
let l:sign_map = s:BuildSignMap( | |
\ a:buffer, | |
\ l:current_sign_list, | |
\ l:grouped_items, | |
\) | |
let l:command_list = ale#sign#GetSignCommands( | |
\ a:buffer, | |
\ l:is_dummy_sign_set, | |
\ l:sign_map, | |
\) | |
" Change the sign column color if the option is on. | |
if g:ale_change_sign_column_color && !empty(a:loclist) | |
highlight clear SignColumn | |
highlight link SignColumn ALESignColumnWithErrors | |
endif | |
for l:command in l:command_list | |
silent! execute l:command | |
endfor | |
" Reset the sign column color when there are no more errors. | |
if g:ale_change_sign_column_color && empty(a:loclist) | |
highlight clear SignColumn | |
highlight link SignColumn ALESignColumnWithoutErrors | |
endif | |
endfunction | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale/list.vim | |
Sourced 1 time | |
Total time: 0.000240 | |
Self time: 0.000240 | |
count total (s) self (s) | |
" Author: Bjorn Neergaard <bjorn@neersighted.com>, modified by Yann fery <yann@fery.me> | |
" Description: Manages the loclist and quickfix lists | |
1 0.000013 if !exists('s:timer_args') | |
1 0.000010 let s:timer_args = {} | |
1 0.000002 endif | |
" Return 1 if there is a buffer with buftype == 'quickfix' in bufffer list | |
1 0.000006 function! ale#list#IsQuickfixOpen() abort | |
for l:buf in range(1, bufnr('$')) | |
if getbufvar(l:buf, '&buftype') is# 'quickfix' | |
return 1 | |
endif | |
endfor | |
return 0 | |
endfunction | |
" Check if we should open the list, based on the save event being fired, and | |
" that setting being on, or the setting just being set to `1`. | |
1 0.000005 function! s:ShouldOpen(buffer) abort | |
let l:val = ale#Var(a:buffer, 'open_list') | |
let l:saved = getbufvar(a:buffer, 'ale_save_event_fired', 0) | |
return l:val is 1 || (l:val is# 'on_save' && l:saved) | |
endfunction | |
1 0.000003 function! ale#list#GetCombinedList() abort | |
let l:list = [] | |
for l:info in values(g:ale_buffer_info) | |
call extend(l:list, l:info.loclist) | |
endfor | |
call sort(l:list, function('ale#util#LocItemCompareWithText')) | |
call uniq(l:list, function('ale#util#LocItemCompareWithText')) | |
return l:list | |
endfunction | |
1 0.000004 function! s:FixList(list) abort | |
let l:new_list = [] | |
for l:item in a:list | |
if l:item.bufnr == -1 | |
" If the buffer number is invalid, remove it. | |
let l:fixed_item = copy(l:item) | |
call remove(l:fixed_item, 'bufnr') | |
else | |
" Don't copy the Dictionary if we do not need to. | |
let l:fixed_item = l:item | |
endif | |
call add(l:new_list, l:fixed_item) | |
endfor | |
return l:new_list | |
endfunction | |
1 0.000002 function! s:BufWinId(buffer) abort | |
return exists('*bufwinid') ? bufwinid(str2nr(a:buffer)) : 0 | |
endfunction | |
1 0.000003 function! s:SetListsImpl(timer_id, buffer, loclist) abort | |
let l:title = expand('#' . a:buffer . ':p') | |
if g:ale_set_quickfix | |
let l:quickfix_list = ale#list#GetCombinedList() | |
if has('nvim') | |
call setqflist(s:FixList(l:quickfix_list), ' ', l:title) | |
else | |
call setqflist(s:FixList(l:quickfix_list)) | |
call setqflist([], 'r', {'title': l:title}) | |
endif | |
elseif g:ale_set_loclist | |
" If windows support is off, bufwinid() may not exist. | |
" We'll set result in the current window, which might not be correct, | |
" but is better than nothing. | |
let l:win_id = s:BufWinId(a:buffer) | |
if has('nvim') | |
call setloclist(l:win_id, s:FixList(a:loclist), ' ', l:title) | |
else | |
call setloclist(l:win_id, s:FixList(a:loclist)) | |
call setloclist(l:win_id, [], 'r', {'title': l:title}) | |
endif | |
endif | |
" Open a window to show the problems if we need to. | |
" | |
" We'll check if the current buffer's List is not empty here, so the | |
" window will only be opened if the current buffer has problems. | |
if s:ShouldOpen(a:buffer) && !empty(a:loclist) | |
let l:winnr = winnr() | |
let l:mode = mode() | |
let l:reset_visual_selection = l:mode is? 'v' || l:mode is# "\<c-v>" | |
let l:reset_character_selection = l:mode is? 's' || l:mode is# "\<c-s>" | |
if g:ale_set_quickfix | |
if !ale#list#IsQuickfixOpen() | |
silent! execute 'copen ' . str2nr(ale#Var(a:buffer, 'list_window_size')) | |
endif | |
elseif g:ale_set_loclist | |
silent! execute 'lopen ' . str2nr(ale#Var(a:buffer, 'list_window_size')) | |
endif | |
" If focus changed, restore it (jump to the last window). | |
if l:winnr isnot# winnr() | |
wincmd p | |
endif | |
if l:reset_visual_selection || l:reset_character_selection | |
" If we were in a selection mode before, select the last selection. | |
normal! gv | |
if l:reset_character_selection | |
" Switch back to Select mode, if we were in that. | |
normal! "\<c-g>" | |
endif | |
endif | |
endif | |
" If ALE isn't currently checking for more problems, close the window if | |
" needed now. This check happens inside of this timer function, so | |
" the window can be closed reliably. | |
if !ale#engine#IsCheckingBuffer(a:buffer) | |
call s:CloseWindowIfNeeded(a:buffer) | |
endif | |
endfunction | |
1 0.000004 function! ale#list#SetLists(buffer, loclist) abort | |
if get(g:, 'ale_set_lists_synchronously') == 1 | |
\|| getbufvar(a:buffer, 'ale_save_event_fired', 0) | |
" Update lists immediately if running a test synchronously, or if the | |
" buffer was saved. | |
" | |
" The lists need to be updated immediately when saving a buffer so | |
" that we can reliably close window automatically, if so configured. | |
call s:SetListsImpl(-1, a:buffer, a:loclist) | |
else | |
call ale#util#StartPartialTimer( | |
\ 0, | |
\ function('s:SetListsImpl'), | |
\ [a:buffer, a:loclist], | |
\) | |
endif | |
endfunction | |
1 0.000003 function! s:CloseWindowIfNeeded(buffer) abort | |
if ale#Var(a:buffer, 'keep_list_window_open') || !s:ShouldOpen(a:buffer) | |
return | |
endif | |
try | |
" Only close windows if the quickfix list or loclist is completely empty, | |
" including errors set through other means. | |
if g:ale_set_quickfix | |
if empty(getqflist()) | |
cclose | |
endif | |
else | |
let l:win_id = s:BufWinId(a:buffer) | |
if g:ale_set_loclist && empty(getloclist(l:win_id)) | |
lclose | |
endif | |
endif | |
" Ignore 'Cannot close last window' errors. | |
catch /E444/ | |
endtry | |
endfunction | |
SCRIPT /home/vagrant/.config/nvim/plugged/ale/autoload/ale/highlight.vim | |
Sourced 1 time | |
Total time: 0.000264 | |
Self time: 0.000264 | |
count total (s) self (s) | |
scriptencoding utf8 | |
" Author: w0rp <devw0rp@gmail.com> | |
" Description: This module implements error/warning highlighting. | |
1 0.000017 if !hlexists('ALEError') | |
1 0.000017 highlight link ALEError SpellBad | |
1 0.000002 endif | |
1 0.000007 if !hlexists('ALEStyleError') | |
1 0.000006 highlight link ALEStyleError ALEError | |
1 0.000001 endif | |
1 0.000005 if !hlexists('ALEWarning') | |
1 0.000007 highlight link ALEWarning SpellCap | |
1 0.000001 endif | |
1 0.000005 if !hlexists('ALEStyleWarning') | |
1 0.000005 highlight link ALEStyleWarning ALEWarning | |
1 0.000001 endif | |
1 0.000005 if !hlexists('ALEInfo') | |
1 0.000004 highlight link ALEInfo ALEWarning | |
1 0.000001 endif | |
" The maximum number of items for the second argument of matchaddpos() | |
1 0.000004 let s:MAX_POS_VALUES = 8 | |
1 0.000003 let s:MAX_COL_SIZE = 1073741824 " pow(2, 30) | |
1 0.000006 function! ale#highlight#CreatePositions(line, col, end_line, end_col) abort | |
if a:line >= a:end_line | |
" For single lines, just return the one position. | |
return [[[a:line, a:col, a:end_col - a:col + 1]]] | |
endif | |
" Get positions from the first line at the first column, up to a large | |
" integer for highlighting up to the end of the line, followed by | |
" the lines in-between, for highlighting entire lines, and | |
" a highlight for the last line, up to the end column. | |
let l:all_positions = | |
\ [[a:line, a:col, s:MAX_COL_SIZE]] | |
\ + range(a:line + 1, a:end_line - 1) | |
\ + [[a:end_line, 1, a:end_col]] | |
return map( | |
\ range(0, len(l:all_positions) - 1, s:MAX_POS_VALUES), | |
\ 'l:all_positions[v:val : v:val + s:MAX_POS_VALUES - 1]', | |
\) | |
endfunction | |
" Given a loclist for current items to highlight, remove all highlights | |
" except these which have matching loclist item entries. | |
1 0.000003 function! ale#highlight#RemoveHighlights() abort | |
for l:match in getmatches() | |
if l:match.group =~# '^ALE' | |
call matchdelete(l:match.id) | |
endif | |
endfor | |
endfunction | |
1 0.000003 function! ale#highlight#UpdateHighlights() abort | |
let l:item_list = g:ale_enabled | |
\ ? get(b:, 'ale_highlight_items', []) | |
\ : [] | |
call ale#highlight#RemoveHighlights() | |
for l:item in l:item_list | |
if l:item.type is# 'W' | |
if get(l:item, 'sub_type', '') is# 'style' | |
let l:group = 'ALEStyleWarning' | |
else | |
let l:group = 'ALEWarning' | |
endif | |
elseif l:item.type is# 'I' | |
let l:group = 'ALEInfo' | |
elseif get(l:item, 'sub_type', '') is# 'style' | |
let l:group = 'ALEStyleError' | |
else | |
let l:group = 'ALEError' | |
endif | |
let l:line = l:item.lnum | |
let l:col = l:item.col | |
let l:end_line = get(l:item, 'end_lnum', l:line) | |
let l:end_col = get(l:item, 'end_col', l:col) | |
" Set all of the positions, which are chunked into Lists which | |
" are as large as will be accepted by matchaddpos. | |
call map( | |
\ ale#highlight#CreatePositions(l:line, l:col, l:end_line, l:end_col), | |
\ 'matchaddpos(l:group, v:val)' | |
\) | |
endfor | |
endfunction | |
1 0.000003 function! ale#highlight#BufferHidden(buffer) abort | |
" Remove highlights right away when buffers are hidden. | |
" They will be restored later when buffers are entered. | |
call ale#highlight#RemoveHighlights() | |
endfunction | |
1 0.000005 augroup ALEHighlightBufferGroup | |
1 0.000050 autocmd! | |
1 0.000012 autocmd BufEnter * call ale#highlight#UpdateHighlights() | |
1 0.000004 autocmd BufHidden * call ale#highlight#BufferHidden(expand('<abuf>')) | |
1 0.000001 augroup END | |
1 0.000004 function! ale#highlight#SetHighlights(buffer, loclist) abort | |
let l:new_list = g:ale_enabled | |
\ ? filter(copy(a:loclist), 'v:val.bufnr == a:buffer && v:val.col > 0') | |
\ : [] | |
" Set the list in the buffer variable. | |
call setbufvar(str2nr(a:buffer), 'ale_highlight_items', l:new_list) | |
" Update highlights for the current buffer, which may or may not | |
" be the buffer we just set highlights for. | |
call ale#highlight#UpdateHighlights() | |
endfunction | |
SCRIPT /usr/share/nvim/runtime/ftplugin/qf.vim | |
Sourced 1 time | |
Total time: 0.000262 | |
Self time: 0.000262 | |
count total (s) self (s) | |
" Vim filetype plugin file | |
" Language: Vim's quickfix window | |
" Maintainer: Lech Lorens <Lech.Lorens@gmail.com> | |
" Last Changed: 30 Apr 2012 | |
1 0.000021 if exists("b:did_ftplugin") | |
finish | |
endif | |
" Don't load another plugin for this buffer | |
1 0.000006 let b:did_ftplugin = 1 | |
1 0.000003 let b:undo_ftplugin = "set stl<" | |
" Display the command that produced the list in the quickfix window: | |
1 0.000021 setlocal stl=%t%{exists('w:quickfix_title')?\ '\ '.w:quickfix_title\ :\ ''}\ %=%-15(%l,%c%V%)\ %P | |
1 0.000007 function! s:setup_toc() abort | |
if get(w:, 'quickfix_title') !~# '\<TOC$' || &syntax != 'qf' | |
return | |
endif | |
let list = getloclist(0) | |
if empty(list) | |
return | |
endif | |
let bufnr = list[0].bufnr | |
setlocal modifiable | |
silent %delete _ | |
call setline(1, map(list, 'v:val.text')) | |
setlocal nomodifiable nomodified | |
let &syntax = getbufvar(bufnr, '&syntax') | |
endfunction | |
1 0.000006 augroup qf_toc | |
1 0.000028 autocmd! | |
1 0.000008 autocmd Syntax <buffer> call s:setup_toc() | |
1 0.000005 augroup END | |
SCRIPT /usr/share/nvim/runtime/syntax/qf.vim | |
Sourced 1 time | |
Total time: 0.000126 | |
Self time: 0.000126 | |
count total (s) self (s) | |
" Vim syntax file | |
" Language: Quickfix window | |
" Maintainer: Bram Moolenaar <Bram@vim.org> | |
" Last change: 2001 Jan 15 | |
" Quit when a syntax file was already loaded | |
1 0.000015 if exists("b:current_syntax") | |
finish | |
endif | |
" A bunch of useful C keywords | |
1 0.000031 syn match qfFileName "^[^|]*" nextgroup=qfSeparator | |
1 0.000014 syn match qfSeparator "|" nextgroup=qfLineNr contained | |
1 0.000011 syn match qfLineNr "[^|]*" contained contains=qfError | |
1 0.000006 syn match qfError "error" contained | |
" The default highlighting. | |
1 0.000008 hi def link qfFileName Directory | |
1 0.000006 hi def link qfLineNr LineNr | |
1 0.000005 hi def link qfError Error | |
1 0.000006 let b:current_syntax = "qf" | |
" vim: ts=8 | |
FUNCTION ale#util#GetLineCount() | |
Called 1 time | |
Total time: 0.000069 | |
Self time: 0.000069 | |
count total (s) self (s) | |
1 0.000068 return len(getbufline(a:buffer, 1, '$')) | |
FUNCTION <SNR>55_CreateTemporaryFileForJob() | |
Called 2 times | |
Total time: 0.010179 | |
Self time: 0.000314 | |
count total (s) self (s) | |
2 0.000005 if empty(a:temporary_file) | |
" There is no file, so we didn't create anything. | |
return 0 | |
endif | |
2 0.000010 let l:temporary_directory = fnamemodify(a:temporary_file, ':h') | |
" Create the temporary directory for the file, unreadable by 'other' | |
" users. | |
2 0.000132 call mkdir(l:temporary_directory, '', 0750) | |
" Automatically delete the directory later. | |
2 0.000033 0.000019 call ale#engine#ManageDirectory(a:buffer, l:temporary_directory) | |
" Write the buffer out to a file. | |
2 0.000092 let l:lines = getbufline(a:buffer, 1, '$') | |
2 0.009872 0.000020 call ale#util#Writefile(a:buffer, l:lines, a:temporary_file) | |
2 0.000016 return 1 | |
FUNCTION <SNR>63_ShouldOpen() | |
Called 2 times | |
Total time: 0.000620 | |
Self time: 0.000460 | |
count total (s) self (s) | |
2 0.000579 0.000419 let l:val = ale#Var(a:buffer, 'open_list') | |
2 0.000025 let l:saved = getbufvar(a:buffer, 'ale_save_event_fired', 0) | |
2 0.000009 return l:val is 1 || (l:val is# 'on_save' && l:saved) | |
FUNCTION ale#sign#ParseSigns() | |
Called 2 times | |
Total time: 0.000300 | |
Self time: 0.000300 | |
count total (s) self (s) | |
" Matches output like : | |
" line=4 id=1 name=ALEErrorSign | |
" строка=1 id=1000001 имя=ALEErrorSign | |
" 行=1 識別子=1000001 名前=ALEWarningSign | |
" línea=12 id=1000001 nombre=ALEWarningSign | |
" riga=1 id=1000001, nome=ALEWarningSign | |
2 0.000006 let l:pattern = '\v^.*\=(\d+).*\=(\d+).*\=(ALE[a-zA-Z]+Sign)' | |
2 0.000003 let l:result = [] | |
2 0.000005 let l:is_dummy_sign_set = 0 | |
7 0.000013 for l:line in a:line_list | |
5 0.000126 let l:match = matchlist(l:line, l:pattern) | |
5 0.000017 if len(l:match) > 0 | |
2 0.000005 if l:match[3] is# 'ALEDummySign' | |
let l:is_dummy_sign_set = 1 | |
else | |
2 0.000014 call add(l:result, [ str2nr(l:match[1]), str2nr(l:match[2]), l:match[3],]) | |
2 0.000002 endif | |
2 0.000001 endif | |
5 0.000007 endfor | |
2 0.000007 return [l:is_dummy_sign_set, l:result] | |
FUNCTION ale#engine#FixLocList() | |
Called 1 time | |
Total time: 0.000542 | |
Self time: 0.000447 | |
count total (s) self (s) | |
1 0.000002 let l:bufnr_map = {} | |
1 0.000001 let l:new_loclist = [] | |
" Some errors have line numbers beyond the end of the file, | |
" so we need to adjust them so they set the error at the last line | |
" of the file instead. | |
1 0.000077 0.000008 let l:last_line_number = ale#util#GetLineCount(a:buffer) | |
4 0.000008 for l:old_item in a:loclist | |
" Copy the loclist item with some default values and corrections. | |
" | |
" line and column numbers will be converted to numbers. | |
" The buffer will default to the buffer being checked. | |
" The vcol setting will default to 0, a byte index. | |
" The error type will default to 'E' for errors. | |
" The error number will default to -1. | |
" | |
" The line number and text are the only required keys. | |
" | |
" The linter_name will be set on the errors so it can be used in | |
" output, filtering, etc.. | |
3 0.000061 let l:item = { 'bufnr': a:buffer, 'text': l:old_item.text, 'lnum': str2nr(l:old_item.lnum), 'col': str2nr(get(l:old_item, 'col', 0)), 'vcol': get(l:old_item, 'vcol', 0), 'type': get(l:old_item, 'type', 'E'), 'nr': get(l:old_item, 'nr', -1), 'linter_name': a:linter_name,} | |
3 0.000014 if has_key(l:old_item, 'filename')&& !ale#path#IsTempName(l:old_item.filename) | |
" Use the filename given. | |
" Temporary files are assumed to be for this buffer, | |
" and the filename is not included then, because it looks bad | |
" in the loclist window. | |
let l:filename = l:old_item.filename | |
let l:item.filename = l:filename | |
if has_key(l:old_item, 'bufnr') | |
" If a buffer number is also given, include that too. | |
" If Vim detects that he buffer number is valid, it will | |
" be used instead of the filename. | |
let l:item.bufnr = l:old_item.bufnr | |
elseif has_key(l:bufnr_map, l:filename) | |
" Get the buffer number from the map, which can be faster. | |
let l:item.bufnr = l:bufnr_map[l:filename] | |
else | |
" Look up the buffer number. | |
let l:item.bufnr = bufnr(l:filename) | |
let l:bufnr_map[l:filename] = l:item.bufnr | |
endif | |
elseif has_key(l:old_item, 'bufnr') | |
let l:item.bufnr = l:old_item.bufnr | |
endif | |
3 0.000008 if has_key(l:old_item, 'detail') | |
let l:item.detail = l:old_item.detail | |
endif | |
" Pass on a end_col key if set, used for highlights. | |
3 0.000007 if has_key(l:old_item, 'end_col') | |
let l:item.end_col = str2nr(l:old_item.end_col) | |
endif | |
3 0.000007 if has_key(l:old_item, 'end_lnum') | |
let l:item.end_lnum = str2nr(l:old_item.end_lnum) | |
endif | |
3 0.000008 if has_key(l:old_item, 'sub_type') | |
let l:item.sub_type = l:old_item.sub_type | |
endif | |
3 0.000005 if l:item.lnum < 1 | |
" When errors appear before line 1, put them at line 1. | |
let l:item.lnum = 1 | |
elseif l:item.bufnr == a:buffer && l:item.lnum > l:last_line_number | |
" When errors go beyond the end of the file, put them at the end. | |
" This is only done for the current buffer. | |
let l:item.lnum = l:last_line_number | |
endif | |
3 0.000010 call add(l:new_loclist, l:item) | |
3 0.000003 endfor | |
1 0.000037 0.000010 let l:type_map = get(ale#Var(a:buffer, 'type_map'), a:linter_name, {}) | |
1 0.000002 if !empty(l:type_map) | |
call s:RemapItemTypes(l:type_map, l:new_loclist) | |
endif | |
1 0.000001 return l:new_loclist | |
FUNCTION ale#job#Stop() | |
Called 2 times | |
Total time: 0.000289 | |
Self time: 0.000289 | |
count total (s) self (s) | |
2 0.000008 if !has_key(s:job_map, a:job_id) | |
return | |
endif | |
2 0.000013 if has('nvim') | |
" FIXME: NeoVim kills jobs on a timer, but will not kill any processes | |
" which are child processes on Unix. Some work needs to be done to | |
" kill child processes to stop long-running processes like pylint. | |
2 0.000203 call jobstop(a:job_id) | |
2 0.000003 else | |
let l:job = s:job_map[a:job_id].job | |
" We must close the channel for reading the buffer if it is open | |
" when stopping a job. Otherwise, we will get errors in the status line. | |
if ch_status(job_getchannel(l:job)) is# 'open' | |
call ch_close_in(job_getchannel(l:job)) | |
endif | |
" Ask nicely for the job to stop. | |
call job_stop(l:job) | |
if ale#job#IsRunning(l:job) | |
" Set a 100ms delay for killing the job with SIGKILL. | |
let s:job_kill_timers[timer_start(100, function('s:KillHandler'))] = l:job | |
endif | |
endif | |
FUNCTION <SNR>55_StopCurrentJobs() | |
Called 3 times | |
Total time: 0.000411 | |
Self time: 0.000223 | |
count total (s) self (s) | |
3 0.000021 let l:info = get(g:ale_buffer_info, a:buffer, {}) | |
3 0.000007 let l:new_job_list = [] | |
3 0.000011 let l:new_active_linter_list = [] | |
4 0.000020 for l:job_id in get(l:info, 'job_list', []) | |
1 0.000005 let l:job_info = get(s:job_info_map, l:job_id, {}) | |
1 0.000003 if !empty(l:job_info) | |
1 0.000003 if a:include_lint_file_jobs || !l:job_info.linter.lint_file | |
1 0.000202 0.000014 call ale#job#Stop(l:job_id) | |
1 0.000006 call remove(s:job_info_map, l:job_id) | |
1 0.000001 else | |
call add(l:new_job_list, l:job_id) | |
" Linters with jobs still running are still active. | |
call add(l:new_active_linter_list, l:job_info.linter.name) | |
endif | |
1 0.000001 endif | |
1 0.000001 endfor | |
" Remove duplicates from the active linter list. | |
3 0.000014 call uniq(sort(l:new_active_linter_list)) | |
" Update the List, so it includes only the jobs we still need. | |
3 0.000012 let l:info.job_list = l:new_job_list | |
" Update the active linter list, clearing out anything not running. | |
3 0.000010 let l:info.active_linter_list = l:new_active_linter_list | |
FUNCTION remote#host#Register() | |
Called 3 times | |
Total time: 0.000116 | |
Self time: 0.000116 | |
count total (s) self (s) | |
3 0.000025 let s:hosts[a:name] = {'factory': a:factory, 'channel': 0, 'initialized': 0} | |
3 0.000014 let s:plugin_patterns[a:name] = a:pattern | |
3 0.000061 if type(a:factory) == type(1) && a:factory | |
" Passed a channel directly | |
let s:hosts[a:name].channel = a:factory | |
endif | |
FUNCTION ale#job#Start() | |
Called 2 times | |
Total time: 0.004785 | |
Self time: 0.004769 | |
count total (s) self (s) | |
2 0.000034 0.000018 call ale#job#ValidateArguments(a:command, a:options) | |
2 0.000010 let l:job_info = copy(a:options) | |
2 0.000005 let l:job_options = {} | |
2 0.000009 if has('nvim') | |
2 0.000005 if has_key(a:options, 'out_cb') | |
2 0.000011 let l:job_options.on_stdout = function('s:NeoVimCallback') | |
2 0.000005 let l:job_info.out_cb_line = '' | |
2 0.000002 endif | |
2 0.000005 if has_key(a:options, 'err_cb') | |
let l:job_options.on_stderr = function('s:NeoVimCallback') | |
let l:job_info.err_cb_line = '' | |
endif | |
2 0.000004 if has_key(a:options, 'exit_cb') | |
2 0.000009 let l:job_options.on_exit = function('s:NeoVimCallback') | |
2 0.000001 endif | |
2 0.004514 let l:job_info.job = jobstart(a:command, l:job_options) | |
2 0.000019 let l:job_id = l:job_info.job | |
2 0.000004 else | |
let l:job_options = { 'in_mode': l:job_info.mode, 'out_mode': l:job_info.mode, 'err_mode': l:job_info.mode,} | |
if has_key(a:options, 'out_cb') | |
let l:job_options.out_cb = function('s:VimOutputCallback') | |
endif | |
if has_key(a:options, 'err_cb') | |
let l:job_options.err_cb = function('s:VimErrorCallback') | |
endif | |
if has_key(a:options, 'exit_cb') | |
" Set a close callback to which simply calls job_status() | |
" when the channel is closed, which can trigger the exit callback | |
" earlier on. | |
let l:job_options.close_cb = function('s:VimCloseCallback') | |
let l:job_options.exit_cb = function('s:VimExitCallback') | |
endif | |
" Vim 8 will read the stdin from the file's buffer. | |
let l:job_info.job = job_start(a:command, l:job_options) | |
let l:job_id = ale#job#ParseVim8ProcessID(string(l:job_info.job)) | |
endif | |
2 0.000005 if l:job_id > 0 | |
" Store the job in the map for later only if we can get the ID. | |
2 0.000015 let s:job_map[l:job_id] = l:job_info | |
2 0.000002 endif | |
2 0.000009 return l:job_id | |
FUNCTION ale#highlight#SetHighlights() | |
Called 2 times | |
Total time: 0.000488 | |
Self time: 0.000068 | |
count total (s) self (s) | |
2 0.000025 let l:new_list = g:ale_enabled ? filter(copy(a:loclist), 'v:val.bufnr == a:buffer && v:val.col > 0') : [] | |
" Set the list in the buffer variable. | |
2 0.000018 call setbufvar(str2nr(a:buffer), 'ale_highlight_items', l:new_list) | |
" Update highlights for the current buffer, which may or may not | |
" be the buffer we just set highlights for. | |
2 0.000438 0.000018 call ale#highlight#UpdateHighlights() | |
FUNCTION <SNR>23_GetManifest() | |
Called 1 time | |
Total time: 0.000333 | |
Self time: 0.000036 | |
count total (s) self (s) | |
1 0.000310 0.000012 let manifest = s:GetManifestPath() | |
1 0.000009 if !filereadable(manifest) | |
" Check if an old manifest file exists and move it to the new location. | |
let old_manifest = s:GetOldManifestPath() | |
if filereadable(old_manifest) | |
call rename(old_manifest, manifest) | |
endif | |
endif | |
1 0.000002 return manifest | |
FUNCTION ale#node#FindExecutable() | |
Called 4 times | |
Total time: 0.533447 | |
Self time: 0.001590 | |
count total (s) self (s) | |
4 0.000168 0.000033 if ale#Var(a:buffer, a:base_var_name . '_use_global') | |
return ale#Var(a:buffer, a:base_var_name . '_executable') | |
endif | |
12 0.000033 for l:path in a:path_list | |
8 0.532780 0.001196 let l:executable = ale#path#FindNearestFile(a:buffer, l:path) | |
8 0.000022 if !empty(l:executable) | |
return l:executable | |
endif | |
8 0.000029 endfor | |
4 0.000324 0.000186 return ale#Var(a:buffer, a:base_var_name . '_executable') | |
FUNCTION ale#linter#PreProcess() | |
Called 6 times | |
Total time: 0.001719 | |
Self time: 0.001602 | |
count total (s) self (s) | |
6 0.000020 if type(a:linter) != type({}) | |
throw 'The linter object must be a Dictionary' | |
endif | |
6 0.000043 let l:obj = { 'add_newline': get(a:linter, 'add_newline', 0), 'name': get(a:linter, 'name'), 'lsp': get(a:linter, 'lsp', ''),} | |
6 0.000016 if type(l:obj.name) != type('') | |
throw '`name` must be defined to name the linter' | |
endif | |
6 0.000018 let l:needs_address = l:obj.lsp is# 'socket' | |
6 0.000014 let l:needs_executable = l:obj.lsp isnot# 'socket' | |
6 0.000012 let l:needs_command = l:obj.lsp isnot# 'socket' | |
6 0.000017 let l:needs_lsp_details = !empty(l:obj.lsp) | |
6 0.000010 if empty(l:obj.lsp) | |
5 0.000094 let l:obj.callback = get(a:linter, 'callback') | |
5 0.000064 0.000033 if !s:IsCallback(l:obj.callback) | |
throw '`callback` must be defined with a callback to accept output' | |
endif | |
5 0.000004 endif | |
6 0.000026 if index(['', 'socket', 'stdio', 'tsserver'], l:obj.lsp) < 0 | |
throw '`lsp` must be either `''lsp''` or `''tsserver''` if defined' | |
endif | |
6 0.000007 if !l:needs_executable | |
if has_key(a:linter, 'executable')|| has_key(a:linter, 'executable_callback') | |
throw '`executable` and `executable_callback` cannot be used when lsp == ''socket''' | |
endif | |
elseif has_key(a:linter, 'executable_callback') | |
3 0.000008 let l:obj.executable_callback = a:linter.executable_callback | |
3 0.000026 0.000012 if !s:IsCallback(l:obj.executable_callback) | |
throw '`executable_callback` must be a callback if defined' | |
endif | |
3 0.000005 elseif has_key(a:linter, 'executable') | |
3 0.000007 let l:obj.executable = a:linter.executable | |
3 0.000009 if type(l:obj.executable) != type('') | |
throw '`executable` must be a string if defined' | |
endif | |
3 0.000002 else | |
throw 'Either `executable` or `executable_callback` must be defined' | |
endif | |
6 0.000007 if !l:needs_command | |
if has_key(a:linter, 'command')|| has_key(a:linter, 'command_callback')|| has_key(a:linter, 'command_chain') | |
throw '`command` and `command_callback` and `command_chain` cannot be used when lsp == ''socket''' | |
endif | |
elseif has_key(a:linter, 'command_chain') | |
let l:obj.command_chain = a:linter.command_chain | |
if type(l:obj.command_chain) != type([]) | |
throw '`command_chain` must be a List' | |
endif | |
if empty(l:obj.command_chain) | |
throw '`command_chain` must contain at least one item' | |
endif | |
let l:link_index = 0 | |
for l:link in l:obj.command_chain | |
let l:err_prefix = 'The `command_chain` item ' . l:link_index . ' ' | |
if !s:IsCallback(get(l:link, 'callback')) | |
throw l:err_prefix . 'must define a `callback` function' | |
endif | |
if has_key(l:link, 'output_stream') | |
if type(l:link.output_stream) != type('')|| index(['stdout', 'stderr', 'both'], l:link.output_stream) < 0 | |
throw l:err_prefix . '`output_stream` flag must be ' . "'stdout', 'stderr', or 'both'" | |
endif | |
endif | |
if has_key(l:link, 'read_buffer') && !s:IsBoolean(l:link.read_buffer) | |
throw l:err_prefix . 'value for `read_buffer` must be `0` or `1`' | |
endif | |
let l:link_index += 1 | |
endfor | |
elseif has_key(a:linter, 'command_callback') | |
4 0.000010 let l:obj.command_callback = a:linter.command_callback | |
4 0.000035 0.000015 if !s:IsCallback(l:obj.command_callback) | |
throw '`command_callback` must be a callback if defined' | |
endif | |
4 0.000007 elseif has_key(a:linter, 'command') | |
2 0.000004 let l:obj.command = a:linter.command | |
2 0.000005 if type(l:obj.command) != type('') | |
throw '`command` must be a string if defined' | |
endif | |
2 0.000001 else | |
throw 'Either `command`, `executable_callback`, `command_chain` ' . 'must be defined' | |
endif | |
6 0.000033 if ( has_key(a:linter, 'command') + has_key(a:linter, 'command_chain') + has_key(a:linter, 'command_callback')) > 1 | |
throw 'Only one of `command`, `command_callback`, or `command_chain` ' . 'should be set' | |
endif | |
6 0.000007 if !l:needs_address | |
6 0.000012 if has_key(a:linter, 'address_callback') | |
throw '`address_callback` cannot be used when lsp != ''socket''' | |
endif | |
6 0.000009 elseif has_key(a:linter, 'address_callback') | |
let l:obj.address_callback = a:linter.address_callback | |
if !s:IsCallback(l:obj.address_callback) | |
throw '`address_callback` must be a callback if defined' | |
endif | |
else | |
throw '`address_callback` must be defined for getting the LSP address' | |
endif | |
6 0.000035 if l:needs_lsp_details | |
1 0.000003 let l:obj.language_callback = get(a:linter, 'language_callback') | |
1 0.000006 0.000003 if !s:IsCallback(l:obj.language_callback) | |
throw '`language_callback` must be a callback for LSP linters' | |
endif | |
1 0.000003 let l:obj.project_root_callback = get(a:linter, 'project_root_callback') | |
1 0.000006 0.000003 if !s:IsCallback(l:obj.project_root_callback) | |
throw '`project_root_callback` must be a callback for LSP linters' | |
endif | |
1 0.000001 endif | |
6 0.000024 let l:obj.output_stream = get(a:linter, 'output_stream', 'stdout') | |
6 0.000031 if type(l:obj.output_stream) != type('')|| index(['stdout', 'stderr', 'both'], l:obj.output_stream) < 0 | |
throw "`output_stream` must be 'stdout', 'stderr', or 'both'" | |
endif | |
" An option indicating that this linter should only be run against the | |
" file on disk. | |
6 0.000017 let l:obj.lint_file = get(a:linter, 'lint_file', 0) | |
6 0.000056 0.000031 if !s:IsBoolean(l:obj.lint_file) | |
throw '`lint_file` must be `0` or `1`' | |
endif | |
" An option indicating that the buffer should be read. | |
6 0.000020 let l:obj.read_buffer = get(a:linter, 'read_buffer', !l:obj.lint_file) | |
6 0.000040 0.000020 if !s:IsBoolean(l:obj.read_buffer) | |
throw '`read_buffer` must be `0` or `1`' | |
endif | |
6 0.000009 if l:obj.lint_file && l:obj.read_buffer | |
throw 'Only one of `lint_file` or `read_buffer` can be `1`' | |
endif | |
6 0.000019 let l:obj.aliases = get(a:linter, 'aliases', []) | |
6 0.000039 if type(l:obj.aliases) != type([])|| len(filter(copy(l:obj.aliases), 'type(v:val) != type('''')')) > 0 | |
throw '`aliases` must be a List of String values' | |
endif | |
6 0.000007 return l:obj | |
FUNCTION ale#engine#SetResults() | |
Called 2 times | |
Total time: 0.131488 | |
Self time: 0.006483 | |
count total (s) self (s) | |
2 0.000041 0.000019 let l:linting_is_done = !ale#engine#IsCheckingBuffer(a:buffer) | |
" Set signs first. This could potentially fix some line numbers. | |
" The List could be sorted again here by SetSigns. | |
2 0.000004 if g:ale_set_signs | |
2 0.124441 0.001673 call ale#sign#SetSigns(a:buffer, a:loclist) | |
2 0.000002 endif | |
2 0.000007 if g:ale_set_quickfix || g:ale_set_loclist | |
2 0.001960 0.001560 call ale#list#SetLists(a:buffer, a:loclist) | |
2 0.000001 endif | |
2 0.000007 if exists('*ale#statusline#Update') | |
" Don't load/run if not already loaded. | |
call ale#statusline#Update(a:buffer, a:loclist) | |
endif | |
2 0.000003 if g:ale_set_highlights | |
2 0.001859 0.001089 call ale#highlight#SetHighlights(a:buffer, a:loclist) | |
2 0.000002 endif | |
2 0.000003 if g:ale_echo_cursor | |
" Try and echo the warning now. | |
" This will only do something meaningful if we're in normal mode. | |
2 0.000682 0.000010 call ale#cursor#EchoCursorWarning() | |
2 0.000002 endif | |
2 0.000003 if l:linting_is_done | |
" Reset the save event marker, used for opening windows, etc. | |
2 0.000010 call setbufvar(a:buffer, 'ale_save_event_fired', 0) | |
" Automatically remove all managed temporary files and directories | |
" now that all jobs have completed. | |
2 0.000395 0.000021 call ale#engine#RemoveManagedFiles(a:buffer) | |
" Call user autocommands. This allows users to hook into ALE's lint cycle. | |
2 0.001991 silent doautocmd User ALELint | |
2 0.000011 endif | |
FUNCTION ale#util#Writefile() | |
Called 2 times | |
Total time: 0.009852 | |
Self time: 0.009852 | |
count total (s) self (s) | |
2 0.000015 let l:corrected_lines = getbufvar(a:buffer, '&fileformat') is# 'dos' ? map(copy(a:lines), 'v:val . "\r"') : a:lines | |
2 0.009832 call writefile(l:corrected_lines, a:filename) " no-custom-checks | |
FUNCTION ale#linter#GetCommand() | |
Called 2 times | |
Total time: 0.251794 | |
Self time: 0.000033 | |
count total (s) self (s) | |
2 0.251792 0.000031 return has_key(a:linter, 'command_callback') ? ale#util#GetFunction(a:linter.command_callback)(a:buffer) : a:linter.command | |
FUNCTION <SNR>61_StopCursorTimer() | |
Called 1 time | |
Total time: 0.000010 | |
Self time: 0.000010 | |
count total (s) self (s) | |
1 0.000003 if s:cursor_timer != -1 | |
call timer_stop(s:cursor_timer) | |
let s:cursor_timer = -1 | |
endif | |
FUNCTION ale#linter#Get() | |
Called 6 times | |
Total time: 0.012112 | |
Self time: 0.001719 | |
count total (s) self (s) | |
6 0.000020 let l:possibly_duplicated_linters = [] | |
" Handle dot-separated filetypes. | |
11 0.000148 for l:original_filetype in split(a:original_filetypes, '\.') | |
5 0.000307 0.000035 let l:filetype = ale#linter#ResolveFiletype(l:original_filetype) | |
5 0.000120 0.000030 let l:linter_names = s:GetLinterNames(l:original_filetype) | |
5 0.010061 0.000030 let l:all_linters = ale#linter#GetAll(l:filetype) | |
5 0.000010 let l:filetype_linters = [] | |
5 0.000018 if type(l:linter_names) == type('') && l:linter_names is# 'all' | |
let l:filetype_linters = l:all_linters | |
elseif type(l:linter_names) == type([]) | |
" Select only the linters we or the user has specified. | |
35 0.000046 for l:linter in l:all_linters | |
30 0.000116 let l:name_list = [l:linter.name] + l:linter.aliases | |
55 0.000097 for l:name in l:name_list | |
30 0.000081 if index(l:linter_names, l:name) >= 0 | |
5 0.000015 call add(l:filetype_linters, l:linter) | |
5 0.000007 break | |
endif | |
25 0.000018 endfor | |
30 0.000025 endfor | |
5 0.000007 endif | |
5 0.000018 call extend(l:possibly_duplicated_linters, l:filetype_linters) | |
5 0.000004 endfor | |
6 0.000013 let l:name_list = [] | |
6 0.000012 let l:combined_linters = [] | |
" Make sure we override linters so we don't get two with the same name, | |
" like 'eslint' for both 'javascript' and 'typescript' | |
" | |
" Note that the reverse calls here modify the List variables. | |
11 0.000025 for l:linter in reverse(l:possibly_duplicated_linters) | |
5 0.000013 if index(l:name_list, l:linter.name) < 0 | |
5 0.000013 call add(l:name_list, l:linter.name) | |
5 0.000011 call add(l:combined_linters, l:linter) | |
5 0.000004 endif | |
5 0.000003 endfor | |
6 0.000017 return reverse(l:combined_linters) | |
FUNCTION <SNR>22_LocalBrowse() | |
Called 4 times | |
Total time: 0.008801 | |
Self time: 0.008801 | |
count total (s) self (s) | |
" Unfortunate interaction -- only DechoMsg debugging calls can be safely used here. | |
" Otherwise, the BufEnter event gets triggered when attempts to write to | |
" the DBG buffer are made. | |
4 0.000255 if !exists("s:vimentered") | |
" If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will, | |
" and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined. | |
" call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered doesn't exist)") | |
" call Dret("s:LocalBrowse") | |
1 0.000001 return | |
endif | |
" call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered=".s:vimentered.")") | |
3 0.000020 if has("amiga") | |
" The check against '' is made for the Amiga, where the empty | |
" string is the current directory and not checking would break | |
" things such as the help command. | |
" call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)") | |
if a:dirname != '' && isdirectory(a:dirname) | |
sil! call netrw#LocalBrowseCheck(a:dirname) | |
if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt | |
exe w:netrw_bannercnt | |
endif | |
endif | |
elseif isdirectory(a:dirname) | |
" call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)") | |
" call Dredir("LocalBrowse ft last set: ","verbose set ft") | |
" call Decho("(s:LocalBrowse) COMBAK#23: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) | |
sil! call netrw#LocalBrowseCheck(a:dirname) | |
" call Decho("(s:LocalBrowse) COMBAK#24: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) | |
if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt | |
exe w:netrw_bannercnt | |
" call Decho("(s:LocalBrowse) COMBAK#25: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) | |
endif | |
else | |
" not a directory, ignore it | |
" call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...") | |
3 0.000004 endif | |
" call Decho("(s:LocalBrowse) COMBAK#26: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) | |
" call Dret("s:LocalBrowse") | |
FUNCTION remote#host#PluginsForHost() | |
Called 1 time | |
Total time: 0.000079 | |
Self time: 0.000079 | |
count total (s) self (s) | |
1 0.000067 if !has_key(s:plugins_for_host, a:host) | |
1 0.000005 let s:plugins_for_host[a:host] = [] | |
1 0.000001 end | |
1 0.000004 return s:plugins_for_host[a:host] | |
FUNCTION <SNR>62_BuildSignMap() | |
Called 2 times | |
Total time: 0.000557 | |
Self time: 0.000350 | |
count total (s) self (s) | |
2 0.000075 0.000015 let l:max_signs = ale#Var(a:buffer, 'max_signs') | |
2 0.000004 if l:max_signs is 0 | |
let l:selected_grouped_items = [] | |
elseif type(l:max_signs) is type(0) && l:max_signs > 0 | |
let l:selected_grouped_items = a:grouped_items[:l:max_signs - 1] | |
else | |
2 0.000007 let l:selected_grouped_items = a:grouped_items | |
2 0.000002 endif | |
2 0.000004 let l:sign_map = {} | |
2 0.000006 let l:sign_offset = g:ale_sign_offset | |
4 0.000012 for [l:line, l:sign_id, l:name] in a:current_sign_list | |
2 0.000020 let l:sign_info = get(l:sign_map, l:line, { 'current_id_list': [], 'current_name_list': [], 'new_id': 0, 'new_name': '', 'items': [],}) | |
" Increment the sign offset for new signs, by the maximum sign ID. | |
2 0.000005 if l:sign_id > l:sign_offset | |
2 0.000004 let l:sign_offset = l:sign_id | |
2 0.000002 endif | |
" Remember the sign names and IDs in separate Lists, so they are easy | |
" to work with. | |
2 0.000008 call add(l:sign_info.current_id_list, l:sign_id) | |
2 0.000006 call add(l:sign_info.current_name_list, l:name) | |
2 0.000008 let l:sign_map[l:line] = l:sign_info | |
2 0.000004 endfor | |
4 0.000007 for l:group in l:selected_grouped_items | |
2 0.000004 let l:line = l:group[0].lnum | |
2 0.000015 let l:sign_info = get(l:sign_map, l:line, { 'current_id_list': [], 'current_name_list': [], 'new_id': 0, 'new_name': '', 'items': [],}) | |
2 0.000163 0.000016 let l:sign_info.new_name = ale#sign#GetSignName(l:group) | |
2 0.000005 let l:sign_info.items = l:group | |
2 0.000009 let l:index = index( l:sign_info.current_name_list, l:sign_info.new_name) | |
2 0.000003 if l:index >= 0 | |
" We have a sign with this name already, so use the same ID. | |
let l:sign_info.new_id = l:sign_info.current_id_list[l:index] | |
else | |
" This sign name replaces the previous name, so use a new ID. | |
2 0.000006 let l:sign_info.new_id = l:sign_offset + 1 | |
2 0.000005 let l:sign_offset += 1 | |
2 0.000002 endif | |
2 0.000007 let l:sign_map[l:line] = l:sign_info | |
2 0.000002 endfor | |
2 0.000004 return l:sign_map | |
FUNCTION <SNR>5_LoadIndent() | |
Called 2 times | |
Total time: 0.004847 | |
Self time: 0.002501 | |
count total (s) self (s) | |
2 0.000023 if exists("b:undo_indent") | |
exe b:undo_indent | |
unlet! b:undo_indent b:did_indent | |
endif | |
2 0.000013 let s = expand("<amatch>") | |
2 0.000005 if s != "" | |
2 0.000006 if exists("b:did_indent") | |
unlet b:did_indent | |
endif | |
" When there is a dot it is used to separate filetype names. Thus for | |
" "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim". | |
4 0.000022 for name in split(s, '\.') | |
2 0.004683 0.002337 exe 'runtime! indent/' . name . '.vim' | |
2 0.000010 endfor | |
2 0.000003 endif | |
FUNCTION ale#cursor#EchoCursorWarning() | |
Called 3 times | |
Total time: 0.001021 | |
Self time: 0.000050 | |
count total (s) self (s) | |
3 0.001016 0.000046 return ale#CallWithCooldown('dont_echo_until', function('s:EchoImpl'), []) | |
FUNCTION ale#linter#Define() | |
Called 6 times | |
Total time: 0.001893 | |
Self time: 0.000174 | |
count total (s) self (s) | |
6 0.000025 if !has_key(s:linters, a:filetype) | |
1 0.000005 let s:linters[a:filetype] = [] | |
1 0.000001 endif | |
6 0.001796 0.000077 let l:new_linter = ale#linter#PreProcess(a:linter) | |
6 0.000040 call add(s:linters[a:filetype], l:new_linter) | |
FUNCTION ale#history#Add() | |
Called 3 times | |
Total time: 0.000170 | |
Self time: 0.000170 | |
count total (s) self (s) | |
3 0.000012 if g:ale_max_buffer_history_size <= 0 | |
" Don't save anything if the history isn't a positive number. | |
call setbufvar(a:buffer, 'ale_history', []) | |
return | |
endif | |
3 0.000030 let l:history = getbufvar(a:buffer, 'ale_history', []) | |
" Remove the first item if we hit the max history size. | |
3 0.000012 if len(l:history) >= g:ale_max_buffer_history_size | |
let l:history = l:history[1:] | |
endif | |
3 0.000021 call add(l:history, { 'status': a:status, 'job_id': a:job_id, 'command': a:command,}) | |
3 0.000013 call setbufvar(a:buffer, 'ale_history', l:history) | |
FUNCTION ale#job#JoinNeovimOutput() | |
Called 1 time | |
Total time: 0.000098 | |
Self time: 0.000070 | |
count total (s) self (s) | |
1 0.000006 let l:lines = a:data[:-2] | |
1 0.000002 if len(a:data) > 1 | |
1 0.000005 let l:lines[0] = a:last_line . l:lines[0] | |
1 0.000004 let l:new_last_line = a:data[-1] | |
1 0.000001 else | |
let l:new_last_line = a:last_line . a:data[0] | |
endif | |
1 0.000002 if a:mode is# 'raw' | |
if !empty(l:lines) | |
call a:callback(a:job, join(l:lines, "\n") . "\n") | |
endif | |
else | |
4 0.000008 for l:line in l:lines | |
3 0.000046 0.000019 call a:callback(a:job, l:line) | |
3 0.000003 endfor | |
1 0.000001 endif | |
1 0.000002 return l:new_last_line | |
FUNCTION <SNR>55_RemoveProblemsForDisabledLinters() | |
Called 3 times | |
Total time: 0.000083 | |
Self time: 0.000083 | |
count total (s) self (s) | |
" Figure out which linters are still enabled, and remove | |
" problems for linters which are no longer enabled. | |
3 0.000007 let l:name_map = {} | |
5 0.000012 for l:linter in a:linters | |
2 0.000008 let l:name_map[l:linter.name] = 1 | |
2 0.000002 endfor | |
3 0.000036 call filter( get(g:ale_buffer_info[a:buffer], 'loclist', []), 'get(l:name_map, get(v:val, ''linter_name''))',) | |
FUNCTION <SNR>65_setup_toc() | |
Called 1 time | |
Total time: 0.000016 | |
Self time: 0.000016 | |
count total (s) self (s) | |
1 0.000012 if get(w:, 'quickfix_title') !~# '\<TOC$' || &syntax != 'qf' | |
1 0.000002 return | |
endif | |
let list = getloclist(0) | |
if empty(list) | |
return | |
endif | |
let bufnr = list[0].bufnr | |
setlocal modifiable | |
silent %delete _ | |
call setline(1, map(list, 'v:val.text')) | |
setlocal nomodifiable nomodified | |
let &syntax = getbufvar(bufnr, '&syntax') | |
FUNCTION remote#host#RegisterPlugin() | |
Called 1 time | |
Total time: 0.003772 | |
Self time: 0.003122 | |
count total (s) self (s) | |
1 0.000094 0.000015 let plugins = remote#host#PluginsForHost(a:host) | |
1 0.000003 for plugin in plugins | |
if plugin.path == a:path | |
throw 'Plugin "'.a:path.'" is already registered' | |
endif | |
endfor | |
1 0.000400 0.000379 if has_key(s:hosts, a:host) && remote#host#IsRunning(a:host) | |
" For now we won't allow registration of plugins when the host is already | |
" running. | |
throw 'Host "'.a:host.'" is already running' | |
endif | |
4 0.000011 for spec in a:specs | |
3 0.000008 let type = spec.type | |
3 0.000005 let name = spec.name | |
3 0.000004 let sync = spec.sync | |
3 0.000005 let opts = spec.opts | |
3 0.000006 let rpc_method = a:path | |
3 0.000007 if type == 'command' | |
let rpc_method .= ':command:'.name | |
call remote#define#CommandOnHost(a:host, rpc_method, sync, name, opts) | |
elseif type == 'autocmd' | |
" Since multiple handlers can be attached to the same autocmd event by a | |
" single plugin, we need a way to uniquely identify the rpc method to | |
" call. The solution is to append the autocmd pattern to the method | |
" name(This still has a limit: one handler per event/pattern combo, but | |
" there's no need to allow plugins define multiple handlers in that case) | |
let rpc_method .= ':autocmd:'.name.':'.get(opts, 'pattern', '*') | |
call remote#define#AutocmdOnHost(a:host, rpc_method, sync, name, opts) | |
elseif type == 'function' | |
3 0.000012 let rpc_method .= ':function:'.name | |
3 0.003018 0.002468 call remote#define#FunctionOnHost(a:host, rpc_method, sync, name, opts) | |
3 0.000004 else | |
echoerr 'Invalid declaration type: '.type | |
endif | |
3 0.000004 endfor | |
1 0.000007 call add(plugins, {'path': a:path, 'specs': a:specs}) | |
FUNCTION ale#sign#SetSigns() | |
Called 2 times | |
Total time: 0.122116 | |
Self time: 0.120526 | |
count total (s) self (s) | |
2 0.000011 if !bufexists(str2nr(a:buffer)) | |
" Stop immediately when attempting to set signs for a buffer which | |
" does not exist. | |
return | |
endif | |
" Find the current markers | |
2 0.000420 0.000023 let [l:is_dummy_sign_set, l:current_sign_list] = ale#sign#FindCurrentSigns(a:buffer) | |
" Update the line numbers for items from before which may have moved. | |
2 0.000173 0.000027 call s:UpdateLineNumbers(a:buffer, l:current_sign_list, a:loclist) | |
" Group items after updating the line numbers. | |
2 0.000174 0.000020 let l:grouped_items = s:GroupLoclistItems(a:buffer, a:loclist) | |
" Build a map of current and new signs, with the lines as the keys. | |
2 0.000579 0.000022 let l:sign_map = s:BuildSignMap( a:buffer, l:current_sign_list, l:grouped_items,) | |
2 0.000361 0.000026 let l:command_list = ale#sign#GetSignCommands( a:buffer, l:is_dummy_sign_set, l:sign_map,) | |
" Change the sign column color if the option is on. | |
2 0.000006 if g:ale_change_sign_column_color && !empty(a:loclist) | |
highlight clear SignColumn | |
highlight link SignColumn ALESignColumnWithErrors | |
endif | |
10 0.000023 for l:command in l:command_list | |
8 0.120283 silent! execute l:command | |
8 0.000016 endfor | |
" Reset the sign column color when there are no more errors. | |
2 0.000013 if g:ale_change_sign_column_color && empty(a:loclist) | |
highlight clear SignColumn | |
highlight link SignColumn ALESignColumnWithoutErrors | |
endif | |
FUNCTION <SNR>59_TemporaryFilename() | |
Called 2 times | |
Total time: 0.000072 | |
Self time: 0.000072 | |
count total (s) self (s) | |
2 0.000012 let l:filename = fnamemodify(bufname(a:buffer), ':t') | |
2 0.000004 if empty(l:filename) | |
" If the buffer's filename is empty, create a dummy filename. | |
let l:ft = getbufvar(a:buffer, '&filetype') | |
let l:filename = 'file' . ale#filetypes#GuessExtension(l:ft) | |
endif | |
" Create a temporary filename, <temp_dir>/<original_basename> | |
" The file itself will not be created by this function. | |
2 0.000040 return tempname() . (has('win32') ? '\' : '/') . l:filename | |
FUNCTION htmlcomplete#DetectOmniFlavor() | |
Called 1 time | |
Total time: 0.000853 | |
Self time: 0.000853 | |
count total (s) self (s) | |
1 0.000008 if &filetype == 'xhtml' | |
let b:html_omni_flavor = 'xhtml10s' | |
else | |
1 0.000004 let b:html_omni_flavor = 'html401t' | |
1 0.000001 endif | |
1 0.000002 let i = 1 | |
1 0.000002 let line = "" | |
10 0.000062 while i < 10 && i < line("$") | |
9 0.000233 let line = getline(i) | |
9 0.000421 if line =~ '<!DOCTYPE.*\<DTD ' | |
break | |
endif | |
9 0.000043 let i += 1 | |
9 0.000010 endwhile | |
1 0.000005 if line =~ '<!DOCTYPE.*\<DTD ' " doctype line found above | |
if line =~ ' HTML 3\.2' | |
let b:html_omni_flavor = 'html32' | |
elseif line =~ ' XHTML 1\.1' | |
let b:html_omni_flavor = 'xhtml11' | |
else " two-step detection with strict/frameset/transitional | |
if line =~ ' XHTML 1\.0' | |
let b:html_omni_flavor = 'xhtml10' | |
elseif line =~ ' HTML 4\.01' | |
let b:html_omni_flavor = 'html401' | |
elseif line =~ ' HTML 4.0\>' | |
let b:html_omni_flavor = 'html40' | |
endif | |
if line =~ '\<Transitional\>' | |
let b:html_omni_flavor .= 't' | |
elseif line =~ '\<Frameset\>' | |
let b:html_omni_flavor .= 'f' | |
else | |
let b:html_omni_flavor .= 's' | |
endif | |
endif | |
endif | |
FUNCTION ale#util#BinarySearch() | |
Called 3 times | |
Total time: 0.000128 | |
Self time: 0.000128 | |
count total (s) self (s) | |
3 0.000005 let l:min = 0 | |
3 0.000009 let l:max = len(a:loclist) - 1 | |
5 0.000009 while 1 | |
5 0.000009 if l:max < l:min | |
3 0.000004 return -1 | |
endif | |
2 0.000005 let l:mid = (l:min + l:max) / 2 | |
2 0.000005 let l:item = a:loclist[l:mid] | |
" Binary search for equal buffers, equal lines, then near columns. | |
2 0.000004 if l:item.bufnr < a:buffer | |
let l:min = l:mid + 1 | |
elseif l:item.bufnr > a:buffer | |
let l:max = l:mid - 1 | |
elseif l:item.lnum < a:line | |
2 0.000004 let l:min = l:mid + 1 | |
2 0.000003 elseif l:item.lnum > a:line | |
let l:max = l:mid - 1 | |
else | |
" This part is a small sequential search. | |
let l:index = l:mid | |
" Search backwards to find the first problem on the line. | |
while l:index > 0&& a:loclist[l:index - 1].bufnr == a:buffer&& a:loclist[l:index - 1].lnum == a:line | |
let l:index -= 1 | |
endwhile | |
" Find the last problem on or before this column. | |
while l:index < l:max&& a:loclist[l:index + 1].bufnr == a:buffer&& a:loclist[l:index + 1].lnum == a:line&& a:loclist[l:index + 1].col <= a:column | |
let l:index += 1 | |
endwhile | |
return l:index | |
endif | |
2 0.000002 endwhile | |
FUNCTION <SNR>55_GatherOutput() | |
Called 3 times | |
Total time: 0.000027 | |
Self time: 0.000027 | |
count total (s) self (s) | |
3 0.000009 if has_key(s:job_info_map, a:job_id) | |
3 0.000013 call add(s:job_info_map[a:job_id].output, a:line) | |
3 0.000002 endif | |
FUNCTION ale#engine#InitBufferInfo() | |
Called 3 times | |
Total time: 0.000063 | |
Self time: 0.000063 | |
count total (s) self (s) | |
3 0.000017 if !has_key(g:ale_buffer_info, a:buffer) | |
" job_list will hold the list of job IDs | |
" active_linter_list will hold the list of active linter names | |
" loclist holds the loclist items after all jobs have completed. | |
" temporary_file_list holds temporary files to be cleaned up | |
" temporary_directory_list holds temporary directories to be cleaned up | |
1 0.000007 let g:ale_buffer_info[a:buffer] = { 'job_list': [], 'active_linter_list': [], 'loclist': [], 'temporary_file_list': [], 'temporary_directory_list': [],} | |
1 0.000002 return 1 | |
endif | |
2 0.000003 return 0 | |
FUNCTION <SNR>63_CloseWindowIfNeeded() | |
Called 1 time | |
Total time: 0.000404 | |
Self time: 0.000071 | |
count total (s) self (s) | |
1 0.000343 0.000018 if ale#Var(a:buffer, 'keep_list_window_open') || !s:ShouldOpen(a:buffer) | |
return | |
endif | |
1 0.000002 try | |
" Only close windows if the quickfix list or loclist is completely empty, | |
" including errors set through other means. | |
1 0.000002 if g:ale_set_quickfix | |
if empty(getqflist()) | |
cclose | |
endif | |
else | |
1 0.000018 0.000009 let l:win_id = s:BufWinId(a:buffer) | |
1 0.000015 if g:ale_set_loclist && empty(getloclist(l:win_id)) | |
lclose | |
endif | |
1 0.000001 endif | |
" Ignore 'Cannot close last window' errors. | |
1 0.000003 catch /E444/ | |
endtry | |
FUNCTION ale_linters#php#phpcs#GetCommand() | |
Called 2 times | |
Total time: 0.251746 | |
Self time: 0.000066 | |
count total (s) self (s) | |
2 0.251595 0.000017 let l:executable = ale_linters#php#phpcs#GetExecutable(a:buffer) | |
2 0.000077 0.000014 let l:standard = ale#Var(a:buffer, 'php_phpcs_standard') | |
2 0.000009 let l:standard_option = !empty(l:standard) ? '--standard=' . l:standard : '' | |
2 0.000059 0.000020 return ale#Escape(l:executable) . ' -s --report=emacs --stdin-path=%s ' . l:standard_option | |
FUNCTION <SNR>63_SetListsImpl() | |
Called 1 time | |
Total time: 0.059525 | |
Self time: 0.007082 | |
count total (s) self (s) | |
1 0.005495 let l:title = expand('#' . a:buffer . ':p') | |
1 0.000008 if g:ale_set_quickfix | |
let l:quickfix_list = ale#list#GetCombinedList() | |
if has('nvim') | |
call setqflist(s:FixList(l:quickfix_list), ' ', l:title) | |
else | |
call setqflist(s:FixList(l:quickfix_list)) | |
call setqflist([], 'r', {'title': l:title}) | |
endif | |
elseif g:ale_set_loclist | |
" If windows support is off, bufwinid() may not exist. | |
" We'll set result in the current window, which might not be correct, | |
" but is better than nothing. | |
1 0.000037 0.000021 let l:win_id = s:BufWinId(a:buffer) | |
1 0.000006 if has('nvim') | |
1 0.000110 0.000033 call setloclist(l:win_id, s:FixList(a:loclist), ' ', l:title) | |
1 0.000001 else | |
call setloclist(l:win_id, s:FixList(a:loclist)) | |
call setloclist(l:win_id, [], 'r', {'title': l:title}) | |
endif | |
1 0.000001 endif | |
" Open a window to show the problems if we need to. | |
" | |
" We'll check if the current buffer's List is not empty here, so the | |
" window will only be opened if the current buffer has problems. | |
1 0.000444 0.000014 if s:ShouldOpen(a:buffer) && !empty(a:loclist) | |
1 0.000003 let l:winnr = winnr() | |
1 0.000003 let l:mode = mode() | |
1 0.000008 let l:reset_visual_selection = l:mode is? 'v' || l:mode is# "\<c-v>" | |
1 0.000004 let l:reset_character_selection = l:mode is? 's' || l:mode is# "\<c-s>" | |
1 0.000002 if g:ale_set_quickfix | |
if !ale#list#IsQuickfixOpen() | |
silent! execute 'copen ' . str2nr(ale#Var(a:buffer, 'list_window_size')) | |
endif | |
elseif g:ale_set_loclist | |
1 0.035768 0.000793 silent! execute 'lopen ' . str2nr(ale#Var(a:buffer, 'list_window_size')) | |
1 0.000001 endif | |
" If focus changed, restore it (jump to the last window). | |
1 0.000003 if l:winnr isnot# winnr() | |
1 0.017049 0.000526 wincmd p | |
1 0.000002 endif | |
1 0.000007 if l:reset_visual_selection || l:reset_character_selection | |
" If we were in a selection mode before, select the last selection. | |
normal! gv | |
if l:reset_character_selection | |
" Switch back to Select mode, if we were in that. | |
normal! "\<c-g>" | |
endif | |
endif | |
1 0.000001 endif | |
" If ALE isn't currently checking for more problems, close the window if | |
" needed now. This check happens inside of this timer function, so | |
" the window can be closed reliably. | |
1 0.000026 0.000010 if !ale#engine#IsCheckingBuffer(a:buffer) | |
1 0.000424 0.000020 call s:CloseWindowIfNeeded(a:buffer) | |
1 0.000001 endif | |
FUNCTION <SNR>15_ALEQueueImpl() | |
Called 7 times | |
Total time: 0.611888 | |
Self time: 0.001906 | |
count total (s) self (s) | |
7 0.000026 if a:linting_flag isnot# '' && a:linting_flag isnot# 'lint_file' | |
throw "linting_flag must be either '' or 'lint_file'" | |
endif | |
7 0.000020 if type(a:buffer) != type(0) | |
throw 'buffer_number must be a Number' | |
endif | |
7 0.001093 0.000036 if ale#ShouldDoNothing(a:buffer) | |
3 0.000004 return | |
endif | |
" Remember that we want to check files for this buffer. | |
" We will remember this until we finally run the linters, via any event. | |
4 0.000009 if a:linting_flag is# 'lint_file' | |
4 0.000022 let s:should_lint_file_for_buffer[bufnr('%')] = 1 | |
4 0.000004 endif | |
4 0.000007 if s:lint_timer != -1 | |
1 0.000003 call timer_stop(s:lint_timer) | |
1 0.000001 let s:lint_timer = -1 | |
1 0.000000 endif | |
4 0.013179 0.001582 let l:linters = ale#linter#Get(getbufvar(a:buffer, '&filetype')) | |
" Don't set up buffer data and so on if there are no linters to run. | |
4 0.000010 if empty(l:linters) | |
" If we have some previous buffer data, then stop any jobs currently | |
" running and clear everything. | |
1 0.000005 if has_key(g:ale_buffer_info, a:buffer) | |
call ale#engine#RunLinters(a:buffer, [], 1) | |
endif | |
1 0.000001 return | |
endif | |
3 0.000004 if a:delay > 0 | |
1 0.000003 let s:queued_buffer_number = a:buffer | |
1 0.000007 let s:lint_timer = timer_start(a:delay, function('ale#Lint')) | |
1 0.000001 else | |
2 0.597344 0.000016 call ale#Lint(-1, a:buffer) | |
2 0.000003 endif | |
FUNCTION ale#engine#RunLinters() | |
Called 3 times | |
Total time: 0.603082 | |
Self time: 0.000393 | |
count total (s) self (s) | |
" Initialise the buffer information if needed. | |
3 0.000103 0.000039 let l:new_buffer = ale#engine#InitBufferInfo(a:buffer) | |
3 0.000440 0.000029 call s:StopCurrentJobs(a:buffer, a:should_lint_file) | |
3 0.000113 0.000030 call s:RemoveProblemsForDisabledLinters(a:buffer, a:linters) | |
" We can only clear the results if we aren't checking the buffer. | |
3 0.000090 0.000059 let l:can_clear_results = !ale#engine#IsCheckingBuffer(a:buffer) | |
5 0.000035 for l:linter in a:linters | |
" Only run lint_file linters if we should. | |
2 0.000005 if !l:linter.lint_file || a:should_lint_file | |
2 0.566381 0.000018 if s:RunLinter(a:buffer, l:linter) | |
" If a single linter ran, we shouldn't clear everything. | |
2 0.000004 let l:can_clear_results = 0 | |
2 0.000002 endif | |
2 0.000001 else | |
" If we skipped running a lint_file linter still in the list, | |
" we shouldn't clear everything. | |
let l:can_clear_results = 0 | |
endif | |
2 0.000002 endfor | |
" Clear the results if we can. This needs to be done when linters are | |
" disabled, or ALE itself is disabled. | |
3 0.000004 if l:can_clear_results | |
1 0.025808 0.000041 call ale#engine#SetResults(a:buffer, []) | |
1 0.000001 elseif l:new_buffer | |
1 0.009994 0.000024 call s:AddProblemsFromOtherBuffers(a:buffer, a:linters) | |
1 0.000001 endif | |
FUNCTION <SNR>26_GetNextAutocmdGroup() | |
Called 3 times | |
Total time: 0.000062 | |
Self time: 0.000062 | |
count total (s) self (s) | |
3 0.000007 let gid = s:next_gid | |
3 0.000007 let s:next_gid += 1 | |
3 0.000014 let group_name = 'RPC_DEFINE_AUTOCMD_GROUP_'.gid | |
" Ensure the group is defined | |
3 0.000022 exe 'augroup '.group_name.' | augroup END' | |
3 0.000005 return group_name | |
FUNCTION ale#path#FindNearestFile() | |
Called 8 times | |
Total time: 0.531397 | |
Self time: 0.531397 | |
count total (s) self (s) | |
8 0.037471 let l:buffer_filename = fnamemodify(bufname(a:buffer), ':p') | |
8 0.493714 let l:relative_path = findfile(a:filename, l:buffer_filename . ';') | |
8 0.000077 if !empty(l:relative_path) | |
return fnamemodify(l:relative_path, ':p') | |
endif | |
8 0.000014 return '' | |
FUNCTION ale#highlight#RemoveHighlights() | |
Called 4 times | |
Total time: 0.000340 | |
Self time: 0.000340 | |
count total (s) self (s) | |
13 0.000213 for l:match in getmatches() | |
9 0.000042 if l:match.group =~# '^ALE' | |
6 0.000014 call matchdelete(l:match.id) | |
6 0.000004 endif | |
9 0.000021 endfor | |
FUNCTION <SNR>55_HandleLoclist() | |
Called 1 time | |
Total time: 0.106616 | |
Self time: 0.000109 | |
count total (s) self (s) | |
1 0.000018 let l:buffer_info = get(g:ale_buffer_info, a:buffer, {}) | |
1 0.000002 if empty(l:buffer_info) | |
return | |
endif | |
" Remove this linter from the list of active linters. | |
" This may have already been done when the job exits. | |
1 0.000004 call filter(l:buffer_info.active_linter_list, 'v:val isnot# a:linter_name') | |
" Make some adjustments to the loclists to fix common problems, and also | |
" to set default values for loclist items. | |
1 0.000554 0.000012 let l:linter_loclist = ale#engine#FixLocList(a:buffer, a:linter_name, a:loclist) | |
" Remove previous items for this linter. | |
1 0.000006 call filter(g:ale_buffer_info[a:buffer].loclist, 'v:val.linter_name isnot# a:linter_name') | |
" Add the new items. | |
1 0.000006 call extend(g:ale_buffer_info[a:buffer].loclist, l:linter_loclist) | |
" Sort the loclist again. | |
" We need a sorted list so we can run a binary search against it | |
" for efficient lookup of the messages in the cursor handler. | |
1 0.000125 0.000022 call sort(g:ale_buffer_info[a:buffer].loclist, 'ale#util#LocItemCompare') | |
1 0.000148 0.000008 if ale#ShouldDoNothing(a:buffer) | |
return | |
endif | |
1 0.105739 0.000018 call ale#engine#SetResults(a:buffer, g:ale_buffer_info[a:buffer].loclist) | |
FUNCTION ale#sign#GetSignName() | |
Called 2 times | |
Total time: 0.000147 | |
Self time: 0.000147 | |
count total (s) self (s) | |
2 0.000005 let l:priority = s:style_warning_priority | |
" Determine the highest priority item for the line. | |
5 0.000007 for l:item in a:sublist | |
3 0.000005 if l:item.type is# 'I' | |
let l:item_priority = s:info_priority | |
elseif l:item.type is# 'W' | |
if get(l:item, 'sub_type', '') is# 'style' | |
let l:item_priority = s:style_warning_priority | |
else | |
let l:item_priority = s:warning_priority | |
endif | |
else | |
3 0.000008 if get(l:item, 'sub_type', '') is# 'style' | |
let l:item_priority = s:style_error_priority | |
else | |
3 0.000006 let l:item_priority = s:error_priority | |
3 0.000002 endif | |
3 0.000002 endif | |
3 0.000005 if l:item_priority < l:priority | |
2 0.000004 let l:priority = l:item_priority | |
2 0.000001 endif | |
3 0.000002 endfor | |
2 0.000004 if l:priority is# s:error_priority | |
2 0.000003 return 'ALEErrorSign' | |
endif | |
if l:priority is# s:warning_priority | |
return 'ALEWarningSign' | |
endif | |
if l:priority is# s:style_error_priority | |
return 'ALEStyleErrorSign' | |
endif | |
if l:priority is# s:style_warning_priority | |
return 'ALEStyleWarningSign' | |
endif | |
if l:priority is# s:info_priority | |
return 'ALEInfoSign' | |
endif | |
" Use the error sign for invalid severities. | |
return 'ALEErrorSign' | |
FUNCTION ale#Set() | |
Called 21 times | |
Total time: 0.000489 | |
Self time: 0.000489 | |
count total (s) self (s) | |
21 0.000213 let l:full_name = 'ale_' . a:variable_name | |
21 0.000108 let l:value = get(g:, l:full_name, a:default) | |
21 0.000072 let g:[l:full_name] = l:value | |
21 0.000055 return l:value | |
FUNCTION ale#history#Get() | |
Called 2 times | |
Total time: 0.000015 | |
Self time: 0.000015 | |
count total (s) self (s) | |
2 0.000013 return copy(getbufvar(a:buffer, 'ale_history', [])) | |
FUNCTION ale#FileTooLarge() | |
Called 10 times | |
Total time: 0.000507 | |
Self time: 0.000236 | |
count total (s) self (s) | |
10 0.000436 0.000166 let l:max = ale#Var(bufnr(''), 'maximum_file_size') | |
10 0.000059 return l:max > 0 ? (line2byte(line('$') + 1) > l:max) : 0 | |
FUNCTION ale#history#RememberOutput() | |
Called 1 time | |
Total time: 0.000030 | |
Self time: 0.000011 | |
count total (s) self (s) | |
1 0.000026 0.000007 let l:obj = s:FindHistoryItem(a:buffer, a:job_id) | |
1 0.000003 let l:obj.output = a:output | |
FUNCTION ale#Has() | |
Called 2 times | |
Total time: 0.000025 | |
Self time: 0.000025 | |
count total (s) self (s) | |
2 0.000022 return get(g:ale_has_override, a:feature, has(a:feature)) | |
FUNCTION <SNR>58_FindHistoryItem() | |
Called 2 times | |
Total time: 0.000049 | |
Self time: 0.000034 | |
count total (s) self (s) | |
" Search backwards to find a matching job ID. IDs might be recycled, | |
" so finding the last one should be good enough. | |
2 0.000035 0.000020 for l:obj in reverse(ale#history#Get(a:buffer)) | |
2 0.000005 if l:obj.job_id == a:job_id | |
2 0.000003 return l:obj | |
endif | |
endfor | |
return {} | |
FUNCTION <SNR>48_GetAliasedFiletype() | |
Called 5 times | |
Total time: 0.000187 | |
Self time: 0.000187 | |
count total (s) self (s) | |
" Check for aliased filetypes first in a buffer variable, | |
" then the global variable, | |
" then in the default mapping, | |
" otherwise use the original filetype. | |
20 0.000050 for l:dict in [ get(b:, 'ale_linter_aliases', {}), g:ale_linter_aliases, s:default_ale_linter_aliases,] | |
15 0.000038 if has_key(l:dict, a:original_filetype) | |
return l:dict[a:original_filetype] | |
endif | |
15 0.000013 endfor | |
5 0.000007 return a:original_filetype | |
FUNCTION <SNR>22_VimEnter() | |
Called 1 time | |
Total time: 0.006357 | |
Self time: 0.004930 | |
count total (s) self (s) | |
" call Dfunc("s:VimEnter(dirname<".a:dirname.">) expand(%)<".expand("%").">") | |
1 0.000003 let curwin = winnr() | |
1 0.000003 let s:vimentered = 1 | |
1 0.006340 0.004913 windo call s:LocalBrowse(expand("%:p")) | |
1 0.000010 exe curwin."wincmd w" | |
" call Dret("s:VimEnter") | |
FUNCTION ale#engine#IsCheckingBuffer() | |
Called 6 times | |
Total time: 0.000069 | |
Self time: 0.000069 | |
count total (s) self (s) | |
6 0.000033 let l:info = get(g:ale_buffer_info, a:buffer, {}) | |
6 0.000027 return !empty(get(l:info, 'active_linter_list', [])) | |
FUNCTION ale#job#ValidateArguments() | |
Called 2 times | |
Total time: 0.000017 | |
Self time: 0.000017 | |
count total (s) self (s) | |
2 0.000006 if a:options.mode isnot# 'nl' && a:options.mode isnot# 'raw' | |
throw 'Invalid mode: ' . a:options.mode | |
endif | |
FUNCTION <SNR>23_LoadRemotePlugins() | |
Called 1 time | |
Total time: 0.008809 | |
Self time: 0.002139 | |
count total (s) self (s) | |
1 0.000346 0.000013 let g:loaded_remote_plugins = s:GetManifest() | |
1 0.000065 if filereadable(g:loaded_remote_plugins) | |
1 0.008395 0.002057 execute 'source' fnameescape(g:loaded_remote_plugins) | |
1 0.000001 endif | |
FUNCTION ale#Var() | |
Called 43 times | |
Total time: 0.002136 | |
Self time: 0.002136 | |
count total (s) self (s) | |
43 0.000190 let l:nr = str2nr(a:buffer) | |
43 0.000179 let l:full_name = 'ale_' . a:variable_name | |
43 0.000127 if bufexists(l:nr) | |
43 0.000164 let l:vars = getbufvar(l:nr, '') | |
43 0.000145 elseif has_key(g:, 'ale_fix_buffer_data') | |
let l:vars = get(g:ale_fix_buffer_data, l:nr, {'vars': {}}).vars | |
else | |
let l:vars = {} | |
endif | |
43 0.000270 return get(l:vars, l:full_name, g:[l:full_name]) | |
FUNCTION remote#host#IsRunning() | |
Called 1 time | |
Total time: 0.000021 | |
Self time: 0.000021 | |
count total (s) self (s) | |
1 0.000010 if !has_key(s:hosts, a:name) | |
throw 'No host named "'.a:name.'" is registered' | |
endif | |
1 0.000005 return s:hosts[a:name].channel != 0 | |
FUNCTION ale#events#EnterEvent() | |
Called 3 times | |
Total time: 0.000998 | |
Self time: 0.000145 | |
count total (s) self (s) | |
3 0.000030 let l:filetype = getbufvar(a:buffer, '&filetype') | |
3 0.000020 call setbufvar(a:buffer, 'ale_original_filetype', l:filetype) | |
3 0.000939 0.000086 call s:LintOnEnter(a:buffer) | |
FUNCTION <SNR>63_BufWinId() | |
Called 2 times | |
Total time: 0.000025 | |
Self time: 0.000025 | |
count total (s) self (s) | |
2 0.000018 return exists('*bufwinid') ? bufwinid(str2nr(a:buffer)) : 0 | |
FUNCTION <SNR>62_GroupLoclistItems() | |
Called 2 times | |
Total time: 0.000154 | |
Self time: 0.000154 | |
count total (s) self (s) | |
2 0.000005 let l:grouped_items = [] | |
2 0.000004 let l:last_lnum = -1 | |
5 0.000007 for l:obj in a:loclist | |
3 0.000005 if l:obj.bufnr != a:buffer | |
continue | |
endif | |
" Create a new sub-List when we hit a new line. | |
3 0.000058 if l:obj.lnum != l:last_lnum | |
2 0.000007 call add(l:grouped_items, []) | |
2 0.000002 endif | |
3 0.000008 call add(l:grouped_items[-1], l:obj) | |
3 0.000006 let l:last_lnum = l:obj.lnum | |
3 0.000003 endfor | |
2 0.000004 return l:grouped_items | |
FUNCTION ale#command#FormatCommand() | |
Called 2 times | |
Total time: 0.006458 | |
Self time: 0.006294 | |
count total (s) self (s) | |
2 0.000008 let l:temporary_file = '' | |
2 0.000005 let l:command = a:command | |
" First replace all uses of %%, used for literal percent characters, | |
" with an ugly string. | |
2 0.000017 let l:command = substitute(l:command, '%%', '<<PERCENTS>>', 'g') | |
" Replace all %s occurrences in the string with the name of the current | |
" file. | |
2 0.000007 if l:command =~# '%s' | |
2 0.006072 let l:filename = fnamemodify(bufname(a:buffer), ':p') | |
2 0.000122 0.000065 let l:command = substitute(l:command, '%s', '\=ale#Escape(l:filename)', 'g') | |
2 0.000002 endif | |
2 0.000007 if l:command =~# '%t' | |
" Create a temporary filename, <temp_dir>/<original_basename> | |
" The file itself will not be created by this function. | |
let l:temporary_file = s:TemporaryFilename(a:buffer) | |
let l:command = substitute(l:command, '%t', '\=ale#Escape(l:temporary_file)', 'g') | |
endif | |
" Finish formatting so %% becomes %. | |
2 0.000013 let l:command = substitute(l:command, '<<PERCENTS>>', '%', 'g') | |
2 0.000007 if a:pipe_file_if_needed && empty(l:temporary_file) | |
" If we are to send the Vim buffer to a command, we'll do it | |
" in the shell. We'll write out the file to a temporary file, | |
" and then read it back in, in the shell. | |
2 0.000098 0.000026 let l:temporary_file = s:TemporaryFilename(a:buffer) | |
2 0.000055 0.000020 let l:command = l:command . ' < ' . ale#Escape(l:temporary_file) | |
2 0.000002 endif | |
2 0.000007 return [l:temporary_file, l:command] | |
FUNCTION ale#engine#Cleanup() | |
Called 2 times | |
Total time: 0.026094 | |
Self time: 0.000039 | |
count total (s) self (s) | |
2 0.000013 if !has_key(g:ale_buffer_info, a:buffer) | |
1 0.000001 return | |
endif | |
1 0.026065 0.000011 call ale#engine#RunLinters(a:buffer, [], 1) | |
1 0.000005 call remove(g:ale_buffer_info, a:buffer) | |
FUNCTION ale_linters#php#phpcs#Handle() | |
Called 1 time | |
Total time: 0.000427 | |
Self time: 0.000128 | |
count total (s) self (s) | |
" Matches against lines like the following: | |
" | |
" /path/to/some-filename.php:18:3: error - Line indented incorrectly; expected 4 spaces, found 2 (Generic.WhiteSpace.ScopeIndent.IncorrectExact) | |
1 0.000005 let l:pattern = '^.*:\(\d\+\):\(\d\+\): \(.\+\) - \(.\+\) \(\(.\+\)\)$' | |
1 0.000002 let l:output = [] | |
4 0.000316 0.000017 for l:match in ale#util#GetMatches(a:lines, l:pattern) | |
3 0.000008 let l:text = l:match[4] | |
3 0.000047 let l:type = l:match[3] | |
3 0.000029 call add(l:output, { 'lnum': l:match[1] + 0, 'col': l:match[2] + 0, 'text': l:text, 'type': l:type is# 'error' ? 'E' : 'W',}) | |
3 0.000003 endfor | |
1 0.000001 return l:output | |
FUNCTION <SNR>4_LoadFTPlugin() | |
Called 2 times | |
Total time: 0.017356 | |
Self time: 0.008624 | |
count total (s) self (s) | |
2 0.000064 if exists("b:undo_ftplugin") | |
exe b:undo_ftplugin | |
unlet! b:undo_ftplugin b:did_ftplugin | |
endif | |
2 0.000012 let s = expand("<amatch>") | |
2 0.000005 if s != "" | |
2 0.000045 if &cpo =~# "S" && exists("b:did_ftplugin") | |
" In compatible mode options are reset to the global values, need to | |
" set the local values also when a plugin was already used. | |
unlet b:did_ftplugin | |
endif | |
" When there is a dot it is used to separate filetype names. Thus for | |
" "aaa.bbb" load "aaa" and then "bbb". | |
4 0.000210 for name in split(s, '\.') | |
2 0.016956 0.008223 exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim' | |
2 0.000011 endfor | |
2 0.000003 endif | |
FUNCTION ale#util#StartPartialTimer() | |
Called 2 times | |
Total time: 0.000039 | |
Self time: 0.000039 | |
count total (s) self (s) | |
2 0.000019 let l:timer_id = timer_start(a:delay, function('s:ApplyPartialTimer')) | |
2 0.000011 let s:partial_timers[l:timer_id] = [a:callback, a:args] | |
2 0.000005 return l:timer_id | |
FUNCTION ALEInitAuGroups() | |
Called 1 time | |
Total time: 0.000402 | |
Self time: 0.000402 | |
count total (s) self (s) | |
" This value used to be a Boolean as a Number, and is now a String. | |
1 0.000006 let l:text_changed = '' . g:ale_lint_on_text_changed | |
1 0.000004 augroup ALEPatternOptionsGroup | |
1 0.000027 autocmd! | |
1 0.000004 if g:ale_enabled && g:ale_pattern_options_enabled | |
autocmd BufEnter,BufRead * call ale#pattern_options#SetOptions() | |
endif | |
1 0.000001 augroup END | |
1 0.000002 augroup ALERunOnTextChangedGroup | |
1 0.000014 autocmd! | |
1 0.000051 if g:ale_enabled | |
1 0.000006 if l:text_changed is? 'always' || l:text_changed is# '1' | |
autocmd TextChanged,TextChangedI * call ale#Queue(g:ale_lint_delay) | |
elseif l:text_changed is? 'normal' | |
autocmd TextChanged * call ale#Queue(g:ale_lint_delay) | |
elseif l:text_changed is? 'insert' | |
autocmd TextChangedI * call ale#Queue(g:ale_lint_delay) | |
endif | |
1 0.000001 endif | |
1 0.000001 augroup END | |
1 0.000002 augroup ALERunOnEnterGroup | |
1 0.000014 autocmd! | |
1 0.000002 if g:ale_enabled | |
" Handle everything that needs to happen when buffers are entered. | |
1 0.000012 autocmd BufEnter * call ale#events#EnterEvent(str2nr(expand('<abuf>'))) | |
1 0.000001 endif | |
1 0.000003 if g:ale_enabled && g:ale_lint_on_enter | |
1 0.000013 autocmd BufWinEnter,BufRead * call ale#Queue(0, 'lint_file', str2nr(expand('<abuf>'))) | |
" Track when the file is changed outside of Vim. | |
1 0.000005 autocmd FileChangedShellPost * call ale#events#FileChangedEvent(str2nr(expand('<abuf>'))) | |
1 0.000001 endif | |
1 0.000001 augroup END | |
1 0.000002 augroup ALERunOnFiletypeChangeGroup | |
1 0.000014 autocmd! | |
1 0.000003 if g:ale_enabled && g:ale_lint_on_filetype_changed | |
" Only start linting if the FileType actually changes after | |
" opening a buffer. The FileType will fire when buffers are opened. | |
1 0.000006 autocmd FileType * call ale#events#FileTypeEvent( str2nr(expand('<abuf>')), expand('<amatch>')) | |
1 0.000001 endif | |
1 0.000001 augroup END | |
1 0.000001 augroup ALERunOnSaveGroup | |
1 0.000013 autocmd! | |
1 0.000004 if (g:ale_enabled && g:ale_lint_on_save) || g:ale_fix_on_save | |
1 0.000005 autocmd BufWritePost * call ale#events#SaveEvent(str2nr(expand('<abuf>'))) | |
1 0.000001 endif | |
1 0.000001 augroup END | |
1 0.000001 augroup ALERunOnInsertLeave | |
1 0.000076 autocmd! | |
1 0.000005 if g:ale_enabled && g:ale_lint_on_insert_leave | |
autocmd InsertLeave * call ale#Queue(0) | |
endif | |
1 0.000001 augroup END | |
1 0.000002 augroup ALECursorGroup | |
1 0.000014 autocmd! | |
1 0.000002 if g:ale_enabled && g:ale_echo_cursor | |
1 0.000021 autocmd CursorMoved,CursorHold * call ale#cursor#EchoCursorWarningWithDelay() | |
" Look for a warning to echo as soon as we leave Insert mode. | |
" The script's position variable used when moving the cursor will | |
" not be changed here. | |
1 0.000005 autocmd InsertLeave * call ale#cursor#EchoCursorWarning() | |
1 0.000001 endif | |
1 0.000001 augroup END | |
1 0.000002 if !g:ale_enabled | |
if !g:ale_fix_on_save | |
augroup! ALERunOnSaveGroup | |
endif | |
augroup! ALEPatternOptionsGroup | |
augroup! ALERunOnTextChangedGroup | |
augroup! ALERunOnEnterGroup | |
augroup! ALERunOnInsertLeave | |
augroup! ALECursorGroup | |
endif | |
FUNCTION <SNR>7_SynSet() | |
Called 2 times | |
Total time: 0.072105 | |
Self time: 0.015511 | |
count total (s) self (s) | |
" clear syntax for :set syntax=OFF and any syntax name that doesn't exist | |
2 0.000016 syn clear | |
2 0.000022 if exists("b:current_syntax") | |
unlet b:current_syntax | |
endif | |
2 0.000010 let s = expand("<amatch>") | |
2 0.000005 if s == "ON" | |
" :set syntax=ON | |
if &filetype == "" | |
echohl ErrorMsg | |
echo "filetype unknown" | |
echohl None | |
endif | |
let s = &filetype | |
elseif s == "OFF" | |
let s = "" | |
endif | |
2 0.000007 if s != "" | |
" Load the syntax file(s). When there are several, separated by dots, | |
" load each in sequence. | |
4 0.000136 for name in split(s, '\.') | |
2 0.071716 0.015122 exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim" | |
2 0.000005 endfor | |
2 0.000002 endif | |
FUNCTION ale#events#FileTypeEvent() | |
Called 2 times | |
Total time: 0.013626 | |
Self time: 0.000077 | |
count total (s) self (s) | |
2 0.000016 let l:filetype = getbufvar(a:buffer, 'ale_original_filetype', '') | |
" If we're setting the filetype for the first time after it was blank, | |
" and the option for linting on enter is off, then we should set this | |
" filetype as the original filetype. Otherwise ALE will still appear to | |
" lint files because of the BufEnter event, etc. | |
2 0.000086 0.000020 if empty(l:filetype) && !ale#Var(a:buffer, 'lint_on_enter') | |
call setbufvar(a:buffer, 'ale_original_filetype', a:new_filetype) | |
elseif a:new_filetype isnot# l:filetype | |
2 0.013501 0.000018 call ale#Queue(300, 'lint_file', a:buffer) | |
2 0.000002 endif | |
FUNCTION <SNR>48_IsBoolean() | |
Called 12 times | |
Total time: 0.000046 | |
Self time: 0.000046 | |
count total (s) self (s) | |
12 0.000041 return type(a:value) == type(0) && (a:value == 0 || a:value == 1) | |
FUNCTION ale#linter#GetExecutable() | |
Called 2 times | |
Total time: 0.283265 | |
Self time: 0.000048 | |
count total (s) self (s) | |
2 0.283264 0.000047 return has_key(a:linter, 'executable_callback') ? ale#util#GetFunction(a:linter.executable_callback)(a:buffer) : a:linter.executable | |
FUNCTION <SNR>55_HandleExit() | |
Called 2 times | |
Total time: 0.107456 | |
Self time: 0.000208 | |
count total (s) self (s) | |
2 0.000007 if !has_key(s:job_info_map, a:job_id) | |
1 0.000001 return | |
endif | |
1 0.000004 let l:job_info = s:job_info_map[a:job_id] | |
1 0.000002 let l:linter = l:job_info.linter | |
1 0.000002 let l:output = l:job_info.output | |
1 0.000002 let l:buffer = l:job_info.buffer | |
1 0.000003 let l:next_chain_index = l:job_info.next_chain_index | |
1 0.000002 if g:ale_history_enabled | |
1 0.000067 0.000017 call ale#history#SetExitCode(l:buffer, a:job_id, a:exit_code) | |
1 0.000001 endif | |
" Remove this job from the list. | |
1 0.000106 0.000005 call ale#job#Stop(a:job_id) | |
1 0.000005 call remove(s:job_info_map, a:job_id) | |
1 0.000008 call filter(g:ale_buffer_info[l:buffer].job_list, 'v:val isnot# a:job_id') | |
1 0.000006 call filter(g:ale_buffer_info[l:buffer].active_linter_list, 'v:val isnot# l:linter.name') | |
" Stop here if we land in the handle for a job completing if we're in | |
" a sandbox. | |
1 0.000021 0.000005 if ale#util#InSandbox() | |
return | |
endif | |
1 0.000009 if has('nvim') && !empty(l:output) && empty(l:output[-1]) | |
call remove(l:output, -1) | |
endif | |
1 0.000006 if l:next_chain_index < len(get(l:linter, 'command_chain', [])) | |
call s:InvokeChain(l:buffer, l:linter, l:next_chain_index, l:output) | |
return | |
endif | |
" Log the output of the command for ALEInfo if we should. | |
1 0.000003 if g:ale_history_enabled && g:ale_history_log_output | |
1 0.000043 0.000014 call ale#history#RememberOutput(l:buffer, a:job_id, l:output[:]) | |
1 0.000001 endif | |
1 0.000499 0.000064 let l:loclist = ale#util#GetFunction(l:linter.callback)(l:buffer, l:output) | |
1 0.106631 0.000015 call s:HandleLoclist(l:linter.name, l:buffer, l:loclist) | |
FUNCTION ale#highlight#UpdateHighlights() | |
Called 4 times | |
Total time: 0.002490 | |
Self time: 0.001871 | |
count total (s) self (s) | |
4 0.000044 let l:item_list = g:ale_enabled ? get(b:, 'ale_highlight_items', []) : [] | |
4 0.000376 0.000036 call ale#highlight#RemoveHighlights() | |
10 0.000022 for l:item in l:item_list | |
6 0.000043 if l:item.type is# 'W' | |
if get(l:item, 'sub_type', '') is# 'style' | |
let l:group = 'ALEStyleWarning' | |
else | |
let l:group = 'ALEWarning' | |
endif | |
elseif l:item.type is# 'I' | |
let l:group = 'ALEInfo' | |
elseif get(l:item, 'sub_type', '') is# 'style' | |
let l:group = 'ALEStyleError' | |
else | |
6 0.000170 let l:group = 'ALEError' | |
6 0.000008 endif | |
6 0.000016 let l:line = l:item.lnum | |
6 0.000013 let l:col = l:item.col | |
6 0.000024 let l:end_line = get(l:item, 'end_lnum', l:line) | |
6 0.000393 let l:end_col = get(l:item, 'end_col', l:col) | |
" Set all of the positions, which are chunked into Lists which | |
" are as large as will be accepted by matchaddpos. | |
6 0.000410 0.000131 call map( ale#highlight#CreatePositions(l:line, l:col, l:end_line, l:end_col), 'matchaddpos(l:group, v:val)') | |
6 0.000008 endfor | |
FUNCTION <SNR>62_UpdateLineNumbers() | |
Called 2 times | |
Total time: 0.000146 | |
Self time: 0.000146 | |
count total (s) self (s) | |
2 0.000006 let l:line_map = {} | |
2 0.000005 let l:line_numbers_changed = 0 | |
4 0.000011 for [l:line, l:sign_id, l:name] in a:current_sign_list | |
2 0.000008 let l:line_map[l:sign_id] = l:line | |
2 0.000002 endfor | |
5 0.000007 for l:item in a:loclist | |
3 0.000006 if l:item.bufnr == a:buffer | |
3 0.000013 let l:lnum = get(l:line_map, get(l:item, 'sign_id', 0), 0) | |
3 0.000005 if l:lnum && l:item.lnum != l:lnum | |
let l:item.lnum = l:lnum | |
let l:line_numbers_changed = 1 | |
endif | |
3 0.000002 endif | |
3 0.000002 endfor | |
" When the line numbers change, sort the list again | |
2 0.000004 if l:line_numbers_changed | |
call sort(a:loclist, 'ale#util#LocItemCompare') | |
endif | |
FUNCTION ale#job#PrepareCommand() | |
Called 2 times | |
Total time: 0.000122 | |
Self time: 0.000096 | |
count total (s) self (s) | |
" The command will be executed in a subshell. This fixes a number of | |
" issues, including reading the PATH variables correctly, %PATHEXT% | |
" expansion on Windows, etc. | |
" | |
" NeoVim handles this issue automatically if the command is a String, | |
" but we'll do this explicitly, so we use thes same exact command for both | |
" versions. | |
2 0.000040 0.000015 if ale#Has('win32') | |
return 'cmd /c ' . a:command | |
endif | |
2 0.000019 if &shell =~? 'fish$' | |
return ['/bin/sh', '-c', a:command] | |
endif | |
2 0.000039 return split(&shell) + split(&shellcmdflag) + [a:command] | |
FUNCTION ale#util#LocItemCompare() | |
Called 3 times | |
Total time: 0.000103 | |
Self time: 0.000103 | |
count total (s) self (s) | |
3 0.000007 if a:left.bufnr < a:right.bufnr | |
return -1 | |
endif | |
3 0.000006 if a:left.bufnr > a:right.bufnr | |
return 1 | |
endif | |
3 0.000005 if a:left.bufnr == -1 | |
if a:left.filename < a:right.filename | |
return -1 | |
endif | |
if a:left.filename > a:right.filename | |
return 1 | |
endif | |
endif | |
3 0.000006 if a:left.lnum < a:right.lnum | |
1 0.000001 return -1 | |
endif | |
2 0.000004 if a:left.lnum > a:right.lnum | |
return 1 | |
endif | |
2 0.000004 if a:left.col < a:right.col | |
return -1 | |
endif | |
2 0.000004 if a:left.col > a:right.col | |
return 1 | |
endif | |
2 0.000002 return 0 | |
FUNCTION ResetPhpOptions() | |
Called 1 time | |
Total time: 0.000041 | |
Self time: 0.000041 | |
count total (s) self (s) | |
1 0.000011 if ! b:optionsset && &filetype =~ "php" | |
1 0.000002 if b:PHP_autoformatcomment | |
1 0.000005 setlocal comments=s1:/*,mb:*,ex:*/,://,:# | |
1 0.000004 setlocal formatoptions-=t | |
1 0.000002 setlocal formatoptions+=q | |
1 0.000002 setlocal formatoptions+=r | |
1 0.000002 setlocal formatoptions+=o | |
1 0.000002 setlocal formatoptions+=c | |
1 0.000002 setlocal formatoptions+=b | |
1 0.000001 endif | |
1 0.000002 let b:optionsset = 1 | |
1 0.000001 endif | |
FUNCTION ale#engine#ProcessChain() | |
Called 2 times | |
Total time: 0.252008 | |
Self time: 0.000214 | |
count total (s) self (s) | |
2 0.000009 let l:output_stream = get(a:linter, 'output_stream', 'stdout') | |
2 0.000005 let l:read_buffer = a:linter.read_buffer | |
2 0.000004 let l:chain_index = a:chain_index | |
2 0.000003 let l:input = a:input | |
2 0.000005 if has_key(a:linter, 'command_chain') | |
while l:chain_index < len(a:linter.command_chain) | |
" Run a chain of commands, one asynchronous command after the other, | |
" so that many programs can be run in a sequence. | |
let l:chain_item = a:linter.command_chain[l:chain_index] | |
if l:chain_index == 0 | |
" The first callback in the chain takes only a buffer number. | |
let l:command = ale#util#GetFunction(l:chain_item.callback)( a:buffer) | |
else | |
" The second callback in the chain takes some input too. | |
let l:command = ale#util#GetFunction(l:chain_item.callback)( a:buffer, l:input) | |
endif | |
if !empty(l:command) | |
" We hit a command to run, so we'll execute that | |
" The chain item can override the output_stream option. | |
if has_key(l:chain_item, 'output_stream') | |
let l:output_stream = l:chain_item.output_stream | |
endif | |
" The chain item can override the read_buffer option. | |
if has_key(l:chain_item, 'read_buffer') | |
let l:read_buffer = l:chain_item.read_buffer | |
elseif l:chain_index != len(a:linter.command_chain) - 1 | |
" Don't read the buffer for commands besides the last one | |
" in the chain by default. | |
let l:read_buffer = 0 | |
endif | |
break | |
endif | |
" Command chain items can return an empty string to indicate that | |
" a command should be skipped, so we should try the next item | |
" with no input. | |
let l:input = [] | |
let l:chain_index += 1 | |
endwhile | |
else | |
2 0.251818 0.000024 let l:command = ale#linter#GetCommand(a:buffer, a:linter) | |
2 0.000002 endif | |
2 0.000032 return { 'command': l:command, 'buffer': a:buffer, 'linter': a:linter, 'output_stream': l:output_stream, 'next_chain_index': l:chain_index + 1, 'read_buffer': l:read_buffer,} | |
FUNCTION <SNR>48_IsCallback() | |
Called 14 times | |
Total time: 0.000071 | |
Self time: 0.000071 | |
count total (s) self (s) | |
14 0.000064 return type(a:value) == type('') || type(a:value) == type(function('type')) | |
FUNCTION ale#history#SetExitCode() | |
Called 1 time | |
Total time: 0.000050 | |
Self time: 0.000020 | |
count total (s) self (s) | |
1 0.000042 0.000012 let l:obj = s:FindHistoryItem(a:buffer, a:job_id) | |
" If we find a match, then set the code and status. | |
1 0.000003 let l:obj.exit_code = a:exit_code | |
1 0.000002 let l:obj.status = 'finished' | |
FUNCTION <SNR>23_GetManifestPath() | |
Called 1 time | |
Total time: 0.000297 | |
Self time: 0.000297 | |
count total (s) self (s) | |
1 0.000004 let manifest_base = '' | |
1 0.000006 if exists('$NVIM_RPLUGIN_MANIFEST') | |
return fnamemodify($NVIM_RPLUGIN_MANIFEST, ':p') | |
endif | |
1 0.000008 let dest = has('win32') ? '$LOCALAPPDATA' : '$XDG_DATA_HOME' | |
1 0.000004 if !exists(dest) | |
1 0.000005 let dest = has('win32') ? '~/AppData/Local' : '~/.local/share' | |
1 0.000001 endif | |
1 0.000225 let dest = fnamemodify(expand(dest), ':p') | |
1 0.000006 if !empty(dest) | |
1 0.000007 let dest .= ('/' ==# dest[-1:] ? '' : '/') . 'nvim' | |
1 0.000007 if !isdirectory(dest) | |
call mkdir(dest, 'p', 0700) | |
endif | |
1 0.000003 let manifest_base = dest | |
1 0.000001 endif | |
1 0.000003 return manifest_base.'/rplugin.vim' | |
FUNCTION remote#define#FunctionOnHost() | |
Called 3 times | |
Total time: 0.000211 | |
Self time: 0.000149 | |
count total (s) self (s) | |
3 0.000087 0.000025 let group = s:GetNextAutocmdGroup() | |
3 0.000120 exe 'autocmd! '.group.' FuncUndefined '.a:name .' call remote#define#FunctionBootstrap("'.a:host.'"' . ', "'.a:method.'"' . ', '.string(a:sync) . ', "'.a:name.'"' . ', '.string(a:opts) . ', "'.group.'"' . ')' | |
FUNCTION ale#highlight#CreatePositions() | |
Called 6 times | |
Total time: 0.000279 | |
Self time: 0.000279 | |
count total (s) self (s) | |
6 0.000232 if a:line >= a:end_line | |
" For single lines, just return the one position. | |
6 0.000035 return [[[a:line, a:col, a:end_col - a:col + 1]]] | |
endif | |
" Get positions from the first line at the first column, up to a large | |
" integer for highlighting up to the end of the line, followed by | |
" the lines in-between, for highlighting entire lines, and | |
" a highlight for the last line, up to the end column. | |
let l:all_positions = [[a:line, a:col, s:MAX_COL_SIZE]] + range(a:line + 1, a:end_line - 1) + [[a:end_line, 1, a:end_col]] | |
return map( range(0, len(l:all_positions) - 1, s:MAX_POS_VALUES), 'l:all_positions[v:val : v:val + s:MAX_POS_VALUES - 1]',) | |
FUNCTION <SNR>47_ApplyPartialTimer() | |
Called 1 time | |
Total time: 0.059721 | |
Self time: 0.000196 | |
count total (s) self (s) | |
1 0.000012 let [l:Callback, l:args] = remove(s:partial_timers, a:timer_id) | |
1 0.059707 0.000182 call call(l:Callback, [a:timer_id] + l:args) | |
FUNCTION ale#util#InSandbox() | |
Called 13 times | |
Total time: 0.000249 | |
Self time: 0.000249 | |
count total (s) self (s) | |
13 0.000025 try | |
13 0.000039 function! s:SandboxCheck() abort | |
endfunction | |
13 0.000021 catch /^Vim\%((\a\+)\)\=:E48/ | |
" E48 is the sandbox error. | |
return 1 | |
endtry | |
13 0.000083 return 0 | |
FUNCTION ale#sign#FindCurrentSigns() | |
Called 2 times | |
Total time: 0.000398 | |
Self time: 0.000035 | |
count total (s) self (s) | |
2 0.000080 0.000017 let l:line_list = ale#sign#ReadSigns(a:buffer) | |
2 0.000316 0.000016 return ale#sign#ParseSigns(l:line_list) | |
FUNCTION <SNR>55_RunJob() | |
Called 2 times | |
Total time: 0.025298 | |
Self time: 0.003244 | |
count total (s) self (s) | |
2 0.000006 let l:command = a:options.command | |
2 0.000004 let l:buffer = a:options.buffer | |
2 0.000004 let l:linter = a:options.linter | |
2 0.000005 let l:output_stream = a:options.output_stream | |
2 0.000005 let l:next_chain_index = a:options.next_chain_index | |
2 0.000004 let l:read_buffer = a:options.read_buffer | |
2 0.000008 let l:info = g:ale_buffer_info[l:buffer] | |
2 0.000004 if empty(l:command) | |
return 0 | |
endif | |
2 0.007876 0.001334 let [l:temporary_file, l:command] = ale#command#FormatCommand(l:buffer, l:command, l:read_buffer) | |
2 0.010245 0.000065 if s:CreateTemporaryFileForJob(l:buffer, l:temporary_file) | |
" If a temporary filename has been formatted in to the command, then | |
" we do not need to send the Vim buffer to the command. | |
2 0.000015 let l:read_buffer = 0 | |
2 0.000003 endif | |
" Add a newline to commands which need it. | |
" This is only used for Flow for now, and is not documented. | |
2 0.000006 if l:linter.add_newline | |
if has('win32') | |
let l:command = l:command . '; echo.' | |
else | |
let l:command = l:command . '; echo' | |
endif | |
endif | |
2 0.001887 0.001453 let l:command = ale#job#PrepareCommand(l:command) | |
2 0.000025 let l:job_options = { 'mode': 'nl', 'exit_cb': function('s:HandleExit'),} | |
2 0.000005 if l:output_stream is# 'stderr' | |
let l:job_options.err_cb = function('s:GatherOutput') | |
elseif l:output_stream is# 'both' | |
let l:job_options.out_cb = function('s:GatherOutput') | |
let l:job_options.err_cb = function('s:GatherOutput') | |
else | |
2 0.000011 let l:job_options.out_cb = function('s:GatherOutput') | |
2 0.000002 endif | |
2 0.000007 if get(g:, 'ale_run_synchronously') == 1 | |
" Find a unique Job value to use, which will be the same as the ID for | |
" running commands synchronously. This is only for test code. | |
let l:job_id = len(s:job_info_map) + 1 | |
while has_key(s:job_info_map, l:job_id) | |
let l:job_id += 1 | |
endwhile | |
else | |
2 0.004814 0.000029 let l:job_id = ale#job#Start(l:command, l:job_options) | |
2 0.000003 endif | |
2 0.000006 let l:status = 'failed' | |
" Only proceed if the job is being run. | |
2 0.000002 if l:job_id | |
" Add the job to the list of jobs, so we can track them. | |
2 0.000017 call add(l:info.job_list, l:job_id) | |
2 0.000008 if index(l:info.active_linter_list, l:linter.name) < 0 | |
2 0.000006 call add(l:info.active_linter_list, l:linter.name) | |
2 0.000002 endif | |
2 0.000004 let l:status = 'started' | |
" Store the ID for the job in the map to read back again. | |
2 0.000016 let s:job_info_map[l:job_id] = { 'linter': l:linter, 'buffer': l:buffer, 'output': [], 'next_chain_index': l:next_chain_index,} | |
2 0.000002 endif | |
2 0.000004 if g:ale_history_enabled | |
2 0.000133 0.000020 call ale#history#Add(l:buffer, l:status, l:job_id, l:command) | |
2 0.000001 endif | |
2 0.000005 if get(g:, 'ale_run_synchronously') == 1 | |
" Run a command synchronously if this test option is set. | |
let s:job_info_map[l:job_id].output = systemlist( type(l:command) == type([]) ? join(l:command[0:1]) . ' ' . ale#Escape(l:command[2]) : l:command) | |
call l:job_options.exit_cb(l:job_id, v:shell_error) | |
endif | |
2 0.000005 return l:job_id != 0 | |
FUNCTION ale#CallWithCooldown() | |
Called 12 times | |
Total time: 1.211978 | |
Self time: 0.001488 | |
count total (s) self (s) | |
12 0.001608 0.001081 let l:now = ale#util#ClockMilliseconds() | |
12 0.000057 if l:now < get(s:timestamp_map, a:timestamp_key, -1) | |
return 0 | |
endif | |
12 0.000106 let s:timestamp_map[a:timestamp_key] = l:now + s:error_delay_ms | |
12 0.612746 0.001422 let l:return_value = call(a:func, a:arglist) | |
12 0.000055 let s:timestamp_map[a:timestamp_key] = -1 | |
12 0.000026 return l:return_value | |
FUNCTION ale#util#GetFunction() | |
Called 8 times | |
Total time: 0.000079 | |
Self time: 0.000079 | |
count total (s) self (s) | |
8 0.000032 if type(a:string_or_ref) == type('') | |
5 0.000016 return function(a:string_or_ref) | |
endif | |
3 0.000006 return a:string_or_ref | |
FUNCTION <SNR>55_InvokeChain() | |
Called 2 times | |
Total time: 0.277360 | |
Self time: 0.000054 | |
count total (s) self (s) | |
2 0.252031 0.000023 let l:options = ale#engine#ProcessChain(a:buffer, a:linter, a:chain_index, a:input) | |
2 0.025326 0.000028 return s:RunJob(l:options) | |
FUNCTION ale#Lint() | |
Called 2 times | |
Total time: 0.597328 | |
Self time: 0.000063 | |
count total (s) self (s) | |
2 0.000016 if a:0 > 1 | |
" Use the buffer number given as the optional second argument. | |
2 0.000004 let l:buffer = a:2 | |
2 0.000003 elseif a:0 > 0 && a:1 == s:lint_timer | |
" Use the buffer number for the buffer linting was queued for. | |
let l:buffer = s:queued_buffer_number | |
else | |
" Use the current buffer number. | |
let l:buffer = bufnr('') | |
endif | |
2 0.597290 0.000026 return ale#CallWithCooldown( 'dont_lint_until', function('s:ALELintImpl'), [l:buffer],) | |
FUNCTION ale#linter#GetAll() | |
Called 5 times | |
Total time: 0.010031 | |
Self time: 0.007155 | |
count total (s) self (s) | |
5 0.000010 let l:combined_linters = [] | |
10 0.000015 for l:filetype in a:filetypes | |
" Load linter defintions from files if we haven't loaded them yet. | |
5 0.000012 if !has_key(s:linters, l:filetype) | |
1 0.009829 0.006954 execute 'silent! runtime! ale_linters/' . l:filetype . '/*.vim' | |
" Always set an empty List for the loaded linters if we don't find | |
" any. This will prevent us from executing the runtime command | |
" many times, redundantly. | |
1 0.000003 if !has_key(s:linters, l:filetype) | |
let s:linters[l:filetype] = [] | |
endif | |
1 0.000001 endif | |
5 0.000026 call extend(l:combined_linters, get(s:linters, l:filetype, [])) | |
5 0.000004 endfor | |
5 0.000008 return l:combined_linters | |
FUNCTION <SNR>48_GetLinterNames() | |
Called 5 times | |
Total time: 0.000090 | |
Self time: 0.000090 | |
count total (s) self (s) | |
10 0.000030 for l:dict in [ get(b:, 'ale_linters', {}), g:ale_linters, s:default_ale_linters,] | |
10 0.000025 if has_key(l:dict, a:original_filetype) | |
5 0.000010 return l:dict[a:original_filetype] | |
endif | |
5 0.000003 endfor | |
return 'all' | |
FUNCTION ale_linters#php#phpcs#GetExecutable() | |
Called 4 times | |
Total time: 0.534778 | |
Self time: 0.001184 | |
count total (s) self (s) | |
4 0.534775 0.001181 return ale#node#FindExecutable(a:buffer, 'php_phpcs', [ 'vendor/bin/phpcs', 'phpcs']) | |
FUNCTION <SNR>55_RunLinter() | |
Called 2 times | |
Total time: 0.566362 | |
Self time: 0.000158 | |
count total (s) self (s) | |
2 0.000007 if !empty(a:linter.lsp) | |
return s:CheckWithLSP(a:buffer, a:linter) | |
else | |
2 0.283282 0.000017 let l:executable = ale#linter#GetExecutable(a:buffer, a:linter) | |
2 0.005654 0.000075 if ale#engine#IsExecutable(a:buffer, l:executable) | |
2 0.277407 0.000047 return s:InvokeChain(a:buffer, a:linter, 0, []) | |
endif | |
endif | |
return 0 | |
FUNCTION ale#linter#ResolveFiletype() | |
Called 5 times | |
Total time: 0.000272 | |
Self time: 0.000085 | |
count total (s) self (s) | |
5 0.000242 0.000055 let l:filetype = s:GetAliasedFiletype(a:original_filetype) | |
5 0.000014 if type(l:filetype) != type([]) | |
5 0.000008 return [l:filetype] | |
endif | |
return l:filetype | |
FUNCTION ale#util#GetMatches() | |
Called 1 time | |
Total time: 0.000298 | |
Self time: 0.000298 | |
count total (s) self (s) | |
1 0.000002 let l:matches = [] | |
1 0.000005 let l:lines = type(a:lines) == type([]) ? a:lines : [a:lines] | |
1 0.000004 let l:patterns = type(a:patterns) == type([]) ? a:patterns : [a:patterns] | |
4 0.000006 for l:line in l:lines | |
3 0.000007 for l:pattern in l:patterns | |
3 0.000226 let l:match = matchlist(l:line, l:pattern) | |
3 0.000008 if !empty(l:match) | |
3 0.000008 call add(l:matches, l:match) | |
3 0.000003 break | |
endif | |
endfor | |
3 0.000002 endfor | |
1 0.000002 return l:matches | |
FUNCTION ale#engine#RemoveManagedFiles() | |
Called 2 times | |
Total time: 0.000374 | |
Self time: 0.000349 | |
count total (s) self (s) | |
2 0.000010 let l:info = get(g:ale_buffer_info, a:buffer, {}) | |
" We can't delete anything in a sandbox, so wait until we escape from | |
" it to delete temporary files and directories. | |
2 0.000034 0.000009 if ale#util#InSandbox() | |
return | |
endif | |
" Delete files with a call akin to a plan `rm` command. | |
2 0.000006 if has_key(l:info, 'temporary_file_list') | |
2 0.000005 for l:filename in l:info.temporary_file_list | |
call delete(l:filename) | |
endfor | |
2 0.000005 let l:info.temporary_file_list = [] | |
2 0.000002 endif | |
" Delete directories like `rm -rf`. | |
" Directories are handled differently from files, so paths that are | |
" intended to be single files can be set up for automatic deletion without | |
" accidentally deleting entire directories. | |
2 0.000005 if has_key(l:info, 'temporary_directory_list') | |
4 0.000030 for l:directory in l:info.temporary_directory_list | |
2 0.000230 call delete(l:directory, 'rf') | |
2 0.000004 endfor | |
2 0.000006 let l:info.temporary_directory_list = [] | |
2 0.000002 endif | |
FUNCTION <SNR>15_ALELintImpl() | |
Called 2 times | |
Total time: 0.597169 | |
Self time: 0.018308 | |
count total (s) self (s) | |
2 0.000235 0.000009 if ale#ShouldDoNothing(a:buffer) | |
return | |
endif | |
" Use the filetype from the buffer | |
2 0.000836 0.000017 let l:linters = ale#linter#Get(getbufvar(a:buffer, '&filetype')) | |
2 0.000003 let l:should_lint_file = 0 | |
" Check if we previously requested checking the file. | |
2 0.000006 if has_key(s:should_lint_file_for_buffer, a:buffer) | |
2 0.000006 unlet s:should_lint_file_for_buffer[a:buffer] | |
" Lint files if they exist. | |
2 0.016961 let l:should_lint_file = filereadable(expand('#' . a:buffer . ':p')) | |
2 0.000026 endif | |
2 0.579078 0.001262 call ale#engine#RunLinters(a:buffer, l:linters, l:should_lint_file) | |
FUNCTION <SNR>63_FixList() | |
Called 1 time | |
Total time: 0.000078 | |
Self time: 0.000078 | |
count total (s) self (s) | |
1 0.000003 let l:new_list = [] | |
4 0.000008 for l:item in a:list | |
3 0.000006 if l:item.bufnr == -1 | |
" If the buffer number is invalid, remove it. | |
let l:fixed_item = copy(l:item) | |
call remove(l:fixed_item, 'bufnr') | |
else | |
" Don't copy the Dictionary if we do not need to. | |
3 0.000006 let l:fixed_item = l:item | |
3 0.000003 endif | |
3 0.000010 call add(l:new_list, l:fixed_item) | |
3 0.000003 endfor | |
1 0.000002 return l:new_list | |
FUNCTION ale#sign#GetSignCommands() | |
Called 2 times | |
Total time: 0.000335 | |
Self time: 0.000335 | |
count total (s) self (s) | |
2 0.000005 let l:command_list = [] | |
2 0.000006 let l:is_dummy_sign_set = a:was_sign_set | |
" Set the dummy sign if we need to. | |
" The dummy sign is needed to keep the sign column open while we add | |
" and remove signs. | |
2 0.000010 if !l:is_dummy_sign_set && (!empty(a:sign_map) || g:ale_sign_column_always) | |
2 0.000016 call add(l:command_list, 'sign place ' . g:ale_sign_offset . ' line=1 name=ALEDummySign buffer=' . a:buffer) | |
2 0.000021 let l:is_dummy_sign_set = 1 | |
2 0.000002 endif | |
" Place new items first. | |
6 0.000020 for [l:line_str, l:info] in items(a:sign_map) | |
4 0.000007 if l:info.new_id | |
" Save the sign IDs we are setting back on our loclist objects. | |
" These IDs will be used to preserve items which are set many times. | |
5 0.000008 for l:item in l:info.items | |
3 0.000008 let l:item.sign_id = l:info.new_id | |
3 0.000005 endfor | |
2 0.000005 if index(l:info.current_id_list, l:info.new_id) < 0 | |
2 0.000016 call add(l:command_list, 'sign place ' . (l:info.new_id) . ' line=' . l:line_str . ' name=' . (l:info.new_name) . ' buffer=' . a:buffer) | |
2 0.000002 endif | |
2 0.000001 endif | |
4 0.000003 endfor | |
" Remove signs without new IDs. | |
6 0.000012 for l:info in values(a:sign_map) | |
6 0.000010 for l:current_id in l:info.current_id_list | |
2 0.000005 if l:current_id isnot l:info.new_id | |
2 0.000013 call add(l:command_list, 'sign unplace ' . l:current_id . ' buffer=' . a:buffer) | |
2 0.000002 endif | |
2 0.000002 endfor | |
4 0.000003 endfor | |
" Remove the dummy sign to close the sign column if we need to. | |
2 0.000005 if l:is_dummy_sign_set && !g:ale_sign_column_always | |
2 0.000010 call add(l:command_list, 'sign unplace ' . g:ale_sign_offset . ' buffer=' . a:buffer) | |
2 0.000001 endif | |
2 0.000003 return l:command_list | |
FUNCTION ale#cursor#EchoCursorWarningWithDelay() | |
Called 1 time | |
Total time: 0.000109 | |
Self time: 0.000065 | |
count total (s) self (s) | |
" Only echo the warnings in normal mode, otherwise we will get problems. | |
1 0.000007 if mode() isnot# 'n' | |
return | |
endif | |
1 0.000026 0.000016 call s:StopCursorTimer() | |
1 0.000006 let l:pos = getcurpos()[0:2] | |
" Check the current buffer, line, and column number against the last | |
" recorded position. If the position has actually changed, *then* | |
" we should echo something. Otherwise we can end up doing processing | |
" the echo message far too frequently. | |
1 0.000003 if l:pos != s:last_pos | |
1 0.000044 0.000009 let l:delay = ale#Var(bufnr(''), 'echo_delay') | |
1 0.000003 let s:last_pos = l:pos | |
1 0.000008 let s:cursor_timer = timer_start( l:delay, function('ale#cursor#EchoCursorWarning')) | |
1 0.000001 endif | |
FUNCTION <SNR>46_LintOnEnter() | |
Called 3 times | |
Total time: 0.000853 | |
Self time: 0.000485 | |
count total (s) self (s) | |
3 0.000775 0.000406 if ale#Var(a:buffer, 'enabled')&& g:ale_lint_on_enter&& has_key(b:, 'ale_file_changed') | |
call remove(b:, 'ale_file_changed') | |
call ale#Queue(0, 'lint_file', a:buffer) | |
endif | |
FUNCTION ale#Queue() | |
Called 7 times | |
Total time: 0.614118 | |
Self time: 0.000375 | |
count total (s) self (s) | |
7 0.000154 if a:0 > 2 | |
throw 'too many arguments!' | |
endif | |
" Default linting_flag to '' | |
7 0.000036 let l:linting_flag = get(a:000, 0, '') | |
7 0.000029 let l:buffer = get(a:000, 1, bufnr('')) | |
7 0.613854 0.000111 return ale#CallWithCooldown( 'dont_queue_until', function('s:ALEQueueImpl'), [a:delay, l:linting_flag, l:buffer],) | |
FUNCTION ale#engine#ManageDirectory() | |
Called 2 times | |
Total time: 0.000014 | |
Self time: 0.000014 | |
count total (s) self (s) | |
2 0.000012 call add(g:ale_buffer_info[a:buffer].temporary_directory_list, a:directory) | |
FUNCTION <SNR>55_AddProblemsFromOtherBuffers() | |
Called 1 time | |
Total time: 0.009970 | |
Self time: 0.009970 | |
count total (s) self (s) | |
1 0.009862 let l:filename = expand('#' . a:buffer . ':p') | |
1 0.000012 let l:loclist = [] | |
1 0.000002 let l:name_map = {} | |
" Build a map of the active linters. | |
2 0.000006 for l:linter in a:linters | |
1 0.000006 let l:name_map[l:linter.name] = 1 | |
1 0.000002 endfor | |
" Find the items from other buffers, for the linters that are enabled. | |
2 0.000006 for l:info in values(g:ale_buffer_info) | |
1 0.000002 for l:item in l:info.loclist | |
if has_key(l:item, 'filename')&& l:item.filename is# l:filename&& has_key(l:name_map, l:item.linter_name) | |
" Copy the items and set the buffer numbers to this one. | |
let l:new_item = copy(l:item) | |
let l:new_item.bufnr = a:buffer | |
call add(l:loclist, l:new_item) | |
endif | |
endfor | |
1 0.000001 endfor | |
1 0.000003 if !empty(l:loclist) | |
call sort(l:loclist, function('ale#util#LocItemCompareWithText')) | |
call uniq(l:loclist, function('ale#util#LocItemCompareWithText')) | |
" Set the loclist variable, used by some parts of ALE. | |
let g:ale_buffer_info[a:buffer].loclist = l:loclist | |
call ale#engine#SetResults(a:buffer, l:loclist) | |
endif | |
FUNCTION ale#ShouldDoNothing() | |
Called 13 times | |
Total time: 0.001818 | |
Self time: 0.000459 | |
count total (s) self (s) | |
" Do nothing for blacklisted files | |
" OR if ALE is running in the sandbox | |
13 0.001792 0.000434 return index(g:ale_filetype_blacklist, &filetype) >= 0 || (exists('*getcmdwintype') && !empty(getcmdwintype())) || ale#util#InSandbox() || !ale#Var(a:buffer, 'enabled') || ale#FileTooLarge() || getbufvar(a:buffer, '&l:statusline') =~# 'CtrlPMode.*funky' | |
FUNCTION <SNR>61_FindItemAtCursor() | |
Called 3 times | |
Total time: 0.000298 | |
Self time: 0.000171 | |
count total (s) self (s) | |
3 0.000008 let l:buf = bufnr('') | |
3 0.000090 let l:info = get(g:ale_buffer_info, l:buf, {}) | |
3 0.000011 let l:loclist = get(l:info, 'loclist', []) | |
3 0.000008 let l:pos = getcurpos() | |
3 0.000158 0.000031 let l:index = ale#util#BinarySearch(l:loclist, l:buf, l:pos[1], l:pos[2]) | |
3 0.000010 let l:loc = l:index >= 0 ? l:loclist[l:index] : {} | |
3 0.000006 return [l:info, l:loc] | |
FUNCTION ale#list#SetLists() | |
Called 2 times | |
Total time: 0.000130 | |
Self time: 0.000090 | |
count total (s) self (s) | |
2 0.000034 if get(g:, 'ale_set_lists_synchronously') == 1|| getbufvar(a:buffer, 'ale_save_event_fired', 0) | |
" Update lists immediately if running a test synchronously, or if the | |
" buffer was saved. | |
" | |
" The lists need to be updated immediately when saving a buffer so | |
" that we can reliably close window automatically, if so configured. | |
call s:SetListsImpl(-1, a:buffer, a:loclist) | |
else | |
2 0.000073 0.000034 call ale#util#StartPartialTimer( 0, function('s:SetListsImpl'), [a:buffer, a:loclist],) | |
2 0.000002 endif | |
FUNCTION ale#sign#ReadSigns() | |
Called 2 times | |
Total time: 0.000063 | |
Self time: 0.000063 | |
count total (s) self (s) | |
2 0.000007 redir => l:output | |
2 0.000030 silent execute 'sign place buffer=' . a:buffer | |
2 0.000006 redir end | |
2 0.000017 return split(l:output, "\n") | |
FUNCTION ale#engine#IsExecutable() | |
Called 2 times | |
Total time: 0.005579 | |
Self time: 0.005292 | |
count total (s) self (s) | |
2 0.000017 if has_key(s:executable_cache_map, a:executable) | |
1 0.000001 return 1 | |
endif | |
1 0.000003 let l:result = 0 | |
1 0.001415 if executable(a:executable) | |
1 0.000011 let s:executable_cache_map[a:executable] = 1 | |
1 0.000004 let l:result = 1 | |
1 0.000001 endif | |
1 0.000002 if g:ale_history_enabled | |
1 0.004106 0.003818 call ale#history#Add(a:buffer, l:result, 'executable', a:executable) | |
1 0.000001 endif | |
1 0.000002 return l:result | |
FUNCTION <SNR>21_Highlight_Matching_Pair() | |
Called 3 times | |
Total time: 0.001177 | |
Self time: 0.001177 | |
count total (s) self (s) | |
" Remove any previous match. | |
3 0.000022 if exists('w:paren_hl_on') && w:paren_hl_on | |
silent! call matchdelete(3) | |
let w:paren_hl_on = 0 | |
endif | |
" Avoid that we remove the popup menu. | |
" Return when there are no colors (looks like the cursor jumps). | |
3 0.000081 if pumvisible() || (&t_Co < 8 && !has("gui_running")) | |
return | |
endif | |
" Get the character under the cursor and check if it's in 'matchpairs'. | |
3 0.000026 let c_lnum = line('.') | |
3 0.000011 let c_col = col('.') | |
3 0.000006 let before = 0 | |
3 0.000011 let text = getline(c_lnum) | |
3 0.000373 let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)') | |
3 0.000012 if empty(matches) | |
let [c_before, c] = ['', ''] | |
else | |
3 0.000020 let [c_before, c] = matches[1:2] | |
3 0.000003 endif | |
3 0.000057 let plist = split(&matchpairs, '.\zs[:,]') | |
3 0.000014 let i = index(plist, c) | |
3 0.000354 if i < 0 | |
" not found, in Insert mode try character before the cursor | |
3 0.000021 if c_col > 1 && (mode() == 'i' || mode() == 'R') | |
let before = strlen(c_before) | |
let c = c_before | |
let i = index(plist, c) | |
endif | |
3 0.000005 if i < 0 | |
" not found, nothing to do | |
3 0.000005 return | |
endif | |
endif | |
" Figure out the arguments for searchpairpos(). | |
if i % 2 == 0 | |
let s_flags = 'nW' | |
let c2 = plist[i + 1] | |
else | |
let s_flags = 'nbW' | |
let c2 = c | |
let c = plist[i - 1] | |
endif | |
if c == '[' | |
let c = '\[' | |
let c2 = '\]' | |
endif | |
" Find the match. When it was just before the cursor move it there for a | |
" moment. | |
if before > 0 | |
let has_getcurpos = exists("*getcurpos") | |
if has_getcurpos | |
" getcurpos() is more efficient but doesn't exist before 7.4.313. | |
let save_cursor = getcurpos() | |
else | |
let save_cursor = winsaveview() | |
endif | |
call cursor(c_lnum, c_col - before) | |
endif | |
" Build an expression that detects whether the current cursor position is in | |
" certain syntax types (string, comment, etc.), for use as searchpairpos()'s | |
" skip argument. | |
" We match "escape" for special items, such as lispEscapeSpecial. | |
let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))' | |
" If executing the expression determines that the cursor is currently in | |
" one of the syntax types, then we want searchpairpos() to find the pair | |
" within those syntax types (i.e., not skip). Otherwise, the cursor is | |
" outside of the syntax types and s_skip should keep its value so we skip any | |
" matching pair inside the syntax types. | |
execute 'if' s_skip '| let s_skip = 0 | endif' | |
" Limit the search to lines visible in the window. | |
let stoplinebottom = line('w$') | |
let stoplinetop = line('w0') | |
if i % 2 == 0 | |
let stopline = stoplinebottom | |
else | |
let stopline = stoplinetop | |
endif | |
" Limit the search time to 300 msec to avoid a hang on very long lines. | |
" This fails when a timeout is not supported. | |
if mode() == 'i' || mode() == 'R' | |
let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout | |
else | |
let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout | |
endif | |
try | |
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout) | |
catch /E118/ | |
" Can't use the timeout, restrict the stopline a bit more to avoid taking | |
" a long time on closed folds and long lines. | |
" The "viewable" variables give a range in which we can scroll while | |
" keeping the cursor at the same position. | |
" adjustedScrolloff accounts for very large numbers of scrolloff. | |
let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2]) | |
let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2]) | |
let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2]) | |
" one of these stoplines will be adjusted below, but the current values are | |
" minimal boundaries within the current window | |
if i % 2 == 0 | |
if has("byte_offset") && has("syntax_items") && &smc > 0 | |
let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2]) | |
let stopline = min([bottom_viewable, byte2line(stopbyte)]) | |
else | |
let stopline = min([bottom_viewable, c_lnum + 100]) | |
endif | |
let stoplinebottom = stopline | |
else | |
if has("byte_offset") && has("syntax_items") && &smc > 0 | |
let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2]) | |
let stopline = max([top_viewable, byte2line(stopbyte)]) | |
else | |
let stopline = max([top_viewable, c_lnum - 100]) | |
endif | |
let stoplinetop = stopline | |
endif | |
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline) | |
endtry | |
if before > 0 | |
if has_getcurpos | |
call setpos('.', save_cursor) | |
else | |
call winrestview(save_cursor) | |
endif | |
endif | |
" If a match is found setup match highlighting. | |
if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom | |
if exists('*matchaddpos') | |
call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3) | |
else | |
exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' | |
endif | |
let w:paren_hl_on = 1 | |
endif | |
FUNCTION ale#Escape() | |
Called 6 times | |
Total time: 0.000131 | |
Self time: 0.000131 | |
count total (s) self (s) | |
6 0.000039 if fnamemodify(&shell, ':t') is? 'cmd.exe' | |
" If the string contains spaces, it will be surrounded by quotes. | |
" Otherwise, special characters will be escaped with carets (^). | |
return substitute( a:str =~# ' ' ? '"' . substitute(a:str, '"', '""', 'g') . '"' : substitute(a:str, '\v([&|<>^])', '^\1', 'g'), '%', '%%', 'g',) | |
endif | |
6 0.000027 return shellescape (a:str) | |
FUNCTION <SNR>61_EchoImpl() | |
Called 3 times | |
Total time: 0.000820 | |
Self time: 0.000129 | |
count total (s) self (s) | |
" Only echo the warnings in normal mode, otherwise we will get problems. | |
3 0.000007 if mode() isnot# 'n' | |
return | |
endif | |
3 0.000413 0.000019 if ale#ShouldDoNothing(bufnr('')) | |
return | |
endif | |
3 0.000327 0.000029 let [l:info, l:loc] = s:FindItemAtCursor() | |
3 0.000007 if !empty(l:loc) | |
let l:msg = s:GetMessage(l:loc.linter_name, l:loc.type, l:loc.text) | |
call ale#cursor#TruncatedEcho(l:msg) | |
let l:info.echoed = 1 | |
elseif get(l:info, 'echoed') | |
" We'll only clear the echoed message when moving off errors once, | |
" so we don't continually clear the echo line. | |
echo | |
let l:info.echoed = 0 | |
endif | |
FUNCTION ale#util#ClockMilliseconds() | |
Called 12 times | |
Total time: 0.000304 | |
Self time: 0.000304 | |
count total (s) self (s) | |
12 0.000294 return float2nr(reltimefloat(reltime()) * 1000) | |
FUNCTION <SNR>60_NeoVimCallback() | |
Called 3 times | |
Total time: 0.107877 | |
Self time: 0.000285 | |
count total (s) self (s) | |
3 0.000042 let l:info = s:job_map[a:job] | |
3 0.000011 if a:event is# 'stdout' | |
1 0.000142 0.000030 let l:info.out_cb_line = ale#job#JoinNeovimOutput( a:job, l:info.out_cb_line, a:data, l:info.mode, ale#util#GetFunction(l:info.out_cb),) | |
1 0.000001 elseif a:event is# 'stderr' | |
let l:info.err_cb_line = ale#job#JoinNeovimOutput( a:job, l:info.err_cb_line, a:data, l:info.mode, ale#util#GetFunction(l:info.err_cb),) | |
else | |
2 0.000012 if has_key(l:info, 'out_cb') && !empty(l:info.out_cb_line) | |
call ale#util#GetFunction(l:info.out_cb)(a:job, l:info.out_cb_line) | |
endif | |
2 0.000008 if has_key(l:info, 'err_cb') && !empty(l:info.err_cb_line) | |
call ale#util#GetFunction(l:info.err_cb)(a:job, l:info.err_cb_line) | |
endif | |
2 0.000004 try | |
2 0.107517 0.000037 call ale#util#GetFunction(l:info.exit_cb)(a:job, a:data) | |
2 0.000004 finally | |
" Automatically forget about the job after it's done. | |
2 0.000018 if has_key(s:job_map, a:job) | |
2 0.000010 call remove(s:job_map, a:job) | |
2 0.000002 endif | |
2 0.000003 endtry | |
2 0.000002 endif | |
FUNCTIONS SORTED ON TOTAL TIME | |
count total (s) self (s) function | |
12 1.211978 0.001488 ale#CallWithCooldown() | |
7 0.614118 0.000375 ale#Queue() | |
7 0.611888 0.001906 <SNR>15_ALEQueueImpl() | |
3 0.603082 0.000393 ale#engine#RunLinters() | |
2 0.597328 0.000063 ale#Lint() | |
2 0.597169 0.018308 <SNR>15_ALELintImpl() | |
2 0.566362 0.000158 <SNR>55_RunLinter() | |
4 0.534778 0.001184 ale_linters#php#phpcs#GetExecutable() | |
4 0.533447 0.001590 ale#node#FindExecutable() | |
8 0.531397 ale#path#FindNearestFile() | |
2 0.283265 0.000048 ale#linter#GetExecutable() | |
2 0.277360 0.000054 <SNR>55_InvokeChain() | |
2 0.252008 0.000214 ale#engine#ProcessChain() | |
2 0.251794 0.000033 ale#linter#GetCommand() | |
2 0.251746 0.000066 ale_linters#php#phpcs#GetCommand() | |
2 0.131488 0.006483 ale#engine#SetResults() | |
2 0.122116 0.120526 ale#sign#SetSigns() | |
3 0.107877 0.000285 <SNR>60_NeoVimCallback() | |
2 0.107456 0.000208 <SNR>55_HandleExit() | |
1 0.106616 0.000109 <SNR>55_HandleLoclist() | |
FUNCTIONS SORTED ON SELF TIME | |
count total (s) self (s) function | |
8 0.531397 ale#path#FindNearestFile() | |
2 0.122116 0.120526 ale#sign#SetSigns() | |
2 0.597169 0.018308 <SNR>15_ALELintImpl() | |
2 0.072105 0.015511 <SNR>7_SynSet() | |
1 0.009970 <SNR>55_AddProblemsFromOtherBuffers() | |
2 0.009852 ale#util#Writefile() | |
4 0.008801 <SNR>22_LocalBrowse() | |
2 0.017356 0.008624 <SNR>4_LoadFTPlugin() | |
5 0.010031 0.007155 ale#linter#GetAll() | |
1 0.059525 0.007082 <SNR>63_SetListsImpl() | |
2 0.131488 0.006483 ale#engine#SetResults() | |
2 0.006458 0.006294 ale#command#FormatCommand() | |
2 0.005579 0.005292 ale#engine#IsExecutable() | |
1 0.006357 0.004930 <SNR>22_VimEnter() | |
2 0.004785 0.004769 ale#job#Start() | |
2 0.025298 0.003244 <SNR>55_RunJob() | |
1 0.003772 0.003122 remote#host#RegisterPlugin() | |
2 0.004847 0.002501 <SNR>5_LoadIndent() | |
1 0.008809 0.002139 <SNR>23_LoadRemotePlugins() | |
43 0.002136 ale#Var() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment