Advertisement
Guest User

neovim#6239#slowprofile

a guest
Mar 10th, 2017
1,774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 386.97 KB | None | 0 0
  1. SCRIPT /data/roxma/test/starttime/min.vim
  2. Sourced 1 time
  3. Total time: 0.021527
  4. Self time: 0.000375
  5.  
  6. count total (s) self (s)
  7.  
  8. 1 0.000012 set nocompatible
  9. 1 0.000052 syntax on
  10. 1 0.000057 filetype plugin indent on
  11. 1 0.000013 set encoding=utf-8 fileencodings=ucs-bom,utf-8,gbk,gb18030,latin1 termencoding=utf-8
  12.  
  13. 1 0.000009 set rtp+=.
  14.  
  15.  
  16. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/syntax/syntax.vim
  17. Sourced 1 time
  18. Total time: 0.020956
  19. Self time: 0.000379
  20.  
  21. count total (s) self (s)
  22. " Vim syntax support file
  23. " Maintainer: Bram Moolenaar <Bram@vim.org>
  24. " Last Change: 2001 Sep 04
  25.  
  26. " This file is used for ":syntax on".
  27. " It installs the autocommands and starts highlighting for all buffers.
  28.  
  29. 1 0.000032 if !has("syntax")
  30. finish
  31. endif
  32.  
  33. " If Syntax highlighting appears to be on already, turn it off first, so that
  34. " any leftovers are cleared.
  35. 1 0.000010 if exists("syntax_on") || exists("syntax_manual")
  36. so <sfile>:p:h/nosyntax.vim
  37. endif
  38.  
  39. " Load the Syntax autocommands and set the default methods for highlighting.
  40. 1 0.000094 runtime syntax/synload.vim
  41.  
  42. " Load the FileType autocommands if not done yet.
  43. 1 0.000007 if exists("did_load_filetypes")
  44. let s:did_ft = 1
  45. else
  46. 1 0.000079 filetype on
  47. 1 0.000006 let s:did_ft = 0
  48. 1 0.000001 endif
  49.  
  50. " Set up the connection between FileType and Syntax autocommands.
  51. " This makes the syntax automatically set when the file type is detected.
  52. 1 0.000002 augroup syntaxset
  53. 1 0.000006 au! FileType * exe "set syntax=" . expand("<amatch>")
  54. 1 0.000001 augroup END
  55.  
  56.  
  57. " Execute the syntax autocommands for the each buffer.
  58. " If the filetype wasn't detected yet, do that now.
  59. " Always do the syntaxset autocommands, for buffers where the 'filetype'
  60. " already was set manually (e.g., help buffers).
  61. 1 0.000002 doautoall syntaxset FileType
  62. 1 0.000002 if !s:did_ft
  63. 1 0.000002 doautoall filetypedetect BufRead
  64. 1 0.000002 endif
  65.  
  66. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/syntax/synload.vim
  67. Sourced 1 time
  68. Total time: 0.000940
  69. Self time: 0.000417
  70.  
  71. count total (s) self (s)
  72. " Vim syntax support file
  73. " Maintainer: Bram Moolenaar <Bram@vim.org>
  74. " Last Change: 2012 Sep 25
  75.  
  76. " This file sets up for syntax highlighting.
  77. " It is loaded from "syntax.vim" and "manual.vim".
  78. " 1. Set the default highlight groups.
  79. " 2. Install Syntax autocommands for all the available syntax files.
  80.  
  81. 1 0.000009 if !has("syntax")
  82. finish
  83. endif
  84.  
  85. " let others know that syntax has been switched on
  86. 1 0.000015 let syntax_on = 1
  87.  
  88. " Set the default highlighting colors. Use a color scheme if specified.
  89. 1 0.000004 if exists("colors_name")
  90. exe "colors " . colors_name
  91. else
  92. 1 0.000087 runtime! syntax/syncolor.vim
  93. 1 0.000005 endif
  94.  
  95. " Line continuation is used here, remove 'C' from 'cpoptions'
  96. 1 0.000019 let s:cpo_save = &cpo
  97. 1 0.000016 set cpo&vim
  98.  
  99. " First remove all old syntax autocommands.
  100. 1 0.000005 au! Syntax
  101.  
  102. 1 0.000010 au Syntax * call s:SynSet()
  103.  
  104. 1 0.000010 fun! s:SynSet()
  105. " clear syntax for :set syntax=OFF and any syntax name that doesn't exist
  106. syn clear
  107. if exists("b:current_syntax")
  108. unlet b:current_syntax
  109. endif
  110.  
  111. let s = expand("<amatch>")
  112. if s == "ON"
  113. " :set syntax=ON
  114. if &filetype == ""
  115. echohl ErrorMsg
  116. echo "filetype unknown"
  117. echohl None
  118. endif
  119. let s = &filetype
  120. elseif s == "OFF"
  121. let s = ""
  122. endif
  123.  
  124. if s != ""
  125. " Load the syntax file(s). When there are several, separated by dots,
  126. " load each in sequence.
  127. for name in split(s, '\.')
  128. exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim"
  129. endfor
  130. endif
  131. endfun
  132.  
  133.  
  134. " Handle adding doxygen to other languages (C, C++, C#, IDL, java, php, DataScript)
  135. 1 0.000031 au Syntax c,cpp,cs,idl,java,php,datascript
  136. \ if (exists('b:load_doxygen_syntax') && b:load_doxygen_syntax)
  137. \ || (exists('g:load_doxygen_syntax') && g:load_doxygen_syntax)
  138. \ | runtime! syntax/doxygen.vim
  139. \ | endif
  140.  
  141.  
  142. " Source the user-specified syntax highlighting file
  143. 1 0.000009 if exists("mysyntaxfile") && filereadable(expand(mysyntaxfile))
  144. execute "source " . mysyntaxfile
  145. endif
  146.  
  147. " Restore 'cpoptions'
  148. 1 0.000013 let &cpo = s:cpo_save
  149. 1 0.000006 unlet s:cpo_save
  150.  
  151. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/syntax/syncolor.vim
  152. Sourced 1 time
  153. Total time: 0.000490
  154. Self time: 0.000490
  155.  
  156. count total (s) self (s)
  157. " Vim syntax support file
  158. " Maintainer: Bram Moolenaar <Bram@vim.org>
  159. " Last Change: 2001 Sep 12
  160.  
  161. " This file sets up the default methods for highlighting.
  162. " It is loaded from "synload.vim" and from Vim for ":syntax reset".
  163. " Also used from init_highlight().
  164.  
  165. 1 0.000009 if !exists("syntax_cmd") || syntax_cmd == "on"
  166. " ":syntax on" works like in Vim 5.7: set colors but keep links
  167. 1 0.000017 command -nargs=* SynColor hi <args>
  168. 1 0.000006 command -nargs=* SynLink hi link <args>
  169. 1 0.000002 else
  170. if syntax_cmd == "enable"
  171. " ":syntax enable" keeps any existing colors
  172. command -nargs=* SynColor hi def <args>
  173. command -nargs=* SynLink hi def link <args>
  174. elseif syntax_cmd == "reset"
  175. " ":syntax reset" resets all colors to the default
  176. command -nargs=* SynColor hi <args>
  177. command -nargs=* SynLink hi! link <args>
  178. else
  179. " User defined syncolor file has already set the colors.
  180. finish
  181. endif
  182. endif
  183.  
  184. " Many terminals can only use six different colors (plus black and white).
  185. " Therefore the number of colors used is kept low. It doesn't look nice with
  186. " too many colors anyway.
  187. " Careful with "cterm=bold", it changes the color to bright for some terminals.
  188. " There are two sets of defaults: for a dark and a light background.
  189. 1 0.000007 if &background == "dark"
  190. SynColor Comment term=bold cterm=NONE ctermfg=Cyan ctermbg=NONE gui=NONE guifg=#80a0ff guibg=NONE
  191. SynColor Constant term=underline cterm=NONE ctermfg=Magenta ctermbg=NONE gui=NONE guifg=#ffa0a0 guibg=NONE
  192. SynColor Special term=bold cterm=NONE ctermfg=LightRed ctermbg=NONE gui=NONE guifg=Orange guibg=NONE
  193. SynColor Identifier term=underline cterm=bold ctermfg=Cyan ctermbg=NONE gui=NONE guifg=#40ffff guibg=NONE
  194. SynColor Statement term=bold cterm=NONE ctermfg=Yellow ctermbg=NONE gui=bold guifg=#ffff60 guibg=NONE
  195. SynColor PreProc term=underline cterm=NONE ctermfg=LightBlue ctermbg=NONE gui=NONE guifg=#ff80ff guibg=NONE
  196. SynColor Type term=underline cterm=NONE ctermfg=LightGreen ctermbg=NONE gui=bold guifg=#60ff60 guibg=NONE
  197. SynColor Underlined term=underline cterm=underline ctermfg=LightBlue gui=underline guifg=#80a0ff
  198. SynColor Ignore term=NONE cterm=NONE ctermfg=black ctermbg=NONE gui=NONE guifg=bg guibg=NONE
  199. else
  200. 1 0.000018 SynColor Comment term=bold cterm=NONE ctermfg=DarkBlue ctermbg=NONE gui=NONE guifg=Blue guibg=NONE
  201. 1 0.000021 SynColor Constant term=underline cterm=NONE ctermfg=DarkRed ctermbg=NONE gui=NONE guifg=Magenta guibg=NONE
  202. 1 0.000045 SynColor Special term=bold cterm=NONE ctermfg=DarkMagenta ctermbg=NONE gui=NONE guifg=SlateBlue guibg=NONE
  203. 1 0.000012 SynColor Identifier term=underline cterm=NONE ctermfg=DarkCyan ctermbg=NONE gui=NONE guifg=DarkCyan guibg=NONE
  204. 1 0.000010 SynColor Statement term=bold cterm=NONE ctermfg=Brown ctermbg=NONE gui=bold guifg=Brown guibg=NONE
  205. 1 0.000019 SynColor PreProc term=underline cterm=NONE ctermfg=DarkMagenta ctermbg=NONE gui=NONE guifg=Purple guibg=NONE
  206. 1 0.000019 SynColor Type term=underline cterm=NONE ctermfg=DarkGreen ctermbg=NONE gui=bold guifg=SeaGreen guibg=NONE
  207. 1 0.000018 SynColor Underlined term=underline cterm=underline ctermfg=DarkMagenta gui=underline guifg=SlateBlue
  208. 1 0.000017 SynColor Ignore term=NONE cterm=NONE ctermfg=white ctermbg=NONE gui=NONE guifg=bg guibg=NONE
  209. 1 0.000002 endif
  210. 1 0.000030 SynColor Error term=reverse cterm=NONE ctermfg=White ctermbg=Red gui=NONE guifg=White guibg=Red
  211. 1 0.000023 SynColor Todo term=standout cterm=NONE ctermfg=Black ctermbg=Yellow gui=NONE guifg=Blue guibg=Yellow
  212.  
  213. " Common groups that link to default highlighting.
  214. " You can specify other highlighting easily.
  215. 1 0.000007 SynLink String Constant
  216. 1 0.000005 SynLink Character Constant
  217. 1 0.000005 SynLink Number Constant
  218. 1 0.000007 SynLink Boolean Constant
  219. 1 0.000004 SynLink Float Number
  220. 1 0.000004 SynLink Function Identifier
  221. 1 0.000005 SynLink Conditional Statement
  222. 1 0.000005 SynLink Repeat Statement
  223. 1 0.000005 SynLink Label Statement
  224. 1 0.000005 SynLink Operator Statement
  225. 1 0.000005 SynLink Keyword Statement
  226. 1 0.000004 SynLink Exception Statement
  227. 1 0.000005 SynLink Include PreProc
  228. 1 0.000005 SynLink Define PreProc
  229. 1 0.000005 SynLink Macro PreProc
  230. 1 0.000005 SynLink PreCondit PreProc
  231. 1 0.000005 SynLink StorageClass Type
  232. 1 0.000015 SynLink Structure Type
  233. 1 0.000005 SynLink Typedef Type
  234. 1 0.000005 SynLink Tag Special
  235. 1 0.000006 SynLink SpecialChar Special
  236. 1 0.000005 SynLink Delimiter Special
  237. 1 0.000006 SynLink SpecialComment Special
  238. 1 0.000006 SynLink Debug Special
  239.  
  240. 1 0.000003 delcommand SynColor
  241. 1 0.000004 delcommand SynLink
  242.  
  243. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/filetype.vim
  244. Sourced 2 times
  245. Total time: 0.019585
  246. Self time: 0.019585
  247.  
  248. count total (s) self (s)
  249. " Vim support file to detect file types
  250. "
  251. " Maintainer: Bram Moolenaar <Bram@vim.org>
  252. " Last Change: 2016 Jul 21
  253.  
  254. " Listen very carefully, I will say this only once
  255. 2 0.000013 if exists("did_load_filetypes")
  256. 1 0.000002 finish
  257. endif
  258. 1 0.000005 let did_load_filetypes = 1
  259.  
  260. " Line continuation is used here, remove 'C' from 'cpoptions'
  261. 1 0.000047 let s:cpo_save = &cpo
  262. 1 0.000012 set cpo&vim
  263.  
  264. 1 0.000003 augroup filetypedetect
  265.  
  266. " Ignored extensions
  267. 1 0.000009 if exists("*fnameescape")
  268. 1 0.000086 au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-old,?\+.dpkg-new,?\+.dpkg-bak,?\+.rpmsave,?\+.rpmnew,?\+.pacsave,?\+.pacnew
  269. \ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r"))
  270. 1 0.000013 au BufNewFile,BufRead *~
  271. \ let s:name = expand("<afile>") |
  272. \ let s:short = substitute(s:name, '\~$', '', '') |
  273. \ if s:name != s:short && s:short != "" |
  274. \ exe "doau filetypedetect BufRead " . fnameescape(s:short) |
  275. \ endif |
  276. \ unlet! s:name s:short
  277. 1 0.000010 au BufNewFile,BufRead ?\+.in
  278. \ if expand("<afile>:t") != "configure.in" |
  279. \ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r")) |
  280. \ endif
  281. 1 0.000003 elseif &verbose > 0
  282. echomsg "Warning: some filetypes will not be recognized because this version of Vim does not have fnameescape()"
  283. endif
  284.  
  285. " Pattern used to match file names which should not be inspected.
  286. " Currently finds compressed files.
  287. 1 0.000004 if !exists("g:ft_ignore_pat")
  288. 1 0.000020 let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$'
  289. 1 0.000002 endif
  290.  
  291. " Function used for patterns that end in a star: don't set the filetype if the
  292. " file name matches ft_ignore_pat.
  293. 1 0.000005 func! s:StarSetf(ft)
  294. if expand("<amatch>") !~ g:ft_ignore_pat
  295. exe 'setf ' . a:ft
  296. endif
  297. endfunc
  298.  
  299. " Abaqus or Trasys
  300. 1 0.000006 au BufNewFile,BufRead *.inp call s:Check_inp()
  301.  
  302. 1 0.000002 func! s:Check_inp()
  303. if getline(1) =~ '^\*'
  304. setf abaqus
  305. else
  306. let n = 1
  307. if line("$") > 500
  308. let nmax = 500
  309. else
  310. let nmax = line("$")
  311. endif
  312. while n <= nmax
  313. if getline(n) =~? "^header surface data"
  314. setf trasys
  315. break
  316. endif
  317. let n = n + 1
  318. endwhile
  319. endif
  320. endfunc
  321.  
  322. " A-A-P recipe
  323. 1 0.000008 au BufNewFile,BufRead *.aap setf aap
  324.  
  325. " A2ps printing utility
  326. 1 0.000033 au BufNewFile,BufRead */etc/a2ps.cfg,*/etc/a2ps/*.cfg,a2psrc,.a2psrc setf a2ps
  327.  
  328. " ABAB/4
  329. 1 0.000046 au BufNewFile,BufRead *.abap setf abap
  330.  
  331. " ABC music notation
  332. 1 0.000005 au BufNewFile,BufRead *.abc setf abc
  333.  
  334. " ABEL
  335. 1 0.000004 au BufNewFile,BufRead *.abl setf abel
  336.  
  337. " AceDB
  338. 1 0.000005 au BufNewFile,BufRead *.wrm setf acedb
  339.  
  340. " Ada (83, 9X, 95)
  341. 1 0.000017 au BufNewFile,BufRead *.adb,*.ads,*.ada setf ada
  342. 1 0.000006 au BufNewFile,BufRead *.gpr setf ada
  343.  
  344. " AHDL
  345. 1 0.000008 au BufNewFile,BufRead *.tdf setf ahdl
  346.  
  347. " AMPL
  348. 1 0.000010 au BufNewFile,BufRead *.run setf ampl
  349.  
  350. " Ant
  351. 1 0.000009 au BufNewFile,BufRead build.xml setf ant
  352.  
  353. " Arduino
  354. 1 0.000008 au BufNewFile,BufRead *.ino,*.pde setf arduino
  355.  
  356. " Apache style config file
  357. 1 0.000006 au BufNewFile,BufRead proftpd.conf* call s:StarSetf('apachestyle')
  358.  
  359. " Apache config file
  360. 1 0.000012 au BufNewFile,BufRead .htaccess,*/etc/httpd/*.conf setf apache
  361.  
  362. " XA65 MOS6510 cross assembler
  363. 1 0.000006 au BufNewFile,BufRead *.a65 setf a65
  364.  
  365. " Applescript
  366. 1 0.000009 au BufNewFile,BufRead *.scpt setf applescript
  367.  
  368. " Applix ELF
  369. 1 0.000009 au BufNewFile,BufRead *.am
  370. \ if expand("<afile>") !~? 'Makefile.am\>' | setf elf | endif
  371.  
  372. " ALSA configuration
  373. 1 0.000023 au BufNewFile,BufRead .asoundrc,*/usr/share/alsa/alsa.conf,*/etc/asound.conf setf alsaconf
  374.  
  375. " Arc Macro Language
  376. 1 0.000010 au BufNewFile,BufRead *.aml setf aml
  377.  
  378. " APT config file
  379. 1 0.000014 au BufNewFile,BufRead apt.conf setf aptconf
  380. 1 0.000030 au BufNewFile,BufRead */.aptitude/config setf aptconf
  381. 1 0.000023 au BufNewFile,BufRead */etc/apt/apt.conf.d/{[-_[:alnum:]]\+,[-_.[:alnum:]]\+.conf} setf aptconf
  382.  
  383. " Arch Inventory file
  384. 1 0.000117 au BufNewFile,BufRead .arch-inventory,=tagging-method setf arch
  385.  
  386. " ART*Enterprise (formerly ART-IM)
  387. 1 0.000021 au BufNewFile,BufRead *.art setf art
  388.  
  389. " AsciiDoc
  390. 1 0.000166 au BufNewFile,BufRead *.asciidoc,*.adoc setf asciidoc
  391.  
  392. " ASN.1
  393. 1 0.000012 au BufNewFile,BufRead *.asn,*.asn1 setf asn
  394.  
  395. " Active Server Pages (with Visual Basic Script)
  396. 1 0.000007 au BufNewFile,BufRead *.asa
  397. \ if exists("g:filetype_asa") |
  398. \ exe "setf " . g:filetype_asa |
  399. \ else |
  400. \ setf aspvbs |
  401. \ endif
  402.  
  403. " Active Server Pages (with Perl or Visual Basic Script)
  404. 1 0.000014 au BufNewFile,BufRead *.asp
  405. \ if exists("g:filetype_asp") |
  406. \ exe "setf " . g:filetype_asp |
  407. \ elseif getline(1) . getline(2) . getline(3) =~? "perlscript" |
  408. \ setf aspperl |
  409. \ else |
  410. \ setf aspvbs |
  411. \ endif
  412.  
  413. " Grub (must be before catch *.lst)
  414. 1 0.000020 au BufNewFile,BufRead */boot/grub/menu.lst,*/boot/grub/grub.conf,*/etc/grub.conf setf grub
  415.  
  416. " Assembly (all kinds)
  417. " *.lst is not pure assembly, it has two extra columns (address, byte codes)
  418. 1 0.000026 au BufNewFile,BufRead *.asm,*.[sS],*.[aA],*.mac,*.lst call s:FTasm()
  419.  
  420. " This function checks for the kind of assembly that is wanted by the user, or
  421. " can be detected from the first five lines of the file.
  422. 1 0.000007 func! s:FTasm()
  423. " make sure b:asmsyntax exists
  424. if !exists("b:asmsyntax")
  425. let b:asmsyntax = ""
  426. endif
  427.  
  428. if b:asmsyntax == ""
  429. call s:FTasmsyntax()
  430. endif
  431.  
  432. " if b:asmsyntax still isn't set, default to asmsyntax or GNU
  433. if b:asmsyntax == ""
  434. if exists("g:asmsyntax")
  435. let b:asmsyntax = g:asmsyntax
  436. else
  437. let b:asmsyntax = "asm"
  438. endif
  439. endif
  440.  
  441. exe "setf " . fnameescape(b:asmsyntax)
  442. endfunc
  443.  
  444. 1 0.000002 func! s:FTasmsyntax()
  445. " see if file contains any asmsyntax=foo overrides. If so, change
  446. " b:asmsyntax appropriately
  447. let head = " ".getline(1)." ".getline(2)." ".getline(3)." ".getline(4).
  448. \" ".getline(5)." "
  449. let match = matchstr(head, '\sasmsyntax=\zs[a-zA-Z0-9]\+\ze\s')
  450. if match != ''
  451. let b:asmsyntax = match
  452. elseif ((head =~? '\.title') || (head =~? '\.ident') || (head =~? '\.macro') || (head =~? '\.subtitle') || (head =~? '\.library'))
  453. let b:asmsyntax = "vmasm"
  454. endif
  455. endfunc
  456.  
  457. " Macro (VAX)
  458. 1 0.000006 au BufNewFile,BufRead *.mar setf vmasm
  459.  
  460. " Atlas
  461. 1 0.000024 au BufNewFile,BufRead *.atl,*.as setf atlas
  462.  
  463. " Autoit v3
  464. 1 0.000010 au BufNewFile,BufRead *.au3 setf autoit
  465.  
  466. " Autohotkey
  467. 1 0.000007 au BufNewFile,BufRead *.ahk setf autohotkey
  468.  
  469. " Automake
  470. 1 0.000049 au BufNewFile,BufRead [mM]akefile.am,GNUmakefile.am setf automake
  471.  
  472. " Autotest .at files are actually m4
  473. 1 0.000006 au BufNewFile,BufRead *.at setf m4
  474.  
  475. " Avenue
  476. 1 0.000004 au BufNewFile,BufRead *.ave setf ave
  477.  
  478. " Awk
  479. 1 0.000004 au BufNewFile,BufRead *.awk setf awk
  480.  
  481. " B
  482. 1 0.000044 au BufNewFile,BufRead *.mch,*.ref,*.imp setf b
  483.  
  484. " BASIC or Visual Basic
  485. 1 0.000008 au BufNewFile,BufRead *.bas call s:FTVB("basic")
  486.  
  487. " Check if one of the first five lines contains "VB_Name". In that case it is
  488. " probably a Visual Basic file. Otherwise it's assumed to be "alt" filetype.
  489. 1 0.000005 func! s:FTVB(alt)
  490. if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
  491. setf vb
  492. else
  493. exe "setf " . a:alt
  494. endif
  495. endfunc
  496.  
  497. " Visual Basic Script (close to Visual Basic) or Visual Basic .NET
  498. 1 0.000027 au BufNewFile,BufRead *.vb,*.vbs,*.dsm,*.ctl setf vb
  499.  
  500. " IBasic file (similar to QBasic)
  501. 1 0.000008 au BufNewFile,BufRead *.iba,*.ibi setf ibasic
  502.  
  503. " FreeBasic file (similar to QBasic)
  504. 1 0.000010 au BufNewFile,BufRead *.fb,*.bi setf freebasic
  505.  
  506. " Batch file for MSDOS.
  507. 1 0.000009 au BufNewFile,BufRead *.bat,*.sys setf dosbatch
  508. " *.cmd is close to a Batch file, but on OS/2 Rexx files also use *.cmd.
  509. 1 0.000006 au BufNewFile,BufRead *.cmd
  510. \ if getline(1) =~ '^/\*' | setf rexx | else | setf dosbatch | endif
  511.  
  512. " Batch file for 4DOS
  513. 1 0.000004 au BufNewFile,BufRead *.btm call s:FTbtm()
  514. 1 0.000003 func! s:FTbtm()
  515. if exists("g:dosbatch_syntax_for_btm") && g:dosbatch_syntax_for_btm
  516. setf dosbatch
  517. else
  518. setf btm
  519. endif
  520. endfunc
  521.  
  522. " BC calculator
  523. 1 0.000004 au BufNewFile,BufRead *.bc setf bc
  524.  
  525. " BDF font
  526. 1 0.000006 au BufNewFile,BufRead *.bdf setf bdf
  527.  
  528. " BibTeX bibliography database file
  529. 1 0.000004 au BufNewFile,BufRead *.bib setf bib
  530.  
  531. " BibTeX Bibliography Style
  532. 1 0.000004 au BufNewFile,BufRead *.bst setf bst
  533.  
  534. " BIND configuration
  535. 1 0.000010 au BufNewFile,BufRead named.conf,rndc.conf setf named
  536.  
  537. " BIND zone
  538. 1 0.000007 au BufNewFile,BufRead named.root setf bindzone
  539. 1 0.000004 au BufNewFile,BufRead *.db call s:BindzoneCheck('')
  540.  
  541. 1 0.000002 func! s:BindzoneCheck(default)
  542. if getline(1).getline(2).getline(3).getline(4) =~ '^; <<>> DiG [0-9.]\+ <<>>\|BIND.*named\|$ORIGIN\|$TTL\|IN\s\+SOA'
  543. setf bindzone
  544. elseif a:default != ''
  545. exe 'setf ' . a:default
  546. endif
  547. endfunc
  548.  
  549. " Blank
  550. 1 0.000005 au BufNewFile,BufRead *.bl setf blank
  551.  
  552. " Blkid cache file
  553. 1 0.000014 au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
  554.  
  555. " Bazel (http://bazel.io)
  556. 1 0.000019 autocmd BufRead,BufNewFile *.bzl,BUILD,WORKSPACE setfiletype bzl
  557.  
  558. " C or lpc
  559. 1 0.000007 au BufNewFile,BufRead *.c call s:FTlpc()
  560.  
  561. 1 0.000002 func! s:FTlpc()
  562. if exists("g:lpc_syntax_for_c")
  563. let lnum = 1
  564. while lnum <= 12
  565. if getline(lnum) =~# '^\(//\|inherit\|private\|protected\|nosave\|string\|object\|mapping\|mixed\)'
  566. setf lpc
  567. return
  568. endif
  569. let lnum = lnum + 1
  570. endwhile
  571. endif
  572. setf c
  573. endfunc
  574.  
  575. " Calendar
  576. 1 0.000005 au BufNewFile,BufRead calendar setf calendar
  577.  
  578. " C#
  579. 1 0.000012 au BufNewFile,BufRead *.cs setf cs
  580.  
  581. " CSDL
  582. 1 0.000008 au BufNewFile,BufRead *.csdl setf csdl
  583.  
  584. " Cabal
  585. 1 0.000008 au BufNewFile,BufRead *.cabal setf cabal
  586.  
  587. " Cdrdao TOC
  588. 1 0.000011 au BufNewFile,BufRead *.toc setf cdrtoc
  589.  
  590. " Cdrdao config
  591. 1 0.000038 au BufNewFile,BufRead */etc/cdrdao.conf,*/etc/defaults/cdrdao,*/etc/default/cdrdao,.cdrdao setf cdrdaoconf
  592.  
  593. " Cfengine
  594. 1 0.000012 au BufNewFile,BufRead cfengine.conf setf cfengine
  595.  
  596. " ChaiScript
  597. 1 0.000006 au BufRead,BufNewFile *.chai setf chaiscript
  598.  
  599. " Comshare Dimension Definition Language
  600. 1 0.000005 au BufNewFile,BufRead *.cdl setf cdl
  601.  
  602. " Conary Recipe
  603. 1 0.000005 au BufNewFile,BufRead *.recipe setf conaryrecipe
  604.  
  605. " Controllable Regex Mutilator
  606. 1 0.000004 au BufNewFile,BufRead *.crm setf crm
  607.  
  608. " Cyn++
  609. 1 0.000008 au BufNewFile,BufRead *.cyn setf cynpp
  610.  
  611. " Cynlib
  612. " .cc and .cpp files can be C++ or Cynlib.
  613. 1 0.000006 au BufNewFile,BufRead *.cc
  614. \ if exists("cynlib_syntax_for_cc")|setf cynlib|else|setf cpp|endif
  615. 1 0.000007 au BufNewFile,BufRead *.cpp
  616. \ if exists("cynlib_syntax_for_cpp")|setf cynlib|else|setf cpp|endif
  617.  
  618. " C++
  619. 1 0.000049 au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.ipp,*.moc,*.tcc,*.inl setf cpp
  620. 1 0.000006 if has("fname_case")
  621. 1 0.000016 au BufNewFile,BufRead *.C,*.H setf cpp
  622. 1 0.000002 endif
  623.  
  624. " .h files can be C, Ch C++, ObjC or ObjC++.
  625. " Set c_syntax_for_h if you want C, ch_syntax_for_h if you want Ch. ObjC is
  626. " detected automatically.
  627. 1 0.000007 au BufNewFile,BufRead *.h call s:FTheader()
  628.  
  629. 1 0.000005 func! s:FTheader()
  630. if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1
  631. if exists("g:c_syntax_for_h")
  632. setf objc
  633. else
  634. setf objcpp
  635. endif
  636. elseif exists("g:c_syntax_for_h")
  637. setf c
  638. elseif exists("g:ch_syntax_for_h")
  639. setf ch
  640. else
  641. setf cpp
  642. endif
  643. endfunc
  644.  
  645. " Ch (CHscript)
  646. 1 0.000015 au BufNewFile,BufRead *.chf setf ch
  647.  
  648. " TLH files are C++ headers generated by Visual C++'s #import from typelibs
  649. 1 0.000005 au BufNewFile,BufRead *.tlh setf cpp
  650.  
  651. " Cascading Style Sheets
  652. 1 0.000005 au BufNewFile,BufRead *.css setf css
  653.  
  654. " Century Term Command Scripts (*.cmd too)
  655. 1 0.000007 au BufNewFile,BufRead *.con setf cterm
  656.  
  657. " Changelog
  658. 1 0.000023 au BufNewFile,BufRead changelog.Debian,changelog.dch,NEWS.Debian,NEWS.dch
  659. \ setf debchangelog
  660.  
  661. 1 0.000011 au BufNewFile,BufRead [cC]hange[lL]og
  662. \ if getline(1) =~ '; urgency='
  663. \| setf debchangelog
  664. \| else
  665. \| setf changelog
  666. \| endif
  667.  
  668. 1 0.000012 au BufNewFile,BufRead NEWS
  669. \ if getline(1) =~ '; urgency='
  670. \| setf debchangelog
  671. \| endif
  672.  
  673. " CHILL
  674. 1 0.000007 au BufNewFile,BufRead *..ch setf chill
  675.  
  676. " Changes for WEB and CWEB or CHILL
  677. 1 0.000005 au BufNewFile,BufRead *.ch call s:FTchange()
  678.  
  679. " This function checks if one of the first ten lines start with a '@'. In
  680. " that case it is probably a change file.
  681. " If the first line starts with # or ! it's probably a ch file.
  682. " If a line has "main", "include", "//" ir "/*" it's probably ch.
  683. " Otherwise CHILL is assumed.
  684. 1 0.000003 func! s:FTchange()
  685. let lnum = 1
  686. while lnum <= 10
  687. if getline(lnum)[0] == '@'
  688. setf change
  689. return
  690. endif
  691. if lnum == 1 && (getline(1)[0] == '#' || getline(1)[0] == '!')
  692. setf ch
  693. return
  694. endif
  695. if getline(lnum) =~ "MODULE"
  696. setf chill
  697. return
  698. endif
  699. if getline(lnum) =~ 'main\s*(\|#\s*include\|//'
  700. setf ch
  701. return
  702. endif
  703. let lnum = lnum + 1
  704. endwhile
  705. setf chill
  706. endfunc
  707.  
  708. " ChordPro
  709. 1 0.000029 au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro setf chordpro
  710.  
  711. " Clean
  712. 1 0.000012 au BufNewFile,BufRead *.dcl,*.icl setf clean
  713.  
  714. " Clever
  715. 1 0.000005 au BufNewFile,BufRead *.eni setf cl
  716.  
  717. " Clever or dtd
  718. 1 0.000005 au BufNewFile,BufRead *.ent call s:FTent()
  719.  
  720. 1 0.000002 func! s:FTent()
  721. " This function checks for valid cl syntax in the first five lines.
  722. " Look for either an opening comment, '#', or a block start, '{".
  723. " If not found, assume SGML.
  724. let lnum = 1
  725. while lnum < 6
  726. let line = getline(lnum)
  727. if line =~ '^\s*[#{]'
  728. setf cl
  729. return
  730. elseif line !~ '^\s*$'
  731. " Not a blank line, not a comment, and not a block start,
  732. " so doesn't look like valid cl code.
  733. break
  734. endif
  735. let lnum = lnum + 1
  736. endw
  737. setf dtd
  738. endfunc
  739.  
  740. " Clipper (or FoxPro; could also be eviews)
  741. 1 0.000009 au BufNewFile,BufRead *.prg
  742. \ if exists("g:filetype_prg") |
  743. \ exe "setf " . g:filetype_prg |
  744. \ else |
  745. \ setf clipper |
  746. \ endif
  747.  
  748. " Clojure
  749. 1 0.000031 au BufNewFile,BufRead *.clj,*.cljs,*.cljx,*.cljc setf clojure
  750.  
  751. " Cmake
  752. 1 0.000027 au BufNewFile,BufRead CMakeLists.txt,*.cmake,*.cmake.in setf cmake
  753.  
  754. " Cmusrc
  755. 1 0.000019 au BufNewFile,BufRead */.cmus/{autosave,rc,command-history,*.theme} setf cmusrc
  756. 1 0.000008 au BufNewFile,BufRead */cmus/{rc,*.theme} setf cmusrc
  757.  
  758. " Cobol
  759. 1 0.000016 au BufNewFile,BufRead *.cbl,*.cob,*.lib setf cobol
  760. " cobol or zope form controller python script? (heuristic)
  761. 1 0.000019 au BufNewFile,BufRead *.cpy
  762. \ if getline(1) =~ '^##' |
  763. \ setf python |
  764. \ else |
  765. \ setf cobol |
  766. \ endif
  767.  
  768. " Coco/R
  769. 1 0.000009 au BufNewFile,BufRead *.atg setf coco
  770.  
  771. " Cold Fusion
  772. 1 0.000060 au BufNewFile,BufRead *.cfm,*.cfi,*.cfc setf cf
  773.  
  774. " Configure scripts
  775. 1 0.000016 au BufNewFile,BufRead configure.in,configure.ac setf config
  776.  
  777. " CUDA Cumpute Unified Device Architecture
  778. 1 0.000007 au BufNewFile,BufRead *.cu setf cuda
  779.  
  780. " Dockerfile
  781. 1 0.000013 au BufNewFile,BufRead Dockerfile,*.Dockerfile setf dockerfile
  782.  
  783. " WildPackets EtherPeek Decoder
  784. 1 0.000007 au BufNewFile,BufRead *.dcd setf dcd
  785.  
  786. " Enlightenment configuration files
  787. 1 0.000008 au BufNewFile,BufRead *enlightenment/*.cfg setf c
  788.  
  789. " Eterm
  790. 1 0.000006 au BufNewFile,BufRead *Eterm/*.cfg setf eterm
  791.  
  792. " Euphoria 3 or 4
  793. 1 0.000038 au BufNewFile,BufRead *.eu,*.ew,*.ex,*.exu,*.exw call s:EuphoriaCheck()
  794. 1 0.000006 if has("fname_case")
  795. 1 0.000033 au BufNewFile,BufRead *.EU,*.EW,*.EX,*.EXU,*.EXW call s:EuphoriaCheck()
  796. 1 0.000002 endif
  797.  
  798. 1 0.000006 func! s:EuphoriaCheck()
  799. if exists('g:filetype_euphoria')
  800. exe 'setf ' . g:filetype_euphoria
  801. else
  802. setf euphoria3
  803. endif
  804. endfunc
  805.  
  806. " Lynx config files
  807. 1 0.000010 au BufNewFile,BufRead lynx.cfg setf lynx
  808.  
  809. " Quake
  810. 1 0.000019 au BufNewFile,BufRead *baseq[2-3]/*.cfg,*id1/*.cfg setf quake
  811. 1 0.000013 au BufNewFile,BufRead *quake[1-3]/*.cfg setf quake
  812.  
  813. " Quake C
  814. 1 0.000011 au BufNewFile,BufRead *.qc setf c
  815.  
  816. " Configure files
  817. 1 0.000006 au BufNewFile,BufRead *.cfg setf cfg
  818.  
  819. " Cucumber
  820. 1 0.000006 au BufNewFile,BufRead *.feature setf cucumber
  821.  
  822. " Communicating Sequential Processes
  823. 1 0.000014 au BufNewFile,BufRead *.csp,*.fdr setf csp
  824.  
  825. " CUPL logic description and simulation
  826. 1 0.000006 au BufNewFile,BufRead *.pld setf cupl
  827. 1 0.000007 au BufNewFile,BufRead *.si setf cuplsim
  828.  
  829. " Debian Control
  830. 1 0.000016 au BufNewFile,BufRead */debian/control setf debcontrol
  831. 1 0.000013 au BufNewFile,BufRead control
  832. \ if getline(1) =~ '^Source:'
  833. \| setf debcontrol
  834. \| endif
  835.  
  836. " Debian Sources.list
  837. 1 0.000016 au BufNewFile,BufRead */etc/apt/sources.list setf debsources
  838. 1 0.000025 au BufNewFile,BufRead */etc/apt/sources.list.d/*.list setf debsources
  839.  
  840. " Deny hosts
  841. 1 0.000012 au BufNewFile,BufRead denyhosts.conf setf denyhosts
  842.  
  843. " dnsmasq(8) configuration files
  844. 1 0.000011 au BufNewFile,BufRead */etc/dnsmasq.conf setf dnsmasq
  845.  
  846. " ROCKLinux package description
  847. 1 0.000009 au BufNewFile,BufRead *.desc setf desc
  848.  
  849. " the D language or dtrace
  850. 1 0.000010 au BufNewFile,BufRead *.d call s:DtraceCheck()
  851.  
  852. 1 0.000006 func! s:DtraceCheck()
  853. let lines = getline(1, min([line("$"), 100]))
  854. if match(lines, '^module\>\|^import\>') > -1
  855. " D files often start with a module and/or import statement.
  856. setf d
  857. elseif match(lines, '^#!\S\+dtrace\|#pragma\s\+D\s\+option\|:\S\{-}:\S\{-}:') > -1
  858. setf dtrace
  859. else
  860. setf d
  861. endif
  862. endfunc
  863.  
  864. " Desktop files
  865. 1 0.000020 au BufNewFile,BufRead *.desktop,.directory setf desktop
  866.  
  867. " Dict config
  868. 1 0.000019 au BufNewFile,BufRead dict.conf,.dictrc setf dictconf
  869.  
  870. " Dictd config
  871. 1 0.000007 au BufNewFile,BufRead dictd.conf setf dictdconf
  872.  
  873. " Diff files
  874. 1 0.000020 au BufNewFile,BufRead *.diff,*.rej,*.patch setf diff
  875.  
  876. " Dircolors
  877. 1 0.000253 au BufNewFile,BufRead .dir_colors,.dircolors,*/etc/DIR_COLORS setf dircolors
  878.  
  879. " Diva (with Skill) or InstallShield
  880. 1 0.000017 au BufNewFile,BufRead *.rul
  881. \ if getline(1).getline(2).getline(3).getline(4).getline(5).getline(6) =~? 'InstallShield' |
  882. \ setf ishd |
  883. \ else |
  884. \ setf diva |
  885. \ endif
  886.  
  887. " DCL (Digital Command Language - vms) or DNS zone file
  888. 1 0.000009 au BufNewFile,BufRead *.com call s:BindzoneCheck('dcl')
  889.  
  890. " DOT
  891. 1 0.000006 au BufNewFile,BufRead *.dot setf dot
  892.  
  893. " Dylan - lid files
  894. 1 0.000006 au BufNewFile,BufRead *.lid setf dylanlid
  895.  
  896. " Dylan - intr files (melange)
  897. 1 0.000015 au BufNewFile,BufRead *.intr setf dylanintr
  898.  
  899. " Dylan
  900. 1 0.000011 au BufNewFile,BufRead *.dylan setf dylan
  901.  
  902. " Microsoft Module Definition
  903. 1 0.000010 au BufNewFile,BufRead *.def setf def
  904.  
  905. " Dracula
  906. 1 0.000018 au BufNewFile,BufRead *.drac,*.drc,*lvs,*lpe setf dracula
  907.  
  908. " Datascript
  909. 1 0.000006 au BufNewFile,BufRead *.ds setf datascript
  910.  
  911. " dsl
  912. 1 0.000009 au BufNewFile,BufRead *.dsl setf dsl
  913.  
  914. " DTD (Document Type Definition for XML)
  915. 1 0.000010 au BufNewFile,BufRead *.dtd setf dtd
  916.  
  917. " DTS/DSTI (device tree files)
  918. 1 0.000016 au BufNewFile,BufRead *.dts,*.dtsi setf dts
  919.  
  920. " EDIF (*.edf,*.edif,*.edn,*.edo)
  921. 1 0.000014 au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif
  922.  
  923. " Embedix Component Description
  924. 1 0.000010 au BufNewFile,BufRead *.ecd setf ecd
  925.  
  926. " Eiffel or Specman or Euphoria
  927. 1 0.000016 au BufNewFile,BufRead *.e,*.E call s:FTe()
  928.  
  929. " Elinks configuration
  930. 1 0.000014 au BufNewFile,BufRead */etc/elinks.conf,*/.elinks/elinks.conf setf elinks
  931.  
  932. 1 0.000005 func! s:FTe()
  933. if exists('g:filetype_euphoria')
  934. exe 'setf ' . g:filetype_euphoria
  935. else
  936. let n = 1
  937. while n < 100 && n < line("$")
  938. if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$"
  939. setf specman
  940. return
  941. endif
  942. let n = n + 1
  943. endwhile
  944. setf eiffel
  945. endif
  946. endfunc
  947.  
  948. " ERicsson LANGuage; Yaws is erlang too
  949. 1 0.000019 au BufNewFile,BufRead *.erl,*.hrl,*.yaws setf erlang
  950.  
  951. " Elm Filter Rules file
  952. 1 0.000009 au BufNewFile,BufRead filter-rules setf elmfilt
  953.  
  954. " ESMTP rc file
  955. 1 0.000010 au BufNewFile,BufRead *esmtprc setf esmtprc
  956.  
  957. " ESQL-C
  958. 1 0.000015 au BufNewFile,BufRead *.ec,*.EC setf esqlc
  959.  
  960. " Esterel
  961. 1 0.000011 au BufNewFile,BufRead *.strl setf esterel
  962.  
  963. " Essbase script
  964. 1 0.000013 au BufNewFile,BufRead *.csc setf csc
  965.  
  966. " Exim
  967. 1 0.000008 au BufNewFile,BufRead exim.conf setf exim
  968.  
  969. " Expect
  970. 1 0.000008 au BufNewFile,BufRead *.exp setf expect
  971.  
  972. " Exports
  973. 1 0.000006 au BufNewFile,BufRead exports setf exports
  974.  
  975. " Falcon
  976. 1 0.000006 au BufNewFile,BufRead *.fal setf falcon
  977.  
  978. " Fantom
  979. 1 0.000011 au BufNewFile,BufRead *.fan,*.fwt setf fan
  980.  
  981. " Factor
  982. 1 0.000006 au BufNewFile,BufRead *.factor setf factor
  983.  
  984. " Fetchmail RC file
  985. 1 0.000011 au BufNewFile,BufRead .fetchmailrc setf fetchmail
  986.  
  987. " FlexWiki - disabled, because it has side effects when a .wiki file
  988. " is not actually FlexWiki
  989. "au BufNewFile,BufRead *.wiki setf flexwiki
  990.  
  991. " Focus Executable
  992. 1 0.000029 au BufNewFile,BufRead *.fex,*.focexec setf focexec
  993.  
  994. " Focus Master file (but not for auto.master)
  995. 1 0.000008 au BufNewFile,BufRead auto.master setf conf
  996. 1 0.000012 au BufNewFile,BufRead *.mas,*.master setf master
  997.  
  998. " Forth
  999. 1 0.000010 au BufNewFile,BufRead *.fs,*.ft setf forth
  1000.  
  1001. " Reva Forth
  1002. 1 0.000007 au BufNewFile,BufRead *.frt setf reva
  1003.  
  1004. " Fortran
  1005. 1 0.000007 if has("fname_case")
  1006. 1 0.000067 au BufNewFile,BufRead *.F,*.FOR,*.FPP,*.FTN,*.F77,*.F90,*.F95,*.F03,*.F08 setf fortran
  1007. 1 0.000002 endif
  1008. 1 0.000098 au BufNewFile,BufRead *.f,*.for,*.fortran,*.fpp,*.ftn,*.f77,*.f90,*.f95,*.f03,*.f08 setf fortran
  1009.  
  1010. " Framescript
  1011. 1 0.000009 au BufNewFile,BufRead *.fsl setf framescript
  1012.  
  1013. " FStab
  1014. 1 0.000017 au BufNewFile,BufRead fstab,mtab setf fstab
  1015.  
  1016. " GDB command files
  1017. 1 0.000019 au BufNewFile,BufRead .gdbinit setf gdb
  1018.  
  1019. " GDMO
  1020. 1 0.000012 au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
  1021.  
  1022. " Gedcom
  1023. 1 0.000021 au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom
  1024.  
  1025. " Git
  1026. 1 0.000013 au BufNewFile,BufRead COMMIT_EDITMSG setf gitcommit
  1027. 1 0.000011 au BufNewFile,BufRead MERGE_MSG setf gitcommit
  1028. 1 0.000026 au BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules setf gitconfig
  1029. 1 0.000021 au BufNewFile,BufRead *.git/modules/*/config setf gitconfig
  1030. 1 0.000016 au BufNewFile,BufRead */.config/git/config setf gitconfig
  1031. 1 0.000015 if !empty($XDG_CONFIG_HOME)
  1032. au BufNewFile,BufRead $XDG_CONFIG_HOME/git/config setf gitconfig
  1033. endif
  1034. 1 0.000017 au BufNewFile,BufRead git-rebase-todo setf gitrebase
  1035. 1 0.000020 au BufNewFile,BufRead .msg.[0-9]*
  1036. \ if getline(1) =~ '^From.*# This line is ignored.$' |
  1037. \ setf gitsendemail |
  1038. \ endif
  1039. 1 0.000011 au BufNewFile,BufRead *.git/*
  1040. \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
  1041. \ setf git |
  1042. \ endif
  1043.  
  1044. " Gkrellmrc
  1045. 1 0.000019 au BufNewFile,BufRead gkrellmrc,gkrellmrc_? setf gkrellmrc
  1046.  
  1047. " GP scripts (2.0 and onward)
  1048. 1 0.000026 au BufNewFile,BufRead *.gp,.gprc setf gp
  1049.  
  1050. " GPG
  1051. 1 0.000012 au BufNewFile,BufRead */.gnupg/options setf gpg
  1052. 1 0.000014 au BufNewFile,BufRead */.gnupg/gpg.conf setf gpg
  1053. 1 0.000020 au BufNewFile,BufRead */usr/*/gnupg/options.skel setf gpg
  1054.  
  1055. " gnash(1) configuration files
  1056. 1 0.000046 au BufNewFile,BufRead gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc setf gnash
  1057.  
  1058. " Gitolite
  1059. 1 0.000015 au BufNewFile,BufRead gitolite.conf setf gitolite
  1060. 1 0.000015 au BufNewFile,BufRead */gitolite-admin/conf/* call s:StarSetf('gitolite')
  1061. 1 0.000028 au BufNewFile,BufRead {,.}gitolite.rc,example.gitolite.rc setf perl
  1062.  
  1063. " Gnuplot scripts
  1064. 1 0.000018 au BufNewFile,BufRead *.gpi setf gnuplot
  1065.  
  1066. " Go (Google)
  1067. 1 0.000011 au BufNewFile,BufRead *.go setf go
  1068.  
  1069. " GrADS scripts
  1070. 1 0.000010 au BufNewFile,BufRead *.gs setf grads
  1071.  
  1072. " Gretl
  1073. 1 0.000010 au BufNewFile,BufRead *.gretl setf gretl
  1074.  
  1075. " Groovy
  1076. 1 0.000109 au BufNewFile,BufRead *.gradle,*.groovy setf groovy
  1077.  
  1078. " GNU Server Pages
  1079. 1 0.000019 au BufNewFile,BufRead *.gsp setf gsp
  1080.  
  1081. " Group file
  1082. 1 0.000199 au BufNewFile,BufRead */etc/group,*/etc/group-,*/etc/group.edit,*/etc/gshadow,*/etc/gshadow-,*/etc/gshadow.edit,*/var/backups/group.bak,*/var/backups/gshadow.bak setf group
  1083.  
  1084. " GTK RC
  1085. 1 0.000026 au BufNewFile,BufRead .gtkrc,gtkrc setf gtkrc
  1086.  
  1087. " Haml
  1088. 1 0.000011 au BufNewFile,BufRead *.haml setf haml
  1089.  
  1090. " Hamster Classic | Playground files
  1091. 1 0.000025 au BufNewFile,BufRead *.hsc,*.hsm setf hamster
  1092.  
  1093. " Haskell
  1094. 1 0.000025 au BufNewFile,BufRead *.hs,*.hs-boot setf haskell
  1095. 1 0.000011 au BufNewFile,BufRead *.lhs setf lhaskell
  1096. 1 0.000011 au BufNewFile,BufRead *.chs setf chaskell
  1097.  
  1098. " Haste
  1099. 1 0.000010 au BufNewFile,BufRead *.ht setf haste
  1100. 1 0.000013 au BufNewFile,BufRead *.htpp setf hastepreproc
  1101.  
  1102. " Hercules
  1103. 1 0.000056 au BufNewFile,BufRead *.vc,*.ev,*.rs,*.sum,*.errsum setf hercules
  1104.  
  1105. " HEX (Intel)
  1106. 1 0.000024 au BufNewFile,BufRead *.hex,*.h32 setf hex
  1107.  
  1108. " Tilde (must be before HTML)
  1109. 1 0.000011 au BufNewFile,BufRead *.t.html setf tilde
  1110.  
  1111. " HTML (.shtml and .stm for server side)
  1112. 1 0.000051 au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call s:FThtml()
  1113.  
  1114. " Distinguish between HTML, XHTML and Django
  1115. 1 0.000008 func! s:FThtml()
  1116. let n = 1
  1117. while n < 10 && n < line("$")
  1118. if getline(n) =~ '\<DTD\s\+XHTML\s'
  1119. setf xhtml
  1120. return
  1121. endif
  1122. if getline(n) =~ '{%\s*\(extends\|block\|load\)\>\|{#\s\+'
  1123. setf htmldjango
  1124. return
  1125. endif
  1126. let n = n + 1
  1127. endwhile
  1128. setf html
  1129. endfunc
  1130.  
  1131. " HTML with Ruby - eRuby
  1132. 1 0.000024 au BufNewFile,BufRead *.erb,*.rhtml setf eruby
  1133.  
  1134. " HTML with M4
  1135. 1 0.000013 au BufNewFile,BufRead *.html.m4 setf htmlm4
  1136.  
  1137. " HTML Cheetah template
  1138. 1 0.000010 au BufNewFile,BufRead *.tmpl setf htmlcheetah
  1139.  
  1140. " Host config
  1141. 1 0.000012 au BufNewFile,BufRead */etc/host.conf setf hostconf
  1142.  
  1143. " Hosts access
  1144. 1 0.000024 au BufNewFile,BufRead */etc/hosts.allow,*/etc/hosts.deny setf hostsaccess
  1145.  
  1146. " Hyper Builder
  1147. 1 0.000011 au BufNewFile,BufRead *.hb setf hb
  1148.  
  1149. " Httest
  1150. 1 0.000025 au BufNewFile,BufRead *.htt,*.htb setf httest
  1151.  
  1152. " Icon
  1153. 1 0.000011 au BufNewFile,BufRead *.icn setf icon
  1154.  
  1155. " IDL (Interface Description Language)
  1156. 1 0.000014 au BufNewFile,BufRead *.idl call s:FTidl()
  1157.  
  1158. " Distinguish between standard IDL and MS-IDL
  1159. 1 0.000005 func! s:FTidl()
  1160. let n = 1
  1161. while n < 50 && n < line("$")
  1162. if getline(n) =~ '^\s*import\s\+"\(unknwn\|objidl\)\.idl"'
  1163. setf msidl
  1164. return
  1165. endif
  1166. let n = n + 1
  1167. endwhile
  1168. setf idl
  1169. endfunc
  1170.  
  1171. " Microsoft IDL (Interface Description Language) Also *.idl
  1172. " MOF = WMI (Windows Management Instrumentation) Managed Object Format
  1173. 1 0.000023 au BufNewFile,BufRead *.odl,*.mof setf msidl
  1174.  
  1175. " Icewm menu
  1176. 1 0.000021 au BufNewFile,BufRead */.icewm/menu setf icemenu
  1177.  
  1178. " Indent profile (must come before IDL *.pro!)
  1179. 1 0.000013 au BufNewFile,BufRead .indent.pro setf indent
  1180. 1 0.000011 au BufNewFile,BufRead indent.pro call s:ProtoCheck('indent')
  1181.  
  1182. " IDL (Interactive Data Language)
  1183. 1 0.000020 au BufNewFile,BufRead *.pro call s:ProtoCheck('idlang')
  1184.  
  1185. " Distinguish between "default" and Cproto prototype file. */
  1186. 1 0.000007 func! s:ProtoCheck(default)
  1187. " Cproto files have a comment in the first line and a function prototype in
  1188. " the second line, it always ends in ";". Indent files may also have
  1189. " comments, thus we can't match comments to see the difference.
  1190. " IDL files can have a single ';' in the second line, require at least one
  1191. " chacter before the ';'.
  1192. if getline(2) =~ '.;$'
  1193. setf cpp
  1194. else
  1195. exe 'setf ' . a:default
  1196. endif
  1197. endfunc
  1198.  
  1199.  
  1200. " Indent RC
  1201. 1 0.000014 au BufNewFile,BufRead indentrc setf indent
  1202.  
  1203. " Inform
  1204. 1 0.000020 au BufNewFile,BufRead *.inf,*.INF setf inform
  1205.  
  1206. " Initng
  1207. 1 0.000031 au BufNewFile,BufRead */etc/initng/*/*.i,*.ii setf initng
  1208.  
  1209. " Innovation Data Processing
  1210. 1 0.000070 au BufRead,BufNewFile upstream.dat\c,upstream.*.dat\c,*.upstream.dat\c setf upstreamdat
  1211. 1 0.000039 au BufRead,BufNewFile upstream.log\c,upstream.*.log\c,*.upstream.log\c setf upstreamlog
  1212. 1 0.000067 au BufRead,BufNewFile upstreaminstall.log\c,upstreaminstall.*.log\c,*.upstreaminstall.log\c setf upstreaminstalllog
  1213. 1 0.000040 au BufRead,BufNewFile usserver.log\c,usserver.*.log\c,*.usserver.log\c setf usserverlog
  1214. 1 0.000036 au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c setf usw2kagtlog
  1215.  
  1216. " Ipfilter
  1217. 1 0.000035 au BufNewFile,BufRead ipf.conf,ipf6.conf,ipf.rules setf ipfilter
  1218.  
  1219. " Informix 4GL (source - canonical, include file, I4GL+M4 preproc.)
  1220. 1 0.000035 au BufNewFile,BufRead *.4gl,*.4gh,*.m4gl setf fgl
  1221.  
  1222. " .INI file for MSDOS
  1223. 1 0.000013 au BufNewFile,BufRead *.ini setf dosini
  1224.  
  1225. " SysV Inittab
  1226. 1 0.000012 au BufNewFile,BufRead inittab setf inittab
  1227.  
  1228. " Inno Setup
  1229. 1 0.000012 au BufNewFile,BufRead *.iss setf iss
  1230.  
  1231. " J
  1232. 1 0.000015 au BufNewFile,BufRead *.ijs setf j
  1233.  
  1234. " JAL
  1235. 1 0.000026 au BufNewFile,BufRead *.jal,*.JAL setf jal
  1236.  
  1237. " Jam
  1238. 1 0.000021 au BufNewFile,BufRead *.jpl,*.jpr setf jam
  1239.  
  1240. " Java
  1241. 1 0.000030 au BufNewFile,BufRead *.java,*.jav setf java
  1242.  
  1243. " JavaCC
  1244. 1 0.000025 au BufNewFile,BufRead *.jj,*.jjt setf javacc
  1245.  
  1246. " JavaScript, ECMAScript
  1247. 1 0.000044 au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx setf javascript
  1248.  
  1249. " Java Server Pages
  1250. 1 0.000011 au BufNewFile,BufRead *.jsp setf jsp
  1251.  
  1252. " Java Properties resource file (note: doesn't catch font.properties.pl)
  1253. 1 0.000031 au BufNewFile,BufRead *.properties,*.properties_??,*.properties_??_?? setf jproperties
  1254. 1 0.000019 au BufNewFile,BufRead *.properties_??_??_* call s:StarSetf('jproperties')
  1255.  
  1256. " Jess
  1257. 1 0.000018 au BufNewFile,BufRead *.clp setf jess
  1258.  
  1259. " Jgraph
  1260. 1 0.000011 au BufNewFile,BufRead *.jgr setf jgraph
  1261.  
  1262. " Jovial
  1263. 1 0.000023 au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial
  1264.  
  1265. " JSON
  1266. 1 0.000024 au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json
  1267.  
  1268. " Kixtart
  1269. 1 0.000011 au BufNewFile,BufRead *.kix setf kix
  1270.  
  1271. " Kimwitu[++]
  1272. 1 0.000009 au BufNewFile,BufRead *.k setf kwt
  1273.  
  1274. " Kivy
  1275. 1 0.000009 au BufNewFile,BufRead *.kv setf kivy
  1276.  
  1277. " KDE script
  1278. 1 0.000010 au BufNewFile,BufRead *.ks setf kscript
  1279.  
  1280. " Kconfig
  1281. 1 0.000274 au BufNewFile,BufRead Kconfig,Kconfig.debug setf kconfig
  1282.  
  1283. " Lace (ISE)
  1284. 1 0.000025 au BufNewFile,BufRead *.ace,*.ACE setf lace
  1285.  
  1286. " Latte
  1287. 1 0.000024 au BufNewFile,BufRead *.latte,*.lte setf latte
  1288.  
  1289. " Limits
  1290. 1 0.000048 au BufNewFile,BufRead */etc/limits,*/etc/*limits.conf,*/etc/*limits.d/*.conf setf limits
  1291.  
  1292. " LambdaProlog (*.mod too, see Modsim)
  1293. 1 0.000020 au BufNewFile,BufRead *.sig setf lprolog
  1294.  
  1295. " LDAP LDIF
  1296. 1 0.000011 au BufNewFile,BufRead *.ldif setf ldif
  1297.  
  1298. " Ld loader
  1299. 1 0.000012 au BufNewFile,BufRead *.ld setf ld
  1300.  
  1301. " Less
  1302. 1 0.000012 au BufNewFile,BufRead *.less setf less
  1303.  
  1304. " Lex
  1305. 1 0.000052 au BufNewFile,BufRead *.lex,*.l,*.lxx,*.l++ setf lex
  1306.  
  1307. " Libao
  1308. 1 0.000026 au BufNewFile,BufRead */etc/libao.conf,*/.libao setf libao
  1309.  
  1310. " Libsensors
  1311. 1 0.000023 au BufNewFile,BufRead */etc/sensors.conf,*/etc/sensors3.conf setf sensors
  1312.  
  1313. " LFTP
  1314. 1 0.000029 au BufNewFile,BufRead lftp.conf,.lftprc,*lftp/rc setf lftp
  1315.  
  1316. " Lifelines (or Lex for C++!)
  1317. 1 0.000013 au BufNewFile,BufRead *.ll setf lifelines
  1318.  
  1319. " Lilo: Linux loader
  1320. 1 0.000009 au BufNewFile,BufRead lilo.conf setf lilo
  1321.  
  1322. " Lisp (*.el = ELisp, *.cl = Common Lisp, *.jl = librep Lisp)
  1323. 1 0.000008 if has("fname_case")
  1324. 1 0.000072 au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,*.L,.emacs,.sawfishrc setf lisp
  1325. 1 0.000003 else
  1326. au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,.emacs,.sawfishrc setf lisp
  1327. endif
  1328.  
  1329. " SBCL implementation of Common Lisp
  1330. 1 0.000020 au BufNewFile,BufRead sbclrc,.sbclrc setf lisp
  1331.  
  1332. " Liquid
  1333. 1 0.000009 au BufNewFile,BufRead *.liquid setf liquid
  1334.  
  1335. " Lite
  1336. 1 0.000016 au BufNewFile,BufRead *.lite,*.lt setf lite
  1337.  
  1338. " LiteStep RC files
  1339. 1 0.000015 au BufNewFile,BufRead */LiteStep/*/*.rc setf litestep
  1340.  
  1341. " Login access
  1342. 1 0.000022 au BufNewFile,BufRead */etc/login.access setf loginaccess
  1343.  
  1344. " Login defs
  1345. 1 0.000025 au BufNewFile,BufRead */etc/login.defs setf logindefs
  1346.  
  1347. " Logtalk
  1348. 1 0.000022 au BufNewFile,BufRead *.lgt setf logtalk
  1349.  
  1350. " LOTOS
  1351. 1 0.000027 au BufNewFile,BufRead *.lot,*.lotos setf lotos
  1352.  
  1353. " Lout (also: *.lt)
  1354. 1 0.000026 au BufNewFile,BufRead *.lou,*.lout setf lout
  1355.  
  1356. " Lua
  1357. 1 0.000016 au BufNewFile,BufRead *.lua setf lua
  1358.  
  1359. " Luarocks
  1360. 1 0.000015 au BufNewFile,BufRead *.rockspec setf lua
  1361.  
  1362. " Linden Scripting Language (Second Life)
  1363. 1 0.000017 au BufNewFile,BufRead *.lsl setf lsl
  1364.  
  1365. " Lynx style file (or LotusScript!)
  1366. 1 0.000013 au BufNewFile,BufRead *.lss setf lss
  1367.  
  1368. " M4
  1369. 1 0.000017 au BufNewFile,BufRead *.m4
  1370. \ if expand("<afile>") !~? 'html.m4$\|fvwm2rc' | setf m4 | endif
  1371.  
  1372. " MaGic Point
  1373. 1 0.000014 au BufNewFile,BufRead *.mgp setf mgp
  1374.  
  1375. " Mail (for Elm, trn, mutt, muttng, rn, slrn)
  1376. 1 0.000165 au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt[[:alnum:]_-]\\\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail
  1377.  
  1378. " Mail aliases
  1379. 1 0.000026 au BufNewFile,BufRead */etc/mail/aliases,*/etc/aliases setf mailaliases
  1380.  
  1381. " Mailcap configuration file
  1382. 1 0.000018 au BufNewFile,BufRead .mailcap,mailcap setf mailcap
  1383.  
  1384. " Makefile
  1385. 1 0.000066 au BufNewFile,BufRead *[mM]akefile,*.mk,*.mak,*.dsp setf make
  1386.  
  1387. " MakeIndex
  1388. 1 0.000029 au BufNewFile,BufRead *.ist,*.mst setf ist
  1389.  
  1390. " Mallard
  1391. 1 0.000121 au BufNewFile,BufRead *.page setf mallard
  1392.  
  1393. " Manpage
  1394. 1 0.000018 au BufNewFile,BufRead *.man setf nroff
  1395.  
  1396. " Man config
  1397. 1 0.000019 au BufNewFile,BufRead */etc/man.conf,man.config setf manconf
  1398.  
  1399. " Maple V
  1400. 1 0.000030 au BufNewFile,BufRead *.mv,*.mpl,*.mws setf maple
  1401.  
  1402. " Map (UMN mapserver config file)
  1403. 1 0.000011 au BufNewFile,BufRead *.map setf map
  1404.  
  1405. " Markdown
  1406. 1 0.000064 au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md setf markdown
  1407.  
  1408. " Mason
  1409. 1 0.000036 au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason
  1410.  
  1411. " Matlab or Objective C
  1412. 1 0.000013 au BufNewFile,BufRead *.m call s:FTm()
  1413.  
  1414. 1 0.000007 func! s:FTm()
  1415. let n = 1
  1416. while n < 10
  1417. let line = getline(n)
  1418. if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\|//\)'
  1419. setf objc
  1420. return
  1421. endif
  1422. if line =~ '^\s*%'
  1423. setf matlab
  1424. return
  1425. endif
  1426. if line =~ '^\s*(\*'
  1427. setf mma
  1428. return
  1429. endif
  1430. let n = n + 1
  1431. endwhile
  1432. if exists("g:filetype_m")
  1433. exe "setf " . g:filetype_m
  1434. else
  1435. setf matlab
  1436. endif
  1437. endfunc
  1438.  
  1439. " Mathematica notebook
  1440. 1 0.000016 au BufNewFile,BufRead *.nb setf mma
  1441.  
  1442. " Maya Extension Language
  1443. 1 0.000013 au BufNewFile,BufRead *.mel setf mel
  1444.  
  1445. " Mercurial (hg) commit file
  1446. 1 0.000012 au BufNewFile,BufRead hg-editor-*.txt setf hgcommit
  1447.  
  1448. " Mercurial config (looks like generic config file)
  1449. 1 0.000028 au BufNewFile,BufRead *.hgrc,*hgrc setf cfg
  1450.  
  1451. " Messages (logs mostly)
  1452. 1 0.000040 au BufNewFile,BufRead */log/{auth,cron,daemon,debug,kern,lpr,mail,messages,news/news,syslog,user}{,.log,.err,.info,.warn,.crit,.notice}{,.[0-9]*,-[0-9]*} setf messages
  1453.  
  1454. " Metafont
  1455. 1 0.000011 au BufNewFile,BufRead *.mf setf mf
  1456.  
  1457. " MetaPost
  1458. 1 0.000012 au BufNewFile,BufRead *.mp setf mp
  1459.  
  1460. " MGL
  1461. 1 0.000013 au BufNewFile,BufRead *.mgl setf mgl
  1462.  
  1463. " MIX - Knuth assembly
  1464. 1 0.000020 au BufNewFile,BufRead *.mix,*.mixal setf mix
  1465.  
  1466. " MMIX or VMS makefile
  1467. 1 0.000014 au BufNewFile,BufRead *.mms call s:FTmms()
  1468.  
  1469. " Symbian meta-makefile definition (MMP)
  1470. 1 0.000017 au BufNewFile,BufRead *.mmp setf mmp
  1471.  
  1472. 1 0.000005 func! s:FTmms()
  1473. let n = 1
  1474. while n < 10
  1475. let line = getline(n)
  1476. if line =~ '^\s*\(%\|//\)' || line =~ '^\*'
  1477. setf mmix
  1478. return
  1479. endif
  1480. if line =~ '^\s*#'
  1481. setf make
  1482. return
  1483. endif
  1484. let n = n + 1
  1485. endwhile
  1486. setf mmix
  1487. endfunc
  1488.  
  1489.  
  1490. " Modsim III (or LambdaProlog)
  1491. 1 0.000016 au BufNewFile,BufRead *.mod
  1492. \ if getline(1) =~ '\<module\>' |
  1493. \ setf lprolog |
  1494. \ else |
  1495. \ setf modsim3 |
  1496. \ endif
  1497.  
  1498. " Modula 2 (.md removed in favor of Markdown)
  1499. 1 0.000039 au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.mi setf modula2
  1500.  
  1501. " Modula 3 (.m3, .i3, .mg, .ig)
  1502. 1 0.000013 au BufNewFile,BufRead *.[mi][3g] setf modula3
  1503.  
  1504. " Monk
  1505. 1 0.000056 au BufNewFile,BufRead *.isc,*.monk,*.ssc,*.tsc setf monk
  1506.  
  1507. " MOO
  1508. 1 0.000015 au BufNewFile,BufRead *.moo setf moo
  1509.  
  1510. " Modconf
  1511. 1 0.000036 au BufNewFile,BufRead */etc/modules.conf,*/etc/modules,*/etc/conf.modules setf modconf
  1512.  
  1513. " Mplayer config
  1514. 1 0.000026 au BufNewFile,BufRead mplayer.conf,*/.mplayer/config setf mplayerconf
  1515.  
  1516. " Motorola S record
  1517. 1 0.000069 au BufNewFile,BufRead *.s19,*.s28,*.s37,*.mot,*.srec setf srec
  1518.  
  1519. " Mrxvtrc
  1520. 1 0.000021 au BufNewFile,BufRead mrxvtrc,.mrxvtrc setf mrxvtrc
  1521.  
  1522. " Msql
  1523. 1 0.000012 au BufNewFile,BufRead *.msql setf msql
  1524.  
  1525. " Mysql
  1526. 1 0.000013 au BufNewFile,BufRead *.mysql setf mysql
  1527.  
  1528. " Mutt setup files (must be before catch *.rc)
  1529. 1 0.000037 au BufNewFile,BufRead */etc/Muttrc.d/* call s:StarSetf('muttrc')
  1530.  
  1531. " M$ Resource files
  1532. 1 0.000029 au BufNewFile,BufRead *.rc,*.rch setf rc
  1533.  
  1534. " MuPAD source
  1535. 1 0.000018 au BufRead,BufNewFile *.mu setf mupad
  1536.  
  1537. " Mush
  1538. 1 0.000014 au BufNewFile,BufRead *.mush setf mush
  1539.  
  1540. " Mutt setup file (also for Muttng)
  1541. 1 0.000014 au BufNewFile,BufRead Mutt{ng,}rc setf muttrc
  1542.  
  1543. " Nano
  1544. 1 0.000027 au BufNewFile,BufRead */etc/nanorc,*.nanorc setf nanorc
  1545.  
  1546. " Nastran input/DMAP
  1547. "au BufNewFile,BufRead *.dat setf nastran
  1548.  
  1549. " Natural
  1550. 1 0.000014 au BufNewFile,BufRead *.NS[ACGLMNPS] setf natural
  1551.  
  1552. " Netrc
  1553. 1 0.000012 au BufNewFile,BufRead .netrc setf netrc
  1554.  
  1555. " Ninja file
  1556. 1 0.000011 au BufNewFile,BufRead *.ninja setf ninja
  1557.  
  1558. " Novell netware batch files
  1559. 1 0.000025 au BufNewFile,BufRead *.ncf setf ncf
  1560.  
  1561. " Nroff/Troff (*.ms and *.t are checked below)
  1562. 1 0.000022 au BufNewFile,BufRead *.me
  1563. \ if expand("<afile>") != "read.me" && expand("<afile>") != "click.me" |
  1564. \ setf nroff |
  1565. \ endif
  1566. 1 0.000064 au BufNewFile,BufRead *.tr,*.nr,*.roff,*.tmac,*.mom setf nroff
  1567. 1 0.000015 au BufNewFile,BufRead *.[1-9] call s:FTnroff()
  1568.  
  1569. " This function checks if one of the first five lines start with a dot. In
  1570. " that case it is probably an nroff file: 'filetype' is set and 1 is returned.
  1571. 1 0.000005 func! s:FTnroff()
  1572. if getline(1)[0] . getline(2)[0] . getline(3)[0] . getline(4)[0] . getline(5)[0] =~ '\.'
  1573. setf nroff
  1574. return 1
  1575. endif
  1576. return 0
  1577. endfunc
  1578.  
  1579. " Nroff or Objective C++
  1580. 1 0.000011 au BufNewFile,BufRead *.mm call s:FTmm()
  1581.  
  1582. 1 0.000003 func! s:FTmm()
  1583. let n = 1
  1584. while n < 10
  1585. let line = getline(n)
  1586. if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)'
  1587. setf objcpp
  1588. return
  1589. endif
  1590. let n = n + 1
  1591. endwhile
  1592. setf nroff
  1593. endfunc
  1594.  
  1595. " Not Quite C
  1596. 1 0.000013 au BufNewFile,BufRead *.nqc setf nqc
  1597.  
  1598. " NSIS
  1599. 1 0.000026 au BufNewFile,BufRead *.nsi,*.nsh setf nsis
  1600.  
  1601. " OCAML
  1602. 1 0.000065 au BufNewFile,BufRead *.ml,*.mli,*.mll,*.mly,.ocamlinit setf ocaml
  1603.  
  1604. " Occam
  1605. 1 0.000013 au BufNewFile,BufRead *.occ setf occam
  1606.  
  1607. " Omnimark
  1608. 1 0.000024 au BufNewFile,BufRead *.xom,*.xin setf omnimark
  1609.  
  1610. " OpenROAD
  1611. 1 0.000011 au BufNewFile,BufRead *.or setf openroad
  1612.  
  1613. " OPL
  1614. 1 0.000018 au BufNewFile,BufRead *.[Oo][Pp][Ll] setf opl
  1615.  
  1616. " Oracle config file
  1617. 1 0.000013 au BufNewFile,BufRead *.ora setf ora
  1618.  
  1619. " Packet filter conf
  1620. 1 0.000014 au BufNewFile,BufRead pf.conf setf pf
  1621.  
  1622. " Pam conf
  1623. 1 0.000014 au BufNewFile,BufRead */etc/pam.conf setf pamconf
  1624.  
  1625. " PApp
  1626. 1 0.000032 au BufNewFile,BufRead *.papp,*.pxml,*.pxsl setf papp
  1627.  
  1628. " Password file
  1629. 1 0.000086 au BufNewFile,BufRead */etc/passwd,*/etc/passwd-,*/etc/passwd.edit,*/etc/shadow,*/etc/shadow-,*/etc/shadow.edit,*/var/backups/passwd.bak,*/var/backups/shadow.bak setf passwd
  1630.  
  1631. " Pascal (also *.p)
  1632. 1 0.000018 au BufNewFile,BufRead *.pas setf pascal
  1633.  
  1634. " Delphi project file
  1635. 1 0.000036 au BufNewFile,BufRead *.dpr setf pascal
  1636.  
  1637. " PDF
  1638. 1 0.000016 au BufNewFile,BufRead *.pdf setf pdf
  1639.  
  1640. " Perl
  1641. 1 0.000010 if has("fname_case")
  1642. 1 0.000160 au BufNewFile,BufRead *.pl,*.PL call s:FTpl()
  1643. 1 0.000004 else
  1644. au BufNewFile,BufRead *.pl call s:FTpl()
  1645. endif
  1646. 1 0.000027 au BufNewFile,BufRead *.plx,*.al setf perl
  1647. 1 0.000063 au BufNewFile,BufRead *.p6,*.pm6,*.pl6 setf perl6
  1648.  
  1649. 1 0.000008 func! s:FTpl()
  1650. if exists("g:filetype_pl")
  1651. exe "setf " . g:filetype_pl
  1652. else
  1653. " recognize Prolog by specific text in the first non-empty line
  1654. " require a blank after the '%' because Perl uses "%list" and "%translate"
  1655. let l = getline(nextnonblank(1))
  1656. if l =~ '\<prolog\>' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-'
  1657. setf prolog
  1658. else
  1659. setf perl
  1660. endif
  1661. endif
  1662. endfunc
  1663.  
  1664. " Perl, XPM or XPM2
  1665. 1 0.000025 au BufNewFile,BufRead *.pm
  1666. \ if getline(1) =~ "XPM2" |
  1667. \ setf xpm2 |
  1668. \ elseif getline(1) =~ "XPM" |
  1669. \ setf xpm |
  1670. \ else |
  1671. \ setf perl |
  1672. \ endif
  1673.  
  1674. " Perl POD
  1675. 1 0.000018 au BufNewFile,BufRead *.pod setf pod
  1676. 1 0.000014 au BufNewFile,BufRead *.pod6 setf pod6
  1677.  
  1678. " Php, php3, php4, etc.
  1679. " Also Phtml (was used for PHP 2 in the past)
  1680. " Also .ctp for Cake template file
  1681. 1 0.000055 au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp setf php
  1682.  
  1683. " Pike
  1684. 1 0.000054 au BufNewFile,BufRead *.pike,*.lpc,*.ulpc,*.pmod setf pike
  1685.  
  1686. " Pinfo config
  1687. 1 0.000026 au BufNewFile,BufRead */etc/pinforc,*/.pinforc setf pinfo
  1688.  
  1689. " Palm Resource compiler
  1690. 1 0.000019 au BufNewFile,BufRead *.rcp setf pilrc
  1691.  
  1692. " Pine config
  1693. 1 0.000055 au BufNewFile,BufRead .pinerc,pinerc,.pinercex,pinercex setf pine
  1694.  
  1695. " PL/1, PL/I
  1696. 1 0.000029 au BufNewFile,BufRead *.pli,*.pl1 setf pli
  1697.  
  1698. " PL/M (also: *.inp)
  1699. 1 0.000049 au BufNewFile,BufRead *.plm,*.p36,*.pac setf plm
  1700.  
  1701. " PL/SQL
  1702. 1 0.000023 au BufNewFile,BufRead *.pls,*.plsql setf plsql
  1703.  
  1704. " PLP
  1705. 1 0.000012 au BufNewFile,BufRead *.plp setf plp
  1706.  
  1707. " PO and PO template (GNU gettext)
  1708. 1 0.000029 au BufNewFile,BufRead *.po,*.pot setf po
  1709.  
  1710. " Postfix main config
  1711. 1 0.000012 au BufNewFile,BufRead main.cf setf pfmain
  1712.  
  1713. " PostScript (+ font files, encapsulated PostScript, Adobe Illustrator)
  1714. 1 0.000089 au BufNewFile,BufRead *.ps,*.pfa,*.afm,*.eps,*.epsf,*.epsi,*.ai setf postscr
  1715.  
  1716. " PostScript Printer Description
  1717. 1 0.000015 au BufNewFile,BufRead *.ppd setf ppd
  1718.  
  1719. " Povray
  1720. 1 0.000012 au BufNewFile,BufRead *.pov setf pov
  1721.  
  1722. " Povray configuration
  1723. 1 0.000014 au BufNewFile,BufRead .povrayrc setf povini
  1724.  
  1725. " Povray, PHP or assembly
  1726. 1 0.000012 au BufNewFile,BufRead *.inc call s:FTinc()
  1727.  
  1728. 1 0.000005 func! s:FTinc()
  1729. if exists("g:filetype_inc")
  1730. exe "setf " . g:filetype_inc
  1731. else
  1732. let lines = getline(1).getline(2).getline(3)
  1733. if lines =~? "perlscript"
  1734. setf aspperl
  1735. elseif lines =~ "<%"
  1736. setf aspvbs
  1737. elseif lines =~ "<?"
  1738. setf php
  1739. else
  1740. call s:FTasmsyntax()
  1741. if exists("b:asmsyntax")
  1742. exe "setf " . fnameescape(b:asmsyntax)
  1743. else
  1744. setf pov
  1745. endif
  1746. endif
  1747. endif
  1748. endfunc
  1749.  
  1750. " Printcap and Termcap
  1751. 1 0.000018 au BufNewFile,BufRead *printcap
  1752. \ let b:ptcap_type = "print" | setf ptcap
  1753. 1 0.000015 au BufNewFile,BufRead *termcap
  1754. \ let b:ptcap_type = "term" | setf ptcap
  1755.  
  1756. " PCCTS / ANTRL
  1757. "au BufNewFile,BufRead *.g setf antrl
  1758. 1 0.000012 au BufNewFile,BufRead *.g setf pccts
  1759.  
  1760. " PPWizard
  1761. 1 0.000025 au BufNewFile,BufRead *.it,*.ih setf ppwiz
  1762.  
  1763. " Obj 3D file format
  1764. " TODO: is there a way to avoid MS-Windows Object files?
  1765. 1 0.000019 au BufNewFile,BufRead *.obj setf obj
  1766.  
  1767. " Oracle Pro*C/C++
  1768. 1 0.000017 au BufNewFile,BufRead *.pc setf proc
  1769.  
  1770. " Privoxy actions file
  1771. 1 0.000016 au BufNewFile,BufRead *.action setf privoxy
  1772.  
  1773. " Procmail
  1774. 1 0.000023 au BufNewFile,BufRead .procmail,.procmailrc setf procmail
  1775.  
  1776. " Progress or CWEB
  1777. 1 0.000018 au BufNewFile,BufRead *.w call s:FTprogress_cweb()
  1778.  
  1779. 1 0.000005 func! s:FTprogress_cweb()
  1780. if exists("g:filetype_w")
  1781. exe "setf " . g:filetype_w
  1782. return
  1783. endif
  1784. if getline(1) =~ '&ANALYZE' || getline(3) =~ '&GLOBAL-DEFINE'
  1785. setf progress
  1786. else
  1787. setf cweb
  1788. endif
  1789. endfunc
  1790.  
  1791. " Progress or assembly
  1792. 1 0.000015 au BufNewFile,BufRead *.i call s:FTprogress_asm()
  1793.  
  1794. 1 0.000003 func! s:FTprogress_asm()
  1795. if exists("g:filetype_i")
  1796. exe "setf " . g:filetype_i
  1797. return
  1798. endif
  1799. " This function checks for an assembly comment the first ten lines.
  1800. " If not found, assume Progress.
  1801. let lnum = 1
  1802. while lnum <= 10 && lnum < line('$')
  1803. let line = getline(lnum)
  1804. if line =~ '^\s*;' || line =~ '^\*'
  1805. call s:FTasm()
  1806. return
  1807. elseif line !~ '^\s*$' || line =~ '^/\*'
  1808. " Not an empty line: Doesn't look like valid assembly code.
  1809. " Or it looks like a Progress /* comment
  1810. break
  1811. endif
  1812. let lnum = lnum + 1
  1813. endw
  1814. setf progress
  1815. endfunc
  1816.  
  1817. " Progress or Pascal
  1818. 1 0.000011 au BufNewFile,BufRead *.p call s:FTprogress_pascal()
  1819.  
  1820. 1 0.000002 func! s:FTprogress_pascal()
  1821. if exists("g:filetype_p")
  1822. exe "setf " . g:filetype_p
  1823. return
  1824. endif
  1825. " This function checks for valid Pascal syntax in the first ten lines.
  1826. " Look for either an opening comment or a program start.
  1827. " If not found, assume Progress.
  1828. let lnum = 1
  1829. while lnum <= 10 && lnum < line('$')
  1830. let line = getline(lnum)
  1831. if line =~ '^\s*\(program\|unit\|procedure\|function\|const\|type\|var\)\>'
  1832. \ || line =~ '^\s*{' || line =~ '^\s*(\*'
  1833. setf pascal
  1834. return
  1835. elseif line !~ '^\s*$' || line =~ '^/\*'
  1836. " Not an empty line: Doesn't look like valid Pascal code.
  1837. " Or it looks like a Progress /* comment
  1838. break
  1839. endif
  1840. let lnum = lnum + 1
  1841. endw
  1842. setf progress
  1843. endfunc
  1844.  
  1845.  
  1846. " Software Distributor Product Specification File (POSIX 1387.2-1995)
  1847. 1 0.000016 au BufNewFile,BufRead *.psf setf psf
  1848. 1 0.000040 au BufNewFile,BufRead INDEX,INFO
  1849. \ if getline(1) =~ '^\s*\(distribution\|installed_software\|root\|bundle\|product\)\s*$' |
  1850. \ setf psf |
  1851. \ endif
  1852.  
  1853. " Prolog
  1854. 1 0.000014 au BufNewFile,BufRead *.pdb setf prolog
  1855.  
  1856. " Promela
  1857. 1 0.000013 au BufNewFile,BufRead *.pml setf promela
  1858.  
  1859. " Google protocol buffers
  1860. 1 0.000059 au BufNewFile,BufRead *.proto setf proto
  1861.  
  1862. " Protocols
  1863. 1 0.000025 au BufNewFile,BufRead */etc/protocols setf protocols
  1864.  
  1865. " Pyrex
  1866. 1 0.000039 au BufNewFile,BufRead *.pyx,*.pxd setf pyrex
  1867.  
  1868. " Python, Python Shell Startup Files
  1869. " Quixote (Python-based web framework)
  1870. 1 0.000088 au BufNewFile,BufRead *.py,*.pyw,.pythonstartup,.pythonrc,*.ptl setf python
  1871.  
  1872. " Radiance
  1873. 1 0.000040 au BufNewFile,BufRead *.rad,*.mat setf radiance
  1874.  
  1875. " Ratpoison config/command files
  1876. 1 0.000027 au BufNewFile,BufRead .ratpoisonrc,ratpoisonrc setf ratpoison
  1877.  
  1878. " RCS file
  1879. 1 0.000013 au BufNewFile,BufRead *\,v setf rcs
  1880.  
  1881. " Readline
  1882. 1 0.000025 au BufNewFile,BufRead .inputrc,inputrc setf readline
  1883.  
  1884. " Registry for MS-Windows
  1885. 1 0.000021 au BufNewFile,BufRead *.reg
  1886. \ if getline(1) =~? '^REGEDIT[0-9]*\s*$\|^Windows Registry Editor Version \d*\.\d*\s*$' | setf registry | endif
  1887.  
  1888. " Renderman Interface Bytestream
  1889. 1 0.000016 au BufNewFile,BufRead *.rib setf rib
  1890.  
  1891. " Rexx
  1892. 1 0.000121 au BufNewFile,BufRead *.rex,*.orx,*.rxo,*.rxj,*.jrexx,*.rexxj,*.rexx,*.testGroup,*.testUnit setf rexx
  1893.  
  1894. " R (Splus)
  1895. 1 0.000010 if has("fname_case")
  1896. 1 0.000025 au BufNewFile,BufRead *.s,*.S setf r
  1897. 1 0.000003 else
  1898. au BufNewFile,BufRead *.s setf r
  1899. endif
  1900.  
  1901. " R Help file
  1902. 1 0.000004 if has("fname_case")
  1903. 1 0.000032 au BufNewFile,BufRead *.rd,*.Rd setf rhelp
  1904. 1 0.000002 else
  1905. au BufNewFile,BufRead *.rd setf rhelp
  1906. endif
  1907.  
  1908. " R noweb file
  1909. 1 0.000004 if has("fname_case")
  1910. 1 0.000077 au BufNewFile,BufRead *.Rnw,*.rnw,*.Snw,*.snw setf rnoweb
  1911. 1 0.000002 else
  1912. au BufNewFile,BufRead *.rnw,*.snw setf rnoweb
  1913. endif
  1914.  
  1915. " R Markdown file
  1916. 1 0.000003 if has("fname_case")
  1917. 1 0.000073 au BufNewFile,BufRead *.Rmd,*.rmd,*.Smd,*.smd setf rmd
  1918. 1 0.000002 else
  1919. au BufNewFile,BufRead *.rmd,*.smd setf rmd
  1920. endif
  1921.  
  1922. " R reStructuredText file
  1923. 1 0.000003 if has("fname_case")
  1924. 1 0.000045 au BufNewFile,BufRead *.Rrst,*.rrst,*.Srst,*.srst setf rrst
  1925. 1 0.000001 else
  1926. au BufNewFile,BufRead *.rrst,*.srst setf rrst
  1927. endif
  1928.  
  1929. " Rexx, Rebol or R
  1930. 1 0.000044 au BufNewFile,BufRead *.r,*.R call s:FTr()
  1931.  
  1932. 1 0.000005 func! s:FTr()
  1933. let max = line("$") > 50 ? 50 : line("$")
  1934.  
  1935. for n in range(1, max)
  1936. " Rebol is easy to recognize, check for that first
  1937. if getline(n) =~? '\<REBOL\>'
  1938. setf rebol
  1939. return
  1940. endif
  1941. endfor
  1942.  
  1943. for n in range(1, max)
  1944. " R has # comments
  1945. if getline(n) =~ '^\s*#'
  1946. setf r
  1947. return
  1948. endif
  1949. " Rexx has /* comments */
  1950. if getline(n) =~ '^\s*/\*'
  1951. setf rexx
  1952. return
  1953. endif
  1954. endfor
  1955.  
  1956. " Nothing recognized, use user default or assume Rexx
  1957. if exists("g:filetype_r")
  1958. exe "setf " . g:filetype_r
  1959. else
  1960. " Rexx used to be the default, but R appears to be much more popular.
  1961. setf r
  1962. endif
  1963. endfunc
  1964.  
  1965. " Remind
  1966. 1 0.000041 au BufNewFile,BufRead .reminders,*.remind,*.rem setf remind
  1967.  
  1968. " Resolv.conf
  1969. 1 0.000014 au BufNewFile,BufRead resolv.conf setf resolv
  1970.  
  1971. " Relax NG Compact
  1972. 1 0.000016 au BufNewFile,BufRead *.rnc setf rnc
  1973.  
  1974. " Relax NG XML
  1975. 1 0.000015 au BufNewFile,BufRead *.rng setf rng
  1976.  
  1977. " RPL/2
  1978. 1 0.000017 au BufNewFile,BufRead *.rpl setf rpl
  1979.  
  1980. " Robots.txt
  1981. 1 0.000014 au BufNewFile,BufRead robots.txt setf robots
  1982.  
  1983. " Rpcgen
  1984. 1 0.000015 au BufNewFile,BufRead *.x setf rpcgen
  1985.  
  1986. " reStructuredText Documentation Format
  1987. 1 0.000014 au BufNewFile,BufRead *.rst setf rst
  1988.  
  1989. " RTF
  1990. 1 0.000013 au BufNewFile,BufRead *.rtf setf rtf
  1991.  
  1992. " Interactive Ruby shell
  1993. 1 0.000031 au BufNewFile,BufRead .irbrc,irbrc setf ruby
  1994.  
  1995. " Ruby
  1996. 1 0.000027 au BufNewFile,BufRead *.rb,*.rbw setf ruby
  1997.  
  1998. " RubyGems
  1999. 1 0.000012 au BufNewFile,BufRead *.gemspec setf ruby
  2000.  
  2001. " Rackup
  2002. 1 0.000012 au BufNewFile,BufRead *.ru setf ruby
  2003.  
  2004. " Bundler
  2005. 1 0.000015 au BufNewFile,BufRead Gemfile setf ruby
  2006.  
  2007. " Ruby on Rails
  2008. 1 0.000048 au BufNewFile,BufRead *.builder,*.rxml,*.rjs setf ruby
  2009.  
  2010. " Rantfile and Rakefile is like Ruby
  2011. 1 0.000057 au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake setf ruby
  2012.  
  2013. " S-lang (or shader language, or SmallLisp)
  2014. 1 0.000017 au BufNewFile,BufRead *.sl setf slang
  2015.  
  2016. " Samba config
  2017. 1 0.000017 au BufNewFile,BufRead smb.conf setf samba
  2018.  
  2019. " SAS script
  2020. 1 0.000031 au BufNewFile,BufRead *.sas setf sas
  2021.  
  2022. " Sass
  2023. 1 0.000017 au BufNewFile,BufRead *.sass setf sass
  2024.  
  2025. " Sather
  2026. 1 0.000013 au BufNewFile,BufRead *.sa setf sather
  2027.  
  2028. " Scilab
  2029. 1 0.000031 au BufNewFile,BufRead *.sci,*.sce setf scilab
  2030.  
  2031. " SCSS
  2032. 1 0.000013 au BufNewFile,BufRead *.scss setf scss
  2033.  
  2034. " SD: Streaming Descriptors
  2035. 1 0.000014 au BufNewFile,BufRead *.sd setf sd
  2036.  
  2037. " SDL
  2038. 1 0.000027 au BufNewFile,BufRead *.sdl,*.pr setf sdl
  2039.  
  2040. " sed
  2041. 1 0.000018 au BufNewFile,BufRead *.sed setf sed
  2042.  
  2043. " Sieve (RFC 3028)
  2044. 1 0.000017 au BufNewFile,BufRead *.siv setf sieve
  2045.  
  2046. " Sendmail
  2047. 1 0.000017 au BufNewFile,BufRead sendmail.cf setf sm
  2048.  
  2049. " Sendmail .mc files are actually m4. Could also be MS Message text file.
  2050. 1 0.000018 au BufNewFile,BufRead *.mc call s:McSetf()
  2051.  
  2052. 1 0.000006 func! s:McSetf()
  2053. " Rely on the file to start with a comment.
  2054. " MS message text files use ';', Sendmail files use '#' or 'dnl'
  2055. for lnum in range(1, min([line("$"), 20]))
  2056. let line = getline(lnum)
  2057. if line =~ '^\s*\(#\|dnl\)'
  2058. setf m4 " Sendmail .mc file
  2059. return
  2060. elseif line =~ '^\s*;'
  2061. setf msmessages " MS Message text file
  2062. return
  2063. endif
  2064. endfor
  2065. setf m4 " Default: Sendmail .mc file
  2066. endfunc
  2067.  
  2068. " Services
  2069. 1 0.000024 au BufNewFile,BufRead */etc/services setf services
  2070.  
  2071. " Service Location config
  2072. 1 0.000018 au BufNewFile,BufRead */etc/slp.conf setf slpconf
  2073.  
  2074. " Service Location registration
  2075. 1 0.000014 au BufNewFile,BufRead */etc/slp.reg setf slpreg
  2076.  
  2077. " Service Location SPI
  2078. 1 0.000016 au BufNewFile,BufRead */etc/slp.spi setf slpspi
  2079.  
  2080. " Setserial config
  2081. 1 0.000021 au BufNewFile,BufRead */etc/serial.conf setf setserial
  2082.  
  2083. " SGML
  2084. 1 0.000040 au BufNewFile,BufRead *.sgm,*.sgml
  2085. \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'linuxdoc' |
  2086. \ setf sgmllnx |
  2087. \ elseif getline(1) =~ '<!DOCTYPE.*DocBook' || getline(2) =~ '<!DOCTYPE.*DocBook' |
  2088. \ let b:docbk_type = "sgml" |
  2089. \ let b:docbk_ver = 4 |
  2090. \ setf docbk |
  2091. \ else |
  2092. \ setf sgml |
  2093. \ endif
  2094.  
  2095. " SGMLDECL
  2096. 1 0.000046 au BufNewFile,BufRead *.decl,*.dcl,*.dec
  2097. \ if getline(1).getline(2).getline(3) =~? '^<!SGML' |
  2098. \ setf sgmldecl |
  2099. \ endif
  2100.  
  2101. " SGML catalog file
  2102. 1 0.000036 au BufNewFile,BufRead catalog setf catalog
  2103. 1 0.000015 au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog')
  2104.  
  2105. " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
  2106. " Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts
  2107. 1 0.000145 au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD* call SetFileTypeSH("bash")
  2108. 1 0.000038 au BufNewFile,BufRead .kshrc*,*.ksh call SetFileTypeSH("ksh")
  2109. 1 0.000068 au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call SetFileTypeSH(getline(1))
  2110.  
  2111. " Shell script (Arch Linux) or PHP file (Drupal)
  2112. 1 0.000017 au BufNewFile,BufRead *.install
  2113. \ if getline(1) =~ '<?php' |
  2114. \ setf php |
  2115. \ else |
  2116. \ call SetFileTypeSH("bash") |
  2117. \ endif
  2118.  
  2119. " Also called from scripts.vim.
  2120. 1 0.000004 func! SetFileTypeSH(name)
  2121. if expand("<amatch>") =~ g:ft_ignore_pat
  2122. return
  2123. endif
  2124. if a:name =~ '\<csh\>'
  2125. " Some .sh scripts contain #!/bin/csh.
  2126. call SetFileTypeShell("csh")
  2127. return
  2128. elseif a:name =~ '\<tcsh\>'
  2129. " Some .sh scripts contain #!/bin/tcsh.
  2130. call SetFileTypeShell("tcsh")
  2131. return
  2132. elseif a:name =~ '\<zsh\>'
  2133. " Some .sh scripts contain #!/bin/zsh.
  2134. call SetFileTypeShell("zsh")
  2135. return
  2136. elseif a:name =~ '\<ksh\>'
  2137. let b:is_kornshell = 1
  2138. if exists("b:is_bash")
  2139. unlet b:is_bash
  2140. endif
  2141. if exists("b:is_sh")
  2142. unlet b:is_sh
  2143. endif
  2144. elseif exists("g:bash_is_sh") || a:name =~ '\<bash\>' || a:name =~ '\<bash2\>'
  2145. let b:is_bash = 1
  2146. if exists("b:is_kornshell")
  2147. unlet b:is_kornshell
  2148. endif
  2149. if exists("b:is_sh")
  2150. unlet b:is_sh
  2151. endif
  2152. elseif a:name =~ '\<sh\>'
  2153. let b:is_sh = 1
  2154. if exists("b:is_kornshell")
  2155. unlet b:is_kornshell
  2156. endif
  2157. if exists("b:is_bash")
  2158. unlet b:is_bash
  2159. endif
  2160. endif
  2161. call SetFileTypeShell("sh")
  2162. endfunc
  2163.  
  2164. " For shell-like file types, check for an "exec" command hidden in a comment,
  2165. " as used for Tcl.
  2166. " Also called from scripts.vim, thus can't be local to this script.
  2167. 1 0.000002 func! SetFileTypeShell(name)
  2168. if expand("<amatch>") =~ g:ft_ignore_pat
  2169. return
  2170. endif
  2171. let l = 2
  2172. while l < 20 && l < line("$") && getline(l) =~ '^\s*\(#\|$\)'
  2173. " Skip empty and comment lines.
  2174. let l = l + 1
  2175. endwhile
  2176. if l < line("$") && getline(l) =~ '\s*exec\s' && getline(l - 1) =~ '^\s*#.*\\$'
  2177. " Found an "exec" line after a comment with continuation
  2178. let n = substitute(getline(l),'\s*exec\s\+\([^ ]*/\)\=', '', '')
  2179. if n =~ '\<tclsh\|\<wish'
  2180. setf tcl
  2181. return
  2182. endif
  2183. endif
  2184. exe "setf " . a:name
  2185. endfunc
  2186.  
  2187. " tcsh scripts
  2188. 1 0.000065 au BufNewFile,BufRead .tcshrc*,*.tcsh,tcsh.tcshrc,tcsh.login call SetFileTypeShell("tcsh")
  2189.  
  2190. " csh scripts, but might also be tcsh scripts (on some systems csh is tcsh)
  2191. 1 0.000104 au BufNewFile,BufRead .login*,.cshrc*,csh.cshrc,csh.login,csh.logout,*.csh,.alias call s:CSH()
  2192.  
  2193. 1 0.000005 func! s:CSH()
  2194. if exists("g:filetype_csh")
  2195. call SetFileTypeShell(g:filetype_csh)
  2196. elseif &shell =~ "tcsh"
  2197. call SetFileTypeShell("tcsh")
  2198. else
  2199. call SetFileTypeShell("csh")
  2200. endif
  2201. endfunc
  2202.  
  2203. " Z-Shell script
  2204. 1 0.000042 au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks setf zsh
  2205. 1 0.000044 au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump* call s:StarSetf('zsh')
  2206. 1 0.000026 au BufNewFile,BufRead *.zsh setf zsh
  2207.  
  2208. " Scheme
  2209. 1 0.000090 au BufNewFile,BufRead *.scm,*.ss,*.rkt setf scheme
  2210.  
  2211. " Screen RC
  2212. 1 0.000033 au BufNewFile,BufRead .screenrc,screenrc setf screen
  2213.  
  2214. " Simula
  2215. 1 0.000222 au BufNewFile,BufRead *.sim setf simula
  2216.  
  2217. " SINDA
  2218. 1 0.000045 au BufNewFile,BufRead *.sin,*.s85 setf sinda
  2219.  
  2220. " SiSU
  2221. 1 0.000071 au BufNewFile,BufRead *.sst,*.ssm,*.ssi,*.-sst,*._sst setf sisu
  2222. 1 0.000047 au BufNewFile,BufRead *.sst.meta,*.-sst.meta,*._sst.meta setf sisu
  2223.  
  2224. " SKILL
  2225. 1 0.000054 au BufNewFile,BufRead *.il,*.ils,*.cdf setf skill
  2226.  
  2227. " SLRN
  2228. 1 0.000016 au BufNewFile,BufRead .slrnrc setf slrnrc
  2229. 1 0.000016 au BufNewFile,BufRead *.score setf slrnsc
  2230.  
  2231. " Smalltalk (and TeX)
  2232. 1 0.000015 au BufNewFile,BufRead *.st setf st
  2233. 1 0.000026 au BufNewFile,BufRead *.cls
  2234. \ if getline(1) =~ '^%' |
  2235. \ setf tex |
  2236. \ elseif getline(1)[0] == '#' && getline(1) =~ 'rexx' |
  2237. \ setf rexx |
  2238. \ else |
  2239. \ setf st |
  2240. \ endif
  2241.  
  2242. " Smarty templates
  2243. 1 0.000015 au BufNewFile,BufRead *.tpl setf smarty
  2244.  
  2245. " SMIL or XML
  2246. 1 0.000016 au BufNewFile,BufRead *.smil
  2247. \ if getline(1) =~ '<?\s*xml.*?>' |
  2248. \ setf xml |
  2249. \ else |
  2250. \ setf smil |
  2251. \ endif
  2252.  
  2253. " SMIL or SNMP MIB file
  2254. 1 0.000020 au BufNewFile,BufRead *.smi
  2255. \ if getline(1) =~ '\<smil\>' |
  2256. \ setf smil |
  2257. \ else |
  2258. \ setf mib |
  2259. \ endif
  2260.  
  2261. " SMITH
  2262. 1 0.000027 au BufNewFile,BufRead *.smt,*.smith setf smith
  2263.  
  2264. " Snobol4 and spitbol
  2265. 1 0.000034 au BufNewFile,BufRead *.sno,*.spt setf snobol4
  2266.  
  2267. " SNMP MIB files
  2268. 1 0.000027 au BufNewFile,BufRead *.mib,*.my setf mib
  2269.  
  2270. " Snort Configuration
  2271. 1 0.000038 au BufNewFile,BufRead *.hog,snort.conf,vision.conf setf hog
  2272. 1 0.000021 au BufNewFile,BufRead *.rules call s:FTRules()
  2273.  
  2274. 1 0.000011 let s:ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*'
  2275. 1 0.000004 func! s:FTRules()
  2276. let path = expand('<amatch>:p')
  2277. if path =~ '^/\(etc/udev/\%(rules\.d/\)\=.*\.rules\|lib/udev/\%(rules\.d/\)\=.*\.rules\)$'
  2278. setf udevrules
  2279. return
  2280. endif
  2281. if path =~ '^/etc/ufw/'
  2282. setf conf " Better than hog
  2283. return
  2284. endif
  2285. if path =~ '^/\(etc\|usr/share\)/polkit-1/rules\.d'
  2286. setf javascript
  2287. return
  2288. endif
  2289. try
  2290. let config_lines = readfile('/etc/udev/udev.conf')
  2291. catch /^Vim\%((\a\+)\)\=:E484/
  2292. setf hog
  2293. return
  2294. endtry
  2295. let dir = expand('<amatch>:p:h')
  2296. for line in config_lines
  2297. if line =~ s:ft_rules_udev_rules_pattern
  2298. let udev_rules = substitute(line, s:ft_rules_udev_rules_pattern, '\1', "")
  2299. if dir == udev_rules
  2300. setf udevrules
  2301. endif
  2302. break
  2303. endif
  2304. endfor
  2305. setf hog
  2306. endfunc
  2307.  
  2308.  
  2309. " Spec (Linux RPM)
  2310. 1 0.000018 au BufNewFile,BufRead *.spec setf spec
  2311.  
  2312. " Speedup (AspenTech plant simulator)
  2313. 1 0.000045 au BufNewFile,BufRead *.speedup,*.spdata,*.spd setf spup
  2314.  
  2315. " Slice
  2316. 1 0.000024 au BufNewFile,BufRead *.ice setf slice
  2317.  
  2318. " Spice
  2319. 1 0.000034 au BufNewFile,BufRead *.sp,*.spice setf spice
  2320.  
  2321. " Spyce
  2322. 1 0.000041 au BufNewFile,BufRead *.spy,*.spi setf spyce
  2323.  
  2324. " Squid
  2325. 1 0.000017 au BufNewFile,BufRead squid.conf setf squid
  2326.  
  2327. " SQL for Oracle Designer
  2328. 1 0.000090 au BufNewFile,BufRead *.tyb,*.typ,*.tyc,*.pkb,*.pks setf sql
  2329.  
  2330. " SQL
  2331. 1 0.000021 au BufNewFile,BufRead *.sql call s:SQL()
  2332.  
  2333. 1 0.000006 func! s:SQL()
  2334. if exists("g:filetype_sql")
  2335. exe "setf " . g:filetype_sql
  2336. else
  2337. setf sql
  2338. endif
  2339. endfunc
  2340.  
  2341. " SQLJ
  2342. 1 0.000018 au BufNewFile,BufRead *.sqlj setf sqlj
  2343.  
  2344. " SQR
  2345. 1 0.000034 au BufNewFile,BufRead *.sqr,*.sqi setf sqr
  2346.  
  2347. " OpenSSH configuration
  2348. 1 0.000029 au BufNewFile,BufRead ssh_config,*/.ssh/config setf sshconfig
  2349.  
  2350. " OpenSSH server configuration
  2351. 1 0.000053 au BufNewFile,BufRead sshd_config setf sshdconfig
  2352.  
  2353. " Stata
  2354. 1 0.000077 au BufNewFile,BufRead *.ado,*.class,*.do,*.imata,*.mata setf stata
  2355.  
  2356. " SMCL
  2357. 1 0.000055 au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl setf smcl
  2358.  
  2359. " Stored Procedures
  2360. 1 0.000031 au BufNewFile,BufRead *.stp setf stp
  2361.  
  2362. " Standard ML
  2363. 1 0.000018 au BufNewFile,BufRead *.sml setf sml
  2364.  
  2365. " Sratus VOS command macro
  2366. 1 0.000016 au BufNewFile,BufRead *.cm setf voscm
  2367.  
  2368. " Sysctl
  2369. 1 0.000039 au BufNewFile,BufRead */etc/sysctl.conf,*/etc/sysctl.d/*.conf setf sysctl
  2370.  
  2371. " Systemd unit files
  2372. 1 0.000043 au BufNewFile,BufRead */systemd/*.{automount,mount,path,service,socket,swap,target,timer} setf systemd
  2373.  
  2374. " Synopsys Design Constraints
  2375. 1 0.000018 au BufNewFile,BufRead *.sdc setf sdc
  2376.  
  2377. " Sudoers
  2378. 1 0.000028 au BufNewFile,BufRead */etc/sudoers,sudoers.tmp setf sudoers
  2379.  
  2380. " SVG (Scalable Vector Graphics)
  2381. 1 0.000016 au BufNewFile,BufRead *.svg setf svg
  2382.  
  2383. " If the file has an extension of 't' and is in a directory 't' or 'xt' then
  2384. " it is almost certainly a Perl test file.
  2385. " If the first line starts with '#' and contains 'perl' it's probably a Perl
  2386. " file.
  2387. " (Slow test) If a file contains a 'use' statement then it is almost certainly
  2388. " a Perl file.
  2389. 1 0.000005 func! s:FTperl()
  2390. let dirname = expand("%:p:h:t")
  2391. if expand("%:e") == 't' && (dirname == 't' || dirname == 'xt')
  2392. setf perl
  2393. return 1
  2394. endif
  2395. if getline(1)[0] == '#' && getline(1) =~ 'perl'
  2396. setf perl
  2397. return 1
  2398. endif
  2399. if search('^use\s\s*\k', 'nc', 30)
  2400. setf perl
  2401. return 1
  2402. endif
  2403. return 0
  2404. endfunc
  2405.  
  2406. " Tads (or Nroff or Perl test file)
  2407. 1 0.000016 au BufNewFile,BufRead *.t
  2408. \ if !s:FTnroff() && !s:FTperl() | setf tads | endif
  2409.  
  2410. " Tags
  2411. 1 0.000017 au BufNewFile,BufRead tags setf tags
  2412.  
  2413. " TAK
  2414. 1 0.000017 au BufNewFile,BufRead *.tak setf tak
  2415.  
  2416. " Task
  2417. 1 0.000025 au BufRead,BufNewFile {pending,completed,undo}.data setf taskdata
  2418. 1 0.000015 au BufRead,BufNewFile *.task setf taskedit
  2419.  
  2420. " Tcl (JACL too)
  2421. 1 0.000106 au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl setf tcl
  2422.  
  2423. " TealInfo
  2424. 1 0.000018 au BufNewFile,BufRead *.tli setf tli
  2425.  
  2426. " Telix Salt
  2427. 1 0.000016 au BufNewFile,BufRead *.slt setf tsalt
  2428.  
  2429. " Tera Term Language
  2430. 1 0.000015 au BufRead,BufNewFile *.ttl setf teraterm
  2431.  
  2432. " Terminfo
  2433. 1 0.000015 au BufNewFile,BufRead *.ti setf terminfo
  2434.  
  2435. " TeX
  2436. 1 0.000091 au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl setf tex
  2437. 1 0.000022 au BufNewFile,BufRead *.tex call s:FTtex()
  2438.  
  2439. " Choose context, plaintex, or tex (LaTeX) based on these rules:
  2440. " 1. Check the first line of the file for "%&<format>".
  2441. " 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords.
  2442. " 3. Default to "latex" or to g:tex_flavor, can be set in user's vimrc.
  2443. 1 0.000004 func! s:FTtex()
  2444. let firstline = getline(1)
  2445. if firstline =~ '^%&\s*\a\+'
  2446. let format = tolower(matchstr(firstline, '\a\+'))
  2447. let format = substitute(format, 'pdf', '', '')
  2448. if format == 'tex'
  2449. let format = 'plain'
  2450. endif
  2451. else
  2452. " Default value, may be changed later:
  2453. let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain'
  2454. " Save position, go to the top of the file, find first non-comment line.
  2455. let save_cursor = getpos('.')
  2456. call cursor(1,1)
  2457. let firstNC = search('^\s*[^[:space:]%]', 'c', 1000)
  2458. if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword.
  2459. let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>'
  2460. let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>'
  2461. let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)',
  2462. \ 'cnp', firstNC + 1000)
  2463. if kwline == 1 " lpat matched
  2464. let format = 'latex'
  2465. elseif kwline == 2 " cpat matched
  2466. let format = 'context'
  2467. endif " If neither matched, keep default set above.
  2468. " let lline = search('^\s*\\\%(' . lpat . '\)', 'cn', firstNC + 1000)
  2469. " let cline = search('^\s*\\\%(' . cpat . '\)', 'cn', firstNC + 1000)
  2470. " if cline > 0
  2471. " let format = 'context'
  2472. " endif
  2473. " if lline > 0 && (cline == 0 || cline > lline)
  2474. " let format = 'tex'
  2475. " endif
  2476. endif " firstNC
  2477. call setpos('.', save_cursor)
  2478. endif " firstline =~ '^%&\s*\a\+'
  2479.  
  2480. " Translation from formats to file types. TODO: add AMSTeX, RevTex, others?
  2481. if format == 'plain'
  2482. setf plaintex
  2483. elseif format == 'context'
  2484. setf context
  2485. else " probably LaTeX
  2486. setf tex
  2487. endif
  2488. return
  2489. endfunc
  2490.  
  2491. " ConTeXt
  2492. 1 0.000055 au BufNewFile,BufRead tex/context/*/*.tex,*.mkii,*.mkiv setf context
  2493.  
  2494. " Texinfo
  2495. 1 0.000047 au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo
  2496.  
  2497. " TeX configuration
  2498. 1 0.000032 au BufNewFile,BufRead texmf.cnf setf texmf
  2499.  
  2500. " Tidy config
  2501. 1 0.000034 au BufNewFile,BufRead .tidyrc,tidyrc setf tidy
  2502.  
  2503. " TF mud client
  2504. 1 0.000065 au BufNewFile,BufRead *.tf,.tfrc,tfrc setf tf
  2505.  
  2506. " TPP - Text Presentation Program
  2507. 1 0.000020 au BufNewFile,BufReadPost *.tpp setf tpp
  2508.  
  2509. " Treetop
  2510. 1 0.000016 au BufRead,BufNewFile *.treetop setf treetop
  2511.  
  2512. " Trustees
  2513. 1 0.000015 au BufNewFile,BufRead trustees.conf setf trustees
  2514.  
  2515. " TSS - Geometry
  2516. 1 0.000018 au BufNewFile,BufReadPost *.tssgm setf tssgm
  2517.  
  2518. " TSS - Optics
  2519. 1 0.000014 au BufNewFile,BufReadPost *.tssop setf tssop
  2520.  
  2521. " TSS - Command Line (temporary)
  2522. 1 0.000014 au BufNewFile,BufReadPost *.tsscl setf tsscl
  2523.  
  2524. " Tutor mode
  2525. 1 0.000013 au BufNewFile,BufReadPost *.tutor setf tutor
  2526.  
  2527. " TWIG files
  2528. 1 0.000015 au BufNewFile,BufReadPost *.twig setf twig
  2529.  
  2530. " Motif UIT/UIL files
  2531. 1 0.000042 au BufNewFile,BufRead *.uit,*.uil setf uil
  2532.  
  2533. " Udev conf
  2534. 1 0.000019 au BufNewFile,BufRead */etc/udev/udev.conf setf udevconf
  2535.  
  2536. " Udev permissions
  2537. 1 0.000023 au BufNewFile,BufRead */etc/udev/permissions.d/*.permissions setf udevperm
  2538. "
  2539. " Udev symlinks config
  2540. 1 0.000018 au BufNewFile,BufRead */etc/udev/cdsymlinks.conf setf sh
  2541.  
  2542. " UnrealScript
  2543. 1 0.000015 au BufNewFile,BufRead *.uc setf uc
  2544.  
  2545. " Updatedb
  2546. 1 0.000015 au BufNewFile,BufRead */etc/updatedb.conf setf updatedb
  2547.  
  2548. " Upstart (init(8)) config files
  2549. 1 0.000021 au BufNewFile,BufRead */usr/share/upstart/*.conf setf upstart
  2550. 1 0.000019 au BufNewFile,BufRead */usr/share/upstart/*.override setf upstart
  2551. 1 0.000031 au BufNewFile,BufRead */etc/init/*.conf,*/etc/init/*.override setf upstart
  2552. 1 0.000041 au BufNewFile,BufRead */.init/*.conf,*/.init/*.override setf upstart
  2553. 1 0.000018 au BufNewFile,BufRead */.config/upstart/*.conf setf upstart
  2554. 1 0.000020 au BufNewFile,BufRead */.config/upstart/*.override setf upstart
  2555.  
  2556. " Vera
  2557. 1 0.000052 au BufNewFile,BufRead *.vr,*.vri,*.vrh setf vera
  2558.  
  2559. " Verilog HDL
  2560. 1 0.000013 au BufNewFile,BufRead *.v setf verilog
  2561.  
  2562. " Verilog-AMS HDL
  2563. 1 0.000034 au BufNewFile,BufRead *.va,*.vams setf verilogams
  2564.  
  2565. " SystemVerilog
  2566. 1 0.000036 au BufNewFile,BufRead *.sv,*.svh setf systemverilog
  2567.  
  2568. " VHDL
  2569. 1 0.000100 au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst setf vhdl
  2570. 1 0.000020 au BufNewFile,BufRead *.vhdl_[0-9]* call s:StarSetf('vhdl')
  2571.  
  2572. " Vim script
  2573. 1 0.000085 au BufNewFile,BufRead *.vim,*.vba,.exrc,_exrc setf vim
  2574.  
  2575. " Viminfo file
  2576. 1 0.000034 au BufNewFile,BufRead .viminfo,_viminfo setf viminfo
  2577.  
  2578. " Virata Config Script File or Drupal module
  2579. 1 0.000052 au BufRead,BufNewFile *.hw,*.module,*.pkg
  2580. \ if getline(1) =~ '<?php' |
  2581. \ setf php |
  2582. \ else |
  2583. \ setf virata |
  2584. \ endif
  2585.  
  2586. " Visual Basic (also uses *.bas) or FORM
  2587. 1 0.000020 au BufNewFile,BufRead *.frm call s:FTVB("form")
  2588.  
  2589. " SaxBasic is close to Visual Basic
  2590. 1 0.000023 au BufNewFile,BufRead *.sba setf vb
  2591.  
  2592. " Vgrindefs file
  2593. 1 0.000054 au BufNewFile,BufRead vgrindefs setf vgrindefs
  2594.  
  2595. " VRML V1.0c
  2596. 1 0.000019 au BufNewFile,BufRead *.wrl setf vrml
  2597.  
  2598. " Vroom (vim testing and executable documentation)
  2599. 1 0.000015 au BufNewFile,BufRead *.vroom setf vroom
  2600.  
  2601. " Webmacro
  2602. 1 0.000016 au BufNewFile,BufRead *.wm setf webmacro
  2603.  
  2604. " Wget config
  2605. 1 0.000029 au BufNewFile,BufRead .wgetrc,wgetrc setf wget
  2606.  
  2607. " Website MetaLanguage
  2608. 1 0.000019 au BufNewFile,BufRead *.wml setf wml
  2609.  
  2610. " Winbatch
  2611. 1 0.000017 au BufNewFile,BufRead *.wbt setf winbatch
  2612.  
  2613. " WSML
  2614. 1 0.000039 au BufNewFile,BufRead *.wsml setf wsml
  2615.  
  2616. " WvDial
  2617. 1 0.000030 au BufNewFile,BufRead wvdial.conf,.wvdialrc setf wvdial
  2618.  
  2619. " CVS RC file
  2620. 1 0.000015 au BufNewFile,BufRead .cvsrc setf cvsrc
  2621.  
  2622. " CVS commit file
  2623. 1 0.000021 au BufNewFile,BufRead cvs\d\+ setf cvs
  2624.  
  2625. " WEB (*.web is also used for Winbatch: Guess, based on expecting "%" comment
  2626. " lines in a WEB file).
  2627. 1 0.000025 au BufNewFile,BufRead *.web
  2628. \ if getline(1)[0].getline(2)[0].getline(3)[0].getline(4)[0].getline(5)[0] =~ "%" |
  2629. \ setf web |
  2630. \ else |
  2631. \ setf winbatch |
  2632. \ endif
  2633.  
  2634. " Windows Scripting Host and Windows Script Component
  2635. 1 0.000015 au BufNewFile,BufRead *.ws[fc] setf wsh
  2636.  
  2637. " XHTML
  2638. 1 0.000039 au BufNewFile,BufRead *.xhtml,*.xht setf xhtml
  2639.  
  2640. " X Pixmap (dynamically sets colors, use BufEnter to make it work better)
  2641. 1 0.000008 au BufEnter *.xpm
  2642. \ if getline(1) =~ "XPM2" |
  2643. \ setf xpm2 |
  2644. \ else |
  2645. \ setf xpm |
  2646. \ endif
  2647. 1 0.000004 au BufEnter *.xpm2 setf xpm2
  2648.  
  2649. " XFree86 config
  2650. 1 0.000019 au BufNewFile,BufRead XF86Config
  2651. \ if getline(1) =~ '\<XConfigurator\>' |
  2652. \ let b:xf86conf_xfree86_version = 3 |
  2653. \ endif |
  2654. \ setf xf86conf
  2655. 1 0.000021 au BufNewFile,BufRead */xorg.conf.d/*.conf
  2656. \ let b:xf86conf_xfree86_version = 4 |
  2657. \ setf xf86conf
  2658.  
  2659. " Xorg config
  2660. 1 0.000044 au BufNewFile,BufRead xorg.conf,xorg.conf-4 let b:xf86conf_xfree86_version = 4 | setf xf86conf
  2661.  
  2662. " Xinetd conf
  2663. 1 0.000021 au BufNewFile,BufRead */etc/xinetd.conf setf xinetd
  2664.  
  2665. " XS Perl extension interface language
  2666. 1 0.000017 au BufNewFile,BufRead *.xs setf xs
  2667.  
  2668. " X resources file
  2669. 1 0.000096 au BufNewFile,BufRead .Xdefaults,.Xpdefaults,.Xresources,xdm-config,*.ad setf xdefaults
  2670.  
  2671. " Xmath
  2672. 1 0.000057 au BufNewFile,BufRead *.msc,*.msf setf xmath
  2673. 1 0.000019 au BufNewFile,BufRead *.ms
  2674. \ if !s:FTnroff() | setf xmath | endif
  2675.  
  2676. " XML specific variants: docbk and xbl
  2677. 1 0.000021 au BufNewFile,BufRead *.xml call s:FTxml()
  2678.  
  2679. 1 0.000006 func! s:FTxml()
  2680. let n = 1
  2681. while n < 100 && n < line("$")
  2682. let line = getline(n)
  2683. " DocBook 4 or DocBook 5.
  2684. let is_docbook4 = line =~ '<!DOCTYPE.*DocBook'
  2685. let is_docbook5 = line =~ ' xmlns="http://docbook.org/ns/docbook"'
  2686. if is_docbook4 || is_docbook5
  2687. let b:docbk_type = "xml"
  2688. if is_docbook5
  2689. let b:docbk_ver = 5
  2690. else
  2691. let b:docbk_ver = 4
  2692. endif
  2693. setf docbk
  2694. return
  2695. endif
  2696. if line =~ 'xmlns:xbl="http://www.mozilla.org/xbl"'
  2697. setf xbl
  2698. return
  2699. endif
  2700. let n += 1
  2701. endwhile
  2702. setf xml
  2703. endfunc
  2704.  
  2705. " XMI (holding UML models) is also XML
  2706. 1 0.000022 au BufNewFile,BufRead *.xmi setf xml
  2707.  
  2708. " CSPROJ files are Visual Studio.NET's XML-based project config files
  2709. 1 0.000035 au BufNewFile,BufRead *.csproj,*.csproj.user setf xml
  2710.  
  2711. " Qt Linguist translation source and Qt User Interface Files are XML
  2712. 1 0.000048 au BufNewFile,BufRead *.ts,*.ui setf xml
  2713.  
  2714. " TPM's are RDF-based descriptions of TeX packages (Nikolai Weibull)
  2715. 1 0.000021 au BufNewFile,BufRead *.tpm setf xml
  2716.  
  2717. " Xdg menus
  2718. 1 0.000018 au BufNewFile,BufRead */etc/xdg/menus/*.menu setf xml
  2719.  
  2720. " ATI graphics driver configuration
  2721. 1 0.000016 au BufNewFile,BufRead fglrxrc setf xml
  2722.  
  2723. " XLIFF (XML Localisation Interchange File Format) is also XML
  2724. 1 0.000019 au BufNewFile,BufRead *.xlf setf xml
  2725. 1 0.000015 au BufNewFile,BufRead *.xliff setf xml
  2726.  
  2727. " XML User Interface Language
  2728. 1 0.000021 au BufNewFile,BufRead *.xul setf xml
  2729.  
  2730. " X11 xmodmap (also see below)
  2731. 1 0.000015 au BufNewFile,BufRead *Xmodmap setf xmodmap
  2732.  
  2733. " Xquery
  2734. 1 0.000084 au BufNewFile,BufRead *.xq,*.xql,*.xqm,*.xquery,*.xqy setf xquery
  2735.  
  2736. " XSD
  2737. 1 0.000021 au BufNewFile,BufRead *.xsd setf xsd
  2738.  
  2739. " Xslt
  2740. 1 0.000033 au BufNewFile,BufRead *.xsl,*.xslt setf xslt
  2741.  
  2742. " Yacc
  2743. 1 0.000053 au BufNewFile,BufRead *.yy,*.yxx,*.y++ setf yacc
  2744.  
  2745. " Yacc or racc
  2746. 1 0.000015 au BufNewFile,BufRead *.y call s:FTy()
  2747.  
  2748. 1 0.000004 func! s:FTy()
  2749. let n = 1
  2750. while n < 100 && n < line("$")
  2751. let line = getline(n)
  2752. if line =~ '^\s*%'
  2753. setf yacc
  2754. return
  2755. endif
  2756. if getline(n) =~ '^\s*\(#\|class\>\)' && getline(n) !~ '^\s*#\s*include'
  2757. setf racc
  2758. return
  2759. endif
  2760. let n = n + 1
  2761. endwhile
  2762. setf yacc
  2763. endfunc
  2764.  
  2765.  
  2766. " Yaml
  2767. 1 0.000046 au BufNewFile,BufRead *.yaml,*.yml setf yaml
  2768.  
  2769. " yum conf (close enough to dosini)
  2770. 1 0.000017 au BufNewFile,BufRead */etc/yum.conf setf dosini
  2771.  
  2772. " Zimbu
  2773. 1 0.000017 au BufNewFile,BufRead *.zu setf zimbu
  2774. " Zimbu Templates
  2775. 1 0.000020 au BufNewFile,BufRead *.zut setf zimbutempl
  2776.  
  2777. " Zope
  2778. " dtml (zope dynamic template markup language), pt (zope page template),
  2779. " cpt (zope form controller page template)
  2780. 1 0.000070 au BufNewFile,BufRead *.dtml,*.pt,*.cpt call s:FThtml()
  2781. " zsql (zope sql method)
  2782. 1 0.000019 au BufNewFile,BufRead *.zsql call s:SQL()
  2783.  
  2784. " Z80 assembler asz80
  2785. 1 0.000020 au BufNewFile,BufRead *.z8a setf z8a
  2786.  
  2787. 1 0.000003 augroup END
  2788.  
  2789.  
  2790. " Source the user-specified filetype file, for backwards compatibility with
  2791. " Vim 5.x.
  2792. 1 0.000012 if exists("myfiletypefile") && filereadable(expand(myfiletypefile))
  2793. execute "source " . myfiletypefile
  2794. endif
  2795.  
  2796.  
  2797. " Check for "*" after loading myfiletypefile, so that scripts.vim is only used
  2798. " when there are no matching file name extensions.
  2799. " Don't do this for compressed files.
  2800. 1 0.000001 augroup filetypedetect
  2801. 1 0.000020 au BufNewFile,BufRead *
  2802. \ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
  2803. \ | runtime! scripts.vim | endif
  2804. 1 0.000004 au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif
  2805.  
  2806.  
  2807. " Extra checks for when no filetype has been detected now. Mostly used for
  2808. " patterns that end in "*". E.g., "zsh*" matches "zsh.vim", but that's a Vim
  2809. " script file.
  2810. " Most of these should call s:StarSetf() to avoid names ending in .gz and the
  2811. " like are used.
  2812.  
  2813. " More Apache config files
  2814. 1 0.000083 au BufNewFile,BufRead access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf* call s:StarSetf('apache')
  2815. 1 0.000098 au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.d/*.conf* call s:StarSetf('apache')
  2816.  
  2817. " Asterisk config file
  2818. 1 0.000024 au BufNewFile,BufRead *asterisk/*.conf* call s:StarSetf('asterisk')
  2819. 1 0.000032 au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm')
  2820.  
  2821. " Bazaar version control
  2822. 1 0.000018 au BufNewFile,BufRead bzr_log.* setf bzr
  2823.  
  2824. " BIND zone
  2825. 1 0.000031 au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone')
  2826.  
  2827. " Calendar
  2828. 1 0.000072 au BufNewFile,BufRead */.calendar/*,
  2829. \*/share/calendar/*/calendar.*,*/share/calendar/calendar.*
  2830. \ call s:StarSetf('calendar')
  2831.  
  2832. " Changelog
  2833. 1 0.000028 au BufNewFile,BufRead [cC]hange[lL]og*
  2834. \ if getline(1) =~ '; urgency='
  2835. \| call s:StarSetf('debchangelog')
  2836. \|else
  2837. \| call s:StarSetf('changelog')
  2838. \|endif
  2839.  
  2840. " Crontab
  2841. 1 0.000049 au BufNewFile,BufRead crontab,crontab.*,*/etc/cron.d/* call s:StarSetf('crontab')
  2842.  
  2843. " dnsmasq(8) configuration
  2844. 1 0.000017 au BufNewFile,BufRead */etc/dnsmasq.d/* call s:StarSetf('dnsmasq')
  2845.  
  2846. " Dracula
  2847. 1 0.000017 au BufNewFile,BufRead drac.* call s:StarSetf('dracula')
  2848.  
  2849. " Fvwm
  2850. 1 0.000017 au BufNewFile,BufRead */.fvwm/* call s:StarSetf('fvwm')
  2851. 1 0.000032 au BufNewFile,BufRead *fvwmrc*,*fvwm95*.hook
  2852. \ let b:fvwm_version = 1 | call s:StarSetf('fvwm')
  2853. 1 0.000020 au BufNewFile,BufRead *fvwm2rc*
  2854. \ if expand("<afile>:e") == "m4"
  2855. \| call s:StarSetf('fvwm2m4')
  2856. \|else
  2857. \| let b:fvwm_version = 2 | call s:StarSetf('fvwm')
  2858. \|endif
  2859.  
  2860. " Gedcom
  2861. 1 0.000016 au BufNewFile,BufRead */tmp/lltmp* call s:StarSetf('gedcom')
  2862.  
  2863. " GTK RC
  2864. 1 0.000035 au BufNewFile,BufRead .gtkrc*,gtkrc* call s:StarSetf('gtkrc')
  2865.  
  2866. " Jam
  2867. 1 0.000034 au BufNewFile,BufRead Prl*.*,JAM*.* call s:StarSetf('jam')
  2868.  
  2869. " Jargon
  2870. 1 0.000021 au! BufNewFile,BufRead *jarg*
  2871. \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'THIS IS THE JARGON FILE'
  2872. \| call s:StarSetf('jargon')
  2873. \|endif
  2874.  
  2875. " Kconfig
  2876. 1 0.000019 au BufNewFile,BufRead Kconfig.* call s:StarSetf('kconfig')
  2877.  
  2878. " Lilo: Linux loader
  2879. 1 0.000017 au BufNewFile,BufRead lilo.conf* call s:StarSetf('lilo')
  2880.  
  2881. " Logcheck
  2882. 1 0.000017 au BufNewFile,BufRead */etc/logcheck/*.d*/* call s:StarSetf('logcheck')
  2883.  
  2884. " Makefile
  2885. 1 0.000016 au BufNewFile,BufRead [mM]akefile* call s:StarSetf('make')
  2886.  
  2887. " Ruby Makefile
  2888. 1 0.000016 au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby')
  2889.  
  2890. " Mail (also matches muttrc.vim, so this is below the other checks)
  2891. 1 0.000027 au BufNewFile,BufRead mutt[[:alnum:]._-]\\\{6\} setf mail
  2892.  
  2893. 1 0.000017 au BufNewFile,BufRead reportbug-* call s:StarSetf('mail')
  2894.  
  2895. " Modconf
  2896. 1 0.000018 au BufNewFile,BufRead */etc/modutils/*
  2897. \ if executable(expand("<afile>")) != 1
  2898. \| call s:StarSetf('modconf')
  2899. \|endif
  2900. 1 0.000017 au BufNewFile,BufRead */etc/modprobe.* call s:StarSetf('modconf')
  2901.  
  2902. " Mutt setup file
  2903. 1 0.000041 au BufNewFile,BufRead .mutt{ng,}rc*,*/.mutt{ng,}/mutt{ng,}rc* call s:StarSetf('muttrc')
  2904. 1 0.000031 au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc* call s:StarSetf('muttrc')
  2905.  
  2906. " Nroff macros
  2907. 1 0.000018 au BufNewFile,BufRead tmac.* call s:StarSetf('nroff')
  2908.  
  2909. " Pam conf
  2910. 1 0.000020 au BufNewFile,BufRead */etc/pam.d/* call s:StarSetf('pamconf')
  2911.  
  2912. " Printcap and Termcap
  2913. 1 0.000019 au BufNewFile,BufRead *printcap*
  2914. \ if !did_filetype()
  2915. \| let b:ptcap_type = "print" | call s:StarSetf('ptcap')
  2916. \|endif
  2917. 1 0.000019 au BufNewFile,BufRead *termcap*
  2918. \ if !did_filetype()
  2919. \| let b:ptcap_type = "term" | call s:StarSetf('ptcap')
  2920. \|endif
  2921.  
  2922. " ReDIF
  2923. " Only used when the .rdf file was not detected to be XML.
  2924. 1 0.000024 au BufRead,BufNewFile *.rdf call s:Redif()
  2925. 1 0.000005 func! s:Redif()
  2926. let lnum = 1
  2927. while lnum <= 5 && lnum < line('$')
  2928. if getline(lnum) =~ "^\ctemplate-type:"
  2929. setf redif
  2930. return
  2931. endif
  2932. let lnum = lnum + 1
  2933. endwhile
  2934. endfunc
  2935.  
  2936. " Remind
  2937. 1 0.000019 au BufNewFile,BufRead .reminders* call s:StarSetf('remind')
  2938.  
  2939. " Vim script
  2940. 1 0.000019 au BufNewFile,BufRead *vimrc* call s:StarSetf('vim')
  2941.  
  2942. " Subversion commit file
  2943. 1 0.000021 au BufNewFile,BufRead svn-commit*.tmp setf svn
  2944.  
  2945. " X resources file
  2946. 1 0.000048 au BufNewFile,BufRead Xresources*,*/app-defaults/*,*/Xresources/* call s:StarSetf('xdefaults')
  2947.  
  2948. " XFree86 config
  2949. 1 0.000021 au BufNewFile,BufRead XF86Config-4*
  2950. \ let b:xf86conf_xfree86_version = 4 | call s:StarSetf('xf86conf')
  2951. 1 0.000026 au BufNewFile,BufRead XF86Config*
  2952. \ if getline(1) =~ '\<XConfigurator\>'
  2953. \| let b:xf86conf_xfree86_version = 3
  2954. \|endif
  2955. \|call s:StarSetf('xf86conf')
  2956.  
  2957. " X11 xmodmap
  2958. 1 0.000017 au BufNewFile,BufRead *xmodmap* call s:StarSetf('xmodmap')
  2959.  
  2960. " Xinetd conf
  2961. 1 0.000022 au BufNewFile,BufRead */etc/xinetd.d/* call s:StarSetf('xinetd')
  2962.  
  2963. " yum conf (close enough to dosini)
  2964. 1 0.000022 au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
  2965.  
  2966. " Z-Shell script
  2967. 1 0.000056 au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh')
  2968.  
  2969.  
  2970. " Plain text files, needs to be far down to not override others. This avoids
  2971. " the "conf" type being used if there is a line starting with '#'.
  2972. 1 0.000057 au BufNewFile,BufRead *.txt,*.text,README setf text
  2973.  
  2974.  
  2975. " Use the filetype detect plugins. They may overrule any of the previously
  2976. " detected filetypes.
  2977. 1 0.000130 runtime! ftdetect/*.vim
  2978.  
  2979. " NOTE: The above command could have ended the filetypedetect autocmd group
  2980. " and started another one. Let's make sure it has ended to get to a consistent
  2981. " state.
  2982. 1 0.000002 augroup END
  2983.  
  2984. " Generic configuration file (check this last, it's just guessing!)
  2985. 1 0.000025 au filetypedetect BufNewFile,BufRead,StdinReadPost *
  2986. \ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
  2987. \ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
  2988. \ || getline(4) =~ '^#' || getline(5) =~ '^#') |
  2989. \ setf conf |
  2990. \ endif
  2991.  
  2992.  
  2993. " If the GUI is already running, may still need to install the Syntax menu.
  2994. " Don't do it when the 'M' flag is included in 'guioptions'.
  2995. 1 0.000017 if has("menu") && has("gui_running")
  2996. \ && !exists("did_install_syntax_menu") && &guioptions !~# "M"
  2997. source <sfile>:p:h/menu.vim
  2998. endif
  2999.  
  3000. " Function called for testing all functions defined here. These are
  3001. " script-local, thus need to be executed here.
  3002. " Returns a string with error messages (hopefully empty).
  3003. 1 0.000003 func! TestFiletypeFuncs(testlist)
  3004. let output = ''
  3005. for f in a:testlist
  3006. try
  3007. exe f
  3008. catch
  3009. let output = output . "\n" . f . ": " . v:exception
  3010. endtry
  3011. endfor
  3012. return output
  3013. endfunc
  3014.  
  3015. " Restore 'cpoptions'
  3016. 1 0.000022 let &cpo = s:cpo_save
  3017. 1 0.000004 unlet s:cpo_save
  3018.  
  3019. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/ftplugin.vim
  3020. Sourced 1 time
  3021. Total time: 0.000051
  3022. Self time: 0.000051
  3023.  
  3024. count total (s) self (s)
  3025. " Vim support file to switch on loading plugins for file types
  3026. "
  3027. " Maintainer: Bram Moolenaar <Bram@vim.org>
  3028. " Last change: 2006 Apr 30
  3029.  
  3030. 1 0.000006 if exists("did_load_ftplugin")
  3031. finish
  3032. endif
  3033. 1 0.000003 let did_load_ftplugin = 1
  3034.  
  3035. 1 0.000003 augroup filetypeplugin
  3036. 1 0.000005 au FileType * call s:LoadFTPlugin()
  3037.  
  3038. 1 0.000004 func! s:LoadFTPlugin()
  3039. if exists("b:undo_ftplugin")
  3040. exe b:undo_ftplugin
  3041. unlet! b:undo_ftplugin b:did_ftplugin
  3042. endif
  3043.  
  3044. let s = expand("<amatch>")
  3045. if s != ""
  3046. if &cpo =~# "S" && exists("b:did_ftplugin")
  3047. " In compatible mode options are reset to the global values, need to
  3048. " set the local values also when a plugin was already used.
  3049. unlet b:did_ftplugin
  3050. endif
  3051.  
  3052. " When there is a dot it is used to separate filetype names. Thus for
  3053. " "aaa.bbb" load "aaa" and then "bbb".
  3054. for name in split(s, '\.')
  3055. exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim'
  3056. endfor
  3057. endif
  3058. endfunc
  3059. 1 0.000002 augroup END
  3060.  
  3061. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/indent.vim
  3062. Sourced 1 time
  3063. Total time: 0.000051
  3064. Self time: 0.000051
  3065.  
  3066. count total (s) self (s)
  3067. " Vim support file to switch on loading indent files for file types
  3068. "
  3069. " Maintainer: Bram Moolenaar <Bram@vim.org>
  3070. " Last Change: 2008 Feb 22
  3071.  
  3072. 1 0.000008 if exists("did_indent_on")
  3073. finish
  3074. endif
  3075. 1 0.000004 let did_indent_on = 1
  3076.  
  3077. 1 0.000002 augroup filetypeindent
  3078. 1 0.000005 au FileType * call s:LoadIndent()
  3079. 1 0.000004 func! s:LoadIndent()
  3080. if exists("b:undo_indent")
  3081. exe b:undo_indent
  3082. unlet! b:undo_indent b:did_indent
  3083. endif
  3084. let s = expand("<amatch>")
  3085. if s != ""
  3086. if exists("b:did_indent")
  3087. unlet b:did_indent
  3088. endif
  3089.  
  3090. " When there is a dot it is used to separate filetype names. Thus for
  3091. " "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim".
  3092. for name in split(s, '\.')
  3093. exe 'runtime! indent/' . name . '.vim'
  3094. endfor
  3095. endif
  3096. endfunc
  3097. 1 0.000002 augroup END
  3098.  
  3099. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/gui_shim.vim
  3100. Sourced 1 time
  3101. Total time: 0.000015
  3102. Self time: 0.000015
  3103.  
  3104. count total (s) self (s)
  3105. " A Neovim plugin that implements GUI helper commands
  3106. 1 0.000010 if !has('win32') || !has('nvim') || exists('g:GuiLoaded')
  3107. 1 0.000002 finish
  3108.  
  3109. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/gzip.vim
  3110. Sourced 1 time
  3111. Total time: 0.000201
  3112. Self time: 0.000201
  3113.  
  3114. count total (s) self (s)
  3115. " Vim plugin for editing compressed files.
  3116. " Maintainer: Bram Moolenaar <Bram@vim.org>
  3117. " Last Change: 2010 Mar 10
  3118.  
  3119. " Exit quickly when:
  3120. " - this plugin was already loaded
  3121. " - when 'compatible' is set
  3122. " - some autocommands are already taking care of compressed files
  3123. 1 0.000015 if exists("loaded_gzip") || &cp || exists("#BufReadPre#*.gz")
  3124. finish
  3125. endif
  3126. 1 0.000004 let loaded_gzip = 1
  3127.  
  3128. 1 0.000002 augroup gzip
  3129. " Remove all gzip autocommands
  3130. 1 0.000020 au!
  3131.  
  3132. " Enable editing of gzipped files.
  3133. " The functions are defined in autoload/gzip.vim.
  3134. "
  3135. " Set binary mode before reading the file.
  3136. " Use "gzip -d", gunzip isn't always available.
  3137. 1 0.000021 autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z,*.lzma,*.xz setlocal bin
  3138. 1 0.000011 autocmd BufReadPost,FileReadPost *.gz call gzip#read("gzip -dn")
  3139. 1 0.000011 autocmd BufReadPost,FileReadPost *.bz2 call gzip#read("bzip2 -d")
  3140. 1 0.000017 autocmd BufReadPost,FileReadPost *.Z call gzip#read("uncompress")
  3141. 1 0.000011 autocmd BufReadPost,FileReadPost *.lzma call gzip#read("lzma -d")
  3142. 1 0.000009 autocmd BufReadPost,FileReadPost *.xz call gzip#read("xz -d")
  3143. 1 0.000004 autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip")
  3144. 1 0.000004 autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2")
  3145. 1 0.000006 autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f")
  3146. 1 0.000004 autocmd BufWritePost,FileWritePost *.lzma call gzip#write("lzma -z")
  3147. 1 0.000005 autocmd BufWritePost,FileWritePost *.xz call gzip#write("xz -z")
  3148. 1 0.000003 autocmd FileAppendPre *.gz call gzip#appre("gzip -dn")
  3149. 1 0.000003 autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d")
  3150. 1 0.000004 autocmd FileAppendPre *.Z call gzip#appre("uncompress")
  3151. 1 0.000003 autocmd FileAppendPre *.lzma call gzip#appre("lzma -d")
  3152. 1 0.000005 autocmd FileAppendPre *.xz call gzip#appre("xz -d")
  3153. 1 0.000003 autocmd FileAppendPost *.gz call gzip#write("gzip")
  3154. 1 0.000004 autocmd FileAppendPost *.bz2 call gzip#write("bzip2")
  3155. 1 0.000003 autocmd FileAppendPost *.Z call gzip#write("compress -f")
  3156. 1 0.000003 autocmd FileAppendPost *.lzma call gzip#write("lzma -z")
  3157. 1 0.000004 autocmd FileAppendPost *.xz call gzip#write("xz -z")
  3158. 1 0.000002 augroup END
  3159.  
  3160. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/health.vim
  3161. Sourced 1 time
  3162. Total time: 0.000023
  3163. Self time: 0.000023
  3164.  
  3165. count total (s) self (s)
  3166. function! s:complete(lead, _line, _pos) abort
  3167. return sort(filter(map(globpath(&runtimepath, 'autoload/health/*', 1, 1),
  3168. \ 'fnamemodify(v:val, ":t:r")'),
  3169. \ 'empty(a:lead) || v:val[:strlen(a:lead)-1] ==# a:lead'))
  3170. endfunction
  3171.  
  3172. 1 0.000010 command! -nargs=* -complete=customlist,s:complete CheckHealth
  3173.  
  3174. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/man.vim
  3175. Sourced 1 time
  3176. Total time: 0.000075
  3177. Self time: 0.000075
  3178.  
  3179. count total (s) self (s)
  3180. " Maintainer: Anmol Sethi <anmol@aubble.com>
  3181.  
  3182. 1 0.000006 if exists('g:loaded_man')
  3183. finish
  3184. endif
  3185. 1 0.000010 let g:loaded_man = 1
  3186.  
  3187. 1 0.000015 command! -range=0 -complete=customlist,man#complete -nargs=* Man call man#open_page(v:count, v:count1, <q-mods>, <f-args>)
  3188.  
  3189. 1 0.000003 augroup man
  3190. 1 0.000020 autocmd!
  3191. 1 0.000009 autocmd BufReadCmd man://* call man#read_page(matchstr(expand('<amatch>'), 'man://\zs.*'))
  3192. 1 0.000003 augroup END
  3193.  
  3194. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/matchit.vim
  3195. Sourced 1 time
  3196. Total time: 0.000895
  3197. Self time: 0.000895
  3198.  
  3199. count total (s) self (s)
  3200. " matchit.vim: (global plugin) Extended "%" matching
  3201. " Last Change: Fri Jul 29 01:20 AM 2016 EST
  3202. " Maintainer: Benji Fisher PhD <benji@member.AMS.org>
  3203. " Version: 1.13.2, for Vim 6.3+
  3204. " Fix from Tommy Allen included.
  3205. " URL: http://www.vim.org/script.php?script_id=39
  3206.  
  3207. " Documentation:
  3208. " The documentation is in a separate file, matchit.txt .
  3209.  
  3210. " Credits:
  3211. " Vim editor by Bram Moolenaar (Thanks, Bram!)
  3212. " Original script and design by Raul Segura Acevedo
  3213. " Support for comments by Douglas Potts
  3214. " Support for back references and other improvements by Benji Fisher
  3215. " Support for many languages by Johannes Zellner
  3216. " Suggestions for improvement, bug reports, and support for additional
  3217. " languages by Jordi-Albert Batalla, Neil Bird, Servatius Brandt, Mark
  3218. " Collett, Stephen Wall, Dany St-Amant, Yuheng Xie, and Johannes Zellner.
  3219.  
  3220. " Debugging:
  3221. " If you'd like to try the built-in debugging commands...
  3222. " :MatchDebug to activate debugging for the current buffer
  3223. " This saves the values of several key script variables as buffer-local
  3224. " variables. See the MatchDebug() function, below, for details.
  3225.  
  3226. " TODO: I should think about multi-line patterns for b:match_words.
  3227. " This would require an option: how many lines to scan (default 1).
  3228. " This would be useful for Python, maybe also for *ML.
  3229. " TODO: Maybe I should add a menu so that people will actually use some of
  3230. " the features that I have implemented.
  3231. " TODO: Eliminate the MultiMatch function. Add yet another argument to
  3232. " Match_wrapper() instead.
  3233. " TODO: Allow :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1'
  3234. " TODO: Make backrefs safer by using '\V' (very no-magic).
  3235. " TODO: Add a level of indirection, so that custom % scripts can use my
  3236. " work but extend it.
  3237.  
  3238. " allow user to prevent loading
  3239. " and prevent duplicate loading
  3240. 1 0.000015 if exists("loaded_matchit") || &cp
  3241. finish
  3242. endif
  3243. 1 0.000003 let loaded_matchit = 1
  3244. 1 0.000002 let s:last_mps = ""
  3245. 1 0.000002 let s:last_words = ":"
  3246.  
  3247. 1 0.000006 let s:save_cpo = &cpo
  3248. 1 0.000012 set cpo&vim
  3249.  
  3250. 1 0.000033 nnoremap <silent> % :<C-U>call <SID>Match_wrapper('',1,'n') <CR>
  3251. 1 0.000058 nnoremap <silent> g% :<C-U>call <SID>Match_wrapper('',0,'n') <CR>
  3252. 1 0.000009 vnoremap <silent> % :<C-U>call <SID>Match_wrapper('',1,'v') <CR>m'gv``
  3253. 1 0.000005 vnoremap <silent> g% :<C-U>call <SID>Match_wrapper('',0,'v') <CR>m'gv``
  3254. 1 0.000005 onoremap <silent> % v:<C-U>call <SID>Match_wrapper('',1,'o') <CR>
  3255. 1 0.000005 onoremap <silent> g% v:<C-U>call <SID>Match_wrapper('',0,'o') <CR>
  3256.  
  3257. " Analogues of [{ and ]} using matching patterns:
  3258. 1 0.000005 nnoremap <silent> [% :<C-U>call <SID>MultiMatch("bW", "n") <CR>
  3259. 1 0.000007 nnoremap <silent> ]% :<C-U>call <SID>MultiMatch("W", "n") <CR>
  3260. 1 0.000004 vmap [% <Esc>[%m'gv``
  3261. 1 0.000003 vmap ]% <Esc>]%m'gv``
  3262. " vnoremap <silent> [% :<C-U>call <SID>MultiMatch("bW", "v") <CR>m'gv``
  3263. " vnoremap <silent> ]% :<C-U>call <SID>MultiMatch("W", "v") <CR>m'gv``
  3264. 1 0.000005 onoremap <silent> [% v:<C-U>call <SID>MultiMatch("bW", "o") <CR>
  3265. 1 0.000004 onoremap <silent> ]% v:<C-U>call <SID>MultiMatch("W", "o") <CR>
  3266.  
  3267. " text object:
  3268. 1 0.000003 vmap a% <Esc>[%v]%
  3269.  
  3270. " Auto-complete mappings: (not yet "ready for prime time")
  3271. " TODO Read :help write-plugin for the "right" way to let the user
  3272. " specify a key binding.
  3273. " let g:match_auto = '<C-]>'
  3274. " let g:match_autoCR = '<C-CR>'
  3275. " if exists("g:match_auto")
  3276. " execute "inoremap " . g:match_auto . ' x<Esc>"=<SID>Autocomplete()<CR>Pls'
  3277. " endif
  3278. " if exists("g:match_autoCR")
  3279. " execute "inoremap " . g:match_autoCR . ' <CR><C-R>=<SID>Autocomplete()<CR>'
  3280. " endif
  3281. " if exists("g:match_gthhoh")
  3282. " execute "inoremap " . g:match_gthhoh . ' <C-O>:call <SID>Gthhoh()<CR>'
  3283. " endif " gthhoh = "Get the heck out of here!"
  3284.  
  3285. 1 0.000004 let s:notslash = '\\\@<!\%(\\\\\)*'
  3286.  
  3287. 1 0.000004 function! s:Match_wrapper(word, forward, mode) range
  3288. " In s:CleanUp(), :execute "set" restore_options .
  3289. let restore_options = (&ic ? " " : " no") . "ignorecase"
  3290. if exists("b:match_ignorecase")
  3291. let &ignorecase = b:match_ignorecase
  3292. endif
  3293. let restore_options = " ve=" . &ve . restore_options
  3294. set ve=
  3295. " If this function was called from Visual mode, make sure that the cursor
  3296. " is at the correct end of the Visual range:
  3297. if a:mode == "v"
  3298. execute "normal! gv\<Esc>"
  3299. endif
  3300. " In s:CleanUp(), we may need to check whether the cursor moved forward.
  3301. let startline = line(".")
  3302. let startcol = col(".")
  3303. " Use default behavior if called with a count.
  3304. if v:count
  3305. exe "normal! " . v:count . "%"
  3306. return s:CleanUp(restore_options, a:mode, startline, startcol)
  3307. end
  3308.  
  3309. " First step: if not already done, set the script variables
  3310. " s:do_BR flag for whether there are backrefs
  3311. " s:pat parsed version of b:match_words
  3312. " s:all regexp based on s:pat and the default groups
  3313. "
  3314. if !exists("b:match_words") || b:match_words == ""
  3315. let match_words = ""
  3316. " Allow b:match_words = "GetVimMatchWords()" .
  3317. elseif b:match_words =~ ":"
  3318. let match_words = b:match_words
  3319. else
  3320. execute "let match_words =" b:match_words
  3321. endif
  3322. " Thanks to Preben "Peppe" Guldberg and Bram Moolenaar for this suggestion!
  3323. if (match_words != s:last_words) || (&mps != s:last_mps) ||
  3324. \ exists("b:match_debug")
  3325. let s:last_mps = &mps
  3326. " The next several lines were here before
  3327. " BF started messing with this script.
  3328. " quote the special chars in 'matchpairs', replace [,:] with \| and then
  3329. " append the builtin pairs (/*, */, #if, #ifdef, #else, #elif, #endif)
  3330. " let default = substitute(escape(&mps, '[$^.*~\\/?]'), '[,:]\+',
  3331. " \ '\\|', 'g').'\|\/\*\|\*\/\|#if\>\|#ifdef\>\|#else\>\|#elif\>\|#endif\>'
  3332. let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") .
  3333. \ '\/\*:\*\/,#\s*if\%(def\)\=:#\s*else\>:#\s*elif\>:#\s*endif\>'
  3334. " s:all = pattern with all the keywords
  3335. let match_words = match_words . (strlen(match_words) ? "," : "") . default
  3336. let s:last_words = match_words
  3337. if match_words !~ s:notslash . '\\\d'
  3338. let s:do_BR = 0
  3339. let s:pat = match_words
  3340. else
  3341. let s:do_BR = 1
  3342. let s:pat = s:ParseWords(match_words)
  3343. endif
  3344. let s:all = substitute(s:pat, s:notslash . '\zs[,:]\+', '\\|', 'g')
  3345. let s:all = '\%(' . s:all . '\)'
  3346. " let s:all = '\%(' . substitute(s:all, '\\\ze[,:]', '', 'g') . '\)'
  3347. if exists("b:match_debug")
  3348. let b:match_pat = s:pat
  3349. endif
  3350. endif
  3351.  
  3352. " Second step: set the following local variables:
  3353. " matchline = line on which the cursor started
  3354. " curcol = number of characters before match
  3355. " prefix = regexp for start of line to start of match
  3356. " suffix = regexp for end of match to end of line
  3357. " Require match to end on or after the cursor and prefer it to
  3358. " start on or before the cursor.
  3359. let matchline = getline(startline)
  3360. if a:word != ''
  3361. " word given
  3362. if a:word !~ s:all
  3363. echohl WarningMsg|echo 'Missing rule for word:"'.a:word.'"'|echohl NONE
  3364. return s:CleanUp(restore_options, a:mode, startline, startcol)
  3365. endif
  3366. let matchline = a:word
  3367. let curcol = 0
  3368. let prefix = '^\%('
  3369. let suffix = '\)$'
  3370. " Now the case when "word" is not given
  3371. else " Find the match that ends on or after the cursor and set curcol.
  3372. let regexp = s:Wholematch(matchline, s:all, startcol-1)
  3373. let curcol = match(matchline, regexp)
  3374. " If there is no match, give up.
  3375. if curcol == -1
  3376. return s:CleanUp(restore_options, a:mode, startline, startcol)
  3377. endif
  3378. let endcol = matchend(matchline, regexp)
  3379. let suf = strlen(matchline) - endcol
  3380. let prefix = (curcol ? '^.*\%' . (curcol + 1) . 'c\%(' : '^\%(')
  3381. let suffix = (suf ? '\)\%' . (endcol + 1) . 'c.*$' : '\)$')
  3382. endif
  3383. if exists("b:match_debug")
  3384. let b:match_match = matchstr(matchline, regexp)
  3385. let b:match_col = curcol+1
  3386. endif
  3387.  
  3388. " Third step: Find the group and single word that match, and the original
  3389. " (backref) versions of these. Then, resolve the backrefs.
  3390. " Set the following local variable:
  3391. " group = colon-separated list of patterns, one of which matches
  3392. " = ini:mid:fin or ini:fin
  3393. "
  3394. " Reconstruct the version with unresolved backrefs.
  3395. let patBR = substitute(match_words.',',
  3396. \ s:notslash.'\zs[,:]*,[,:]*', ',', 'g')
  3397. let patBR = substitute(patBR, s:notslash.'\zs:\{2,}', ':', 'g')
  3398. " Now, set group and groupBR to the matching group: 'if:endif' or
  3399. " 'while:endwhile' or whatever. A bit of a kluge: s:Choose() returns
  3400. " group . "," . groupBR, and we pick it apart.
  3401. let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR)
  3402. let i = matchend(group, s:notslash . ",")
  3403. let groupBR = strpart(group, i)
  3404. let group = strpart(group, 0, i-1)
  3405. " Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix
  3406. if s:do_BR " Do the hard part: resolve those backrefs!
  3407. let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline)
  3408. endif
  3409. if exists("b:match_debug")
  3410. let b:match_wholeBR = groupBR
  3411. let i = matchend(groupBR, s:notslash . ":")
  3412. let b:match_iniBR = strpart(groupBR, 0, i-1)
  3413. endif
  3414.  
  3415. " Fourth step: Set the arguments for searchpair().
  3416. let i = matchend(group, s:notslash . ":")
  3417. let j = matchend(group, '.*' . s:notslash . ":")
  3418. let ini = strpart(group, 0, i-1)
  3419. let mid = substitute(strpart(group, i,j-i-1), s:notslash.'\zs:', '\\|', 'g')
  3420. let fin = strpart(group, j)
  3421. "Un-escape the remaining , and : characters.
  3422. let ini = substitute(ini, s:notslash . '\zs\\\(:\|,\)', '\1', 'g')
  3423. let mid = substitute(mid, s:notslash . '\zs\\\(:\|,\)', '\1', 'g')
  3424. let fin = substitute(fin, s:notslash . '\zs\\\(:\|,\)', '\1', 'g')
  3425. " searchpair() requires that these patterns avoid \(\) groups.
  3426. let ini = substitute(ini, s:notslash . '\zs\\(', '\\%(', 'g')
  3427. let mid = substitute(mid, s:notslash . '\zs\\(', '\\%(', 'g')
  3428. let fin = substitute(fin, s:notslash . '\zs\\(', '\\%(', 'g')
  3429. " Set mid. This is optimized for readability, not micro-efficiency!
  3430. if a:forward && matchline =~ prefix . fin . suffix
  3431. \ || !a:forward && matchline =~ prefix . ini . suffix
  3432. let mid = ""
  3433. endif
  3434. " Set flag. This is optimized for readability, not micro-efficiency!
  3435. if a:forward && matchline =~ prefix . fin . suffix
  3436. \ || !a:forward && matchline !~ prefix . ini . suffix
  3437. let flag = "bW"
  3438. else
  3439. let flag = "W"
  3440. endif
  3441. " Set skip.
  3442. if exists("b:match_skip")
  3443. let skip = b:match_skip
  3444. elseif exists("b:match_comment") " backwards compatibility and testing!
  3445. let skip = "r:" . b:match_comment
  3446. else
  3447. let skip = 's:comment\|string'
  3448. endif
  3449. let skip = s:ParseSkip(skip)
  3450. if exists("b:match_debug")
  3451. let b:match_ini = ini
  3452. let b:match_tail = (strlen(mid) ? mid.'\|' : '') . fin
  3453. endif
  3454.  
  3455. " Fifth step: actually start moving the cursor and call searchpair().
  3456. " Later, :execute restore_cursor to get to the original screen.
  3457. let view = winsaveview()
  3458. call cursor(0, curcol + 1)
  3459. " normal! 0
  3460. " if curcol
  3461. " execute "normal!" . curcol . "l"
  3462. " endif
  3463. if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on"))
  3464. let skip = "0"
  3465. else
  3466. execute "if " . skip . "| let skip = '0' | endif"
  3467. endif
  3468. let sp_return = searchpair(ini, mid, fin, flag, skip)
  3469. let final_position = "call cursor(" . line(".") . "," . col(".") . ")"
  3470. " Restore cursor position and original screen.
  3471. call winrestview(view)
  3472. normal! m'
  3473. if sp_return > 0
  3474. execute final_position
  3475. endif
  3476. return s:CleanUp(restore_options, a:mode, startline, startcol, mid.'\|'.fin)
  3477. endfun
  3478.  
  3479. " Restore options and do some special handling for Operator-pending mode.
  3480. " The optional argument is the tail of the matching group.
  3481. 1 0.000004 fun! s:CleanUp(options, mode, startline, startcol, ...)
  3482. execute "set" a:options
  3483. " Open folds, if appropriate.
  3484. if a:mode != "o"
  3485. if &foldopen =~ "percent"
  3486. normal! zv
  3487. endif
  3488. " In Operator-pending mode, we want to include the whole match
  3489. " (for example, d%).
  3490. " This is only a problem if we end up moving in the forward direction.
  3491. elseif (a:startline < line(".")) ||
  3492. \ (a:startline == line(".") && a:startcol < col("."))
  3493. if a:0
  3494. " Check whether the match is a single character. If not, move to the
  3495. " end of the match.
  3496. let matchline = getline(".")
  3497. let currcol = col(".")
  3498. let regexp = s:Wholematch(matchline, a:1, currcol-1)
  3499. let endcol = matchend(matchline, regexp)
  3500. if endcol > currcol " This is NOT off by one!
  3501. call cursor(0, endcol)
  3502. endif
  3503. endif " a:0
  3504. endif " a:mode != "o" && etc.
  3505. return 0
  3506. endfun
  3507.  
  3508. " Example (simplified HTML patterns): if
  3509. " a:groupBR = '<\(\k\+\)>:</\1>'
  3510. " a:prefix = '^.\{3}\('
  3511. " a:group = '<\(\k\+\)>:</\(\k\+\)>'
  3512. " a:suffix = '\).\{2}$'
  3513. " a:matchline = "123<tag>12" or "123</tag>12"
  3514. " then extract "tag" from a:matchline and return "<tag>:</tag>" .
  3515. 1 0.000003 fun! s:InsertRefs(groupBR, prefix, group, suffix, matchline)
  3516. if a:matchline !~ a:prefix .
  3517. \ substitute(a:group, s:notslash . '\zs:', '\\|', 'g') . a:suffix
  3518. return a:group
  3519. endif
  3520. let i = matchend(a:groupBR, s:notslash . ':')
  3521. let ini = strpart(a:groupBR, 0, i-1)
  3522. let tailBR = strpart(a:groupBR, i)
  3523. let word = s:Choose(a:group, a:matchline, ":", "", a:prefix, a:suffix,
  3524. \ a:groupBR)
  3525. let i = matchend(word, s:notslash . ":")
  3526. let wordBR = strpart(word, i)
  3527. let word = strpart(word, 0, i-1)
  3528. " Now, a:matchline =~ a:prefix . word . a:suffix
  3529. if wordBR != ini
  3530. let table = s:Resolve(ini, wordBR, "table")
  3531. else
  3532. " let table = "----------"
  3533. let table = ""
  3534. let d = 0
  3535. while d < 10
  3536. if tailBR =~ s:notslash . '\\' . d
  3537. " let table[d] = d
  3538. let table = table . d
  3539. else
  3540. let table = table . "-"
  3541. endif
  3542. let d = d + 1
  3543. endwhile
  3544. endif
  3545. let d = 9
  3546. while d
  3547. if table[d] != "-"
  3548. let backref = substitute(a:matchline, a:prefix.word.a:suffix,
  3549. \ '\'.table[d], "")
  3550. " Are there any other characters that should be escaped?
  3551. let backref = escape(backref, '*,:')
  3552. execute s:Ref(ini, d, "start", "len")
  3553. let ini = strpart(ini, 0, start) . backref . strpart(ini, start+len)
  3554. let tailBR = substitute(tailBR, s:notslash . '\zs\\' . d,
  3555. \ escape(backref, '\\&'), 'g')
  3556. endif
  3557. let d = d-1
  3558. endwhile
  3559. if exists("b:match_debug")
  3560. if s:do_BR
  3561. let b:match_table = table
  3562. let b:match_word = word
  3563. else
  3564. let b:match_table = ""
  3565. let b:match_word = ""
  3566. endif
  3567. endif
  3568. return ini . ":" . tailBR
  3569. endfun
  3570.  
  3571. " Input a comma-separated list of groups with backrefs, such as
  3572. " a:groups = '\(foo\):end\1,\(bar\):end\1'
  3573. " and return a comma-separated list of groups with backrefs replaced:
  3574. " return '\(foo\):end\(foo\),\(bar\):end\(bar\)'
  3575. 1 0.000002 fun! s:ParseWords(groups)
  3576. let groups = substitute(a:groups.",", s:notslash.'\zs[,:]*,[,:]*', ',', 'g')
  3577. let groups = substitute(groups, s:notslash . '\zs:\{2,}', ':', 'g')
  3578. let parsed = ""
  3579. while groups =~ '[^,:]'
  3580. let i = matchend(groups, s:notslash . ':')
  3581. let j = matchend(groups, s:notslash . ',')
  3582. let ini = strpart(groups, 0, i-1)
  3583. let tail = strpart(groups, i, j-i-1) . ":"
  3584. let groups = strpart(groups, j)
  3585. let parsed = parsed . ini
  3586. let i = matchend(tail, s:notslash . ':')
  3587. while i != -1
  3588. " In 'if:else:endif', ini='if' and word='else' and then word='endif'.
  3589. let word = strpart(tail, 0, i-1)
  3590. let tail = strpart(tail, i)
  3591. let i = matchend(tail, s:notslash . ':')
  3592. let parsed = parsed . ":" . s:Resolve(ini, word, "word")
  3593. endwhile " Now, tail has been used up.
  3594. let parsed = parsed . ","
  3595. endwhile " groups =~ '[^,:]'
  3596. let parsed = substitute(parsed, ',$', '', '')
  3597. return parsed
  3598. endfun
  3599.  
  3600. " TODO I think this can be simplified and/or made more efficient.
  3601. " TODO What should I do if a:start is out of range?
  3602. " Return a regexp that matches all of a:string, such that
  3603. " matchstr(a:string, regexp) represents the match for a:pat that starts
  3604. " as close to a:start as possible, before being preferred to after, and
  3605. " ends after a:start .
  3606. " Usage:
  3607. " let regexp = s:Wholematch(getline("."), 'foo\|bar', col(".")-1)
  3608. " let i = match(getline("."), regexp)
  3609. " let j = matchend(getline("."), regexp)
  3610. " let match = matchstr(getline("."), regexp)
  3611. 1 0.000002 fun! s:Wholematch(string, pat, start)
  3612. let group = '\%(' . a:pat . '\)'
  3613. let prefix = (a:start ? '\(^.*\%<' . (a:start + 2) . 'c\)\zs' : '^')
  3614. let len = strlen(a:string)
  3615. let suffix = (a:start+1 < len ? '\(\%>'.(a:start+1).'c.*$\)\@=' : '$')
  3616. if a:string !~ prefix . group . suffix
  3617. let prefix = ''
  3618. endif
  3619. return prefix . group . suffix
  3620. endfun
  3621.  
  3622. " No extra arguments: s:Ref(string, d) will
  3623. " find the d'th occurrence of '\(' and return it, along with everything up
  3624. " to and including the matching '\)'.
  3625. " One argument: s:Ref(string, d, "start") returns the index of the start
  3626. " of the d'th '\(' and any other argument returns the length of the group.
  3627. " Two arguments: s:Ref(string, d, "foo", "bar") returns a string to be
  3628. " executed, having the effect of
  3629. " :let foo = s:Ref(string, d, "start")
  3630. " :let bar = s:Ref(string, d, "len")
  3631. 1 0.000002 fun! s:Ref(string, d, ...)
  3632. let len = strlen(a:string)
  3633. if a:d == 0
  3634. let start = 0
  3635. else
  3636. let cnt = a:d
  3637. let match = a:string
  3638. while cnt
  3639. let cnt = cnt - 1
  3640. let index = matchend(match, s:notslash . '\\(')
  3641. if index == -1
  3642. return ""
  3643. endif
  3644. let match = strpart(match, index)
  3645. endwhile
  3646. let start = len - strlen(match)
  3647. if a:0 == 1 && a:1 == "start"
  3648. return start - 2
  3649. endif
  3650. let cnt = 1
  3651. while cnt
  3652. let index = matchend(match, s:notslash . '\\(\|\\)') - 1
  3653. if index == -2
  3654. return ""
  3655. endif
  3656. " Increment if an open, decrement if a ')':
  3657. let cnt = cnt + (match[index]=="(" ? 1 : -1) " ')'
  3658. " let cnt = stridx('0(', match[index]) + cnt
  3659. let match = strpart(match, index+1)
  3660. endwhile
  3661. let start = start - 2
  3662. let len = len - start - strlen(match)
  3663. endif
  3664. if a:0 == 1
  3665. return len
  3666. elseif a:0 == 2
  3667. return "let " . a:1 . "=" . start . "| let " . a:2 . "=" . len
  3668. else
  3669. return strpart(a:string, start, len)
  3670. endif
  3671. endfun
  3672.  
  3673. " Count the number of disjoint copies of pattern in string.
  3674. " If the pattern is a literal string and contains no '0' or '1' characters
  3675. " then s:Count(string, pattern, '0', '1') should be faster than
  3676. " s:Count(string, pattern).
  3677. 1 0.000002 fun! s:Count(string, pattern, ...)
  3678. let pat = escape(a:pattern, '\\')
  3679. if a:0 > 1
  3680. let foo = substitute(a:string, '[^'.a:pattern.']', "a:1", "g")
  3681. let foo = substitute(a:string, pat, a:2, "g")
  3682. let foo = substitute(foo, '[^' . a:2 . ']', "", "g")
  3683. return strlen(foo)
  3684. endif
  3685. let result = 0
  3686. let foo = a:string
  3687. let index = matchend(foo, pat)
  3688. while index != -1
  3689. let result = result + 1
  3690. let foo = strpart(foo, index)
  3691. let index = matchend(foo, pat)
  3692. endwhile
  3693. return result
  3694. endfun
  3695.  
  3696. " s:Resolve('\(a\)\(b\)', '\(c\)\2\1\1\2') should return table.word, where
  3697. " word = '\(c\)\(b\)\(a\)\3\2' and table = '-32-------'. That is, the first
  3698. " '\1' in target is replaced by '\(a\)' in word, table[1] = 3, and this
  3699. " indicates that all other instances of '\1' in target are to be replaced
  3700. " by '\3'. The hard part is dealing with nesting...
  3701. " Note that ":" is an illegal character for source and target,
  3702. " unless it is preceded by "\".
  3703. 1 0.000002 fun! s:Resolve(source, target, output)
  3704. let word = a:target
  3705. let i = matchend(word, s:notslash . '\\\d') - 1
  3706. let table = "----------"
  3707. while i != -2 " There are back references to be replaced.
  3708. let d = word[i]
  3709. let backref = s:Ref(a:source, d)
  3710. " The idea is to replace '\d' with backref. Before we do this,
  3711. " replace any \(\) groups in backref with :1, :2, ... if they
  3712. " correspond to the first, second, ... group already inserted
  3713. " into backref. Later, replace :1 with \1 and so on. The group
  3714. " number w+b within backref corresponds to the group number
  3715. " s within a:source.
  3716. " w = number of '\(' in word before the current one
  3717. let w = s:Count(
  3718. \ substitute(strpart(word, 0, i-1), '\\\\', '', 'g'), '\(', '1')
  3719. let b = 1 " number of the current '\(' in backref
  3720. let s = d " number of the current '\(' in a:source
  3721. while b <= s:Count(substitute(backref, '\\\\', '', 'g'), '\(', '1')
  3722. \ && s < 10
  3723. if table[s] == "-"
  3724. if w + b < 10
  3725. " let table[s] = w + b
  3726. let table = strpart(table, 0, s) . (w+b) . strpart(table, s+1)
  3727. endif
  3728. let b = b + 1
  3729. let s = s + 1
  3730. else
  3731. execute s:Ref(backref, b, "start", "len")
  3732. let ref = strpart(backref, start, len)
  3733. let backref = strpart(backref, 0, start) . ":". table[s]
  3734. \ . strpart(backref, start+len)
  3735. let s = s + s:Count(substitute(ref, '\\\\', '', 'g'), '\(', '1')
  3736. endif
  3737. endwhile
  3738. let word = strpart(word, 0, i-1) . backref . strpart(word, i+1)
  3739. let i = matchend(word, s:notslash . '\\\d') - 1
  3740. endwhile
  3741. let word = substitute(word, s:notslash . '\zs:', '\\', 'g')
  3742. if a:output == "table"
  3743. return table
  3744. elseif a:output == "word"
  3745. return word
  3746. else
  3747. return table . word
  3748. endif
  3749. endfun
  3750.  
  3751. " Assume a:comma = ",". Then the format for a:patterns and a:1 is
  3752. " a:patterns = "<pat1>,<pat2>,..."
  3753. " a:1 = "<alt1>,<alt2>,..."
  3754. " If <patn> is the first pattern that matches a:string then return <patn>
  3755. " if no optional arguments are given; return <patn>,<altn> if a:1 is given.
  3756. 1 0.000003 fun! s:Choose(patterns, string, comma, branch, prefix, suffix, ...)
  3757. let tail = (a:patterns =~ a:comma."$" ? a:patterns : a:patterns . a:comma)
  3758. let i = matchend(tail, s:notslash . a:comma)
  3759. if a:0
  3760. let alttail = (a:1 =~ a:comma."$" ? a:1 : a:1 . a:comma)
  3761. let j = matchend(alttail, s:notslash . a:comma)
  3762. endif
  3763. let current = strpart(tail, 0, i-1)
  3764. if a:branch == ""
  3765. let currpat = current
  3766. else
  3767. let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g')
  3768. endif
  3769. while a:string !~ a:prefix . currpat . a:suffix
  3770. let tail = strpart(tail, i)
  3771. let i = matchend(tail, s:notslash . a:comma)
  3772. if i == -1
  3773. return -1
  3774. endif
  3775. let current = strpart(tail, 0, i-1)
  3776. if a:branch == ""
  3777. let currpat = current
  3778. else
  3779. let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g')
  3780. endif
  3781. if a:0
  3782. let alttail = strpart(alttail, j)
  3783. let j = matchend(alttail, s:notslash . a:comma)
  3784. endif
  3785. endwhile
  3786. if a:0
  3787. let current = current . a:comma . strpart(alttail, 0, j-1)
  3788. endif
  3789. return current
  3790. endfun
  3791.  
  3792. " Call this function to turn on debugging information. Every time the main
  3793. " script is run, buffer variables will be saved. These can be used directly
  3794. " or viewed using the menu items below.
  3795. 1 0.000006 if !exists(":MatchDebug")
  3796. 1 0.000004 command! -nargs=0 MatchDebug call s:Match_debug()
  3797. 1 0.000001 endif
  3798.  
  3799. 1 0.000002 fun! s:Match_debug()
  3800. let b:match_debug = 1 " Save debugging information.
  3801. " pat = all of b:match_words with backrefs parsed
  3802. amenu &Matchit.&pat :echo b:match_pat<CR>
  3803. " match = bit of text that is recognized as a match
  3804. amenu &Matchit.&match :echo b:match_match<CR>
  3805. " curcol = cursor column of the start of the matching text
  3806. amenu &Matchit.&curcol :echo b:match_col<CR>
  3807. " wholeBR = matching group, original version
  3808. amenu &Matchit.wh&oleBR :echo b:match_wholeBR<CR>
  3809. " iniBR = 'if' piece, original version
  3810. amenu &Matchit.ini&BR :echo b:match_iniBR<CR>
  3811. " ini = 'if' piece, with all backrefs resolved from match
  3812. amenu &Matchit.&ini :echo b:match_ini<CR>
  3813. " tail = 'else\|endif' piece, with all backrefs resolved from match
  3814. amenu &Matchit.&tail :echo b:match_tail<CR>
  3815. " fin = 'endif' piece, with all backrefs resolved from match
  3816. amenu &Matchit.&word :echo b:match_word<CR>
  3817. " '\'.d in ini refers to the same thing as '\'.table[d] in word.
  3818. amenu &Matchit.t&able :echo '0:' . b:match_table . ':9'<CR>
  3819. endfun
  3820.  
  3821. " Jump to the nearest unmatched "(" or "if" or "<tag>" if a:spflag == "bW"
  3822. " or the nearest unmatched "</tag>" or "endif" or ")" if a:spflag == "W".
  3823. " Return a "mark" for the original position, so that
  3824. " let m = MultiMatch("bW", "n") ... execute m
  3825. " will return to the original position. If there is a problem, do not
  3826. " move the cursor and return "", unless a count is given, in which case
  3827. " go up or down as many levels as possible and again return "".
  3828. " TODO This relies on the same patterns as % matching. It might be a good
  3829. " idea to give it its own matching patterns.
  3830. 1 0.000002 fun! s:MultiMatch(spflag, mode)
  3831. if !exists("b:match_words") || b:match_words == ""
  3832. return {}
  3833. end
  3834. let restore_options = (&ic ? "" : "no") . "ignorecase"
  3835. if exists("b:match_ignorecase")
  3836. let &ignorecase = b:match_ignorecase
  3837. endif
  3838. let startline = line(".")
  3839. let startcol = col(".")
  3840.  
  3841. " First step: if not already done, set the script variables
  3842. " s:do_BR flag for whether there are backrefs
  3843. " s:pat parsed version of b:match_words
  3844. " s:all regexp based on s:pat and the default groups
  3845. " This part is copied and slightly modified from s:Match_wrapper().
  3846. let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") .
  3847. \ '\/\*:\*\/,#\s*if\%(def\)\=:#\s*else\>:#\s*elif\>:#\s*endif\>'
  3848. " Allow b:match_words = "GetVimMatchWords()" .
  3849. if b:match_words =~ ":"
  3850. let match_words = b:match_words
  3851. else
  3852. execute "let match_words =" b:match_words
  3853. endif
  3854. if (match_words != s:last_words) || (&mps != s:last_mps) ||
  3855. \ exists("b:match_debug")
  3856. let s:last_words = match_words
  3857. let s:last_mps = &mps
  3858. if match_words !~ s:notslash . '\\\d'
  3859. let s:do_BR = 0
  3860. let s:pat = match_words
  3861. else
  3862. let s:do_BR = 1
  3863. let s:pat = s:ParseWords(match_words)
  3864. endif
  3865. let s:all = '\%(' . substitute(s:pat . (strlen(s:pat)?",":"") . default,
  3866. \ '[,:]\+','\\|','g') . '\)'
  3867. if exists("b:match_debug")
  3868. let b:match_pat = s:pat
  3869. endif
  3870. endif
  3871.  
  3872. " Second step: figure out the patterns for searchpair()
  3873. " and save the screen, cursor position, and 'ignorecase'.
  3874. " - TODO: A lot of this is copied from s:Match_wrapper().
  3875. " - maybe even more functionality should be split off
  3876. " - into separate functions!
  3877. let cdefault = (s:pat =~ '[^,]$' ? "," : "") . default
  3878. let open = substitute(s:pat . cdefault,
  3879. \ s:notslash . '\zs:.\{-}' . s:notslash . ',', '\\),\\(', 'g')
  3880. let open = '\(' . substitute(open, s:notslash . '\zs:.*$', '\\)', '')
  3881. let close = substitute(s:pat . cdefault,
  3882. \ s:notslash . '\zs,.\{-}' . s:notslash . ':', '\\),\\(', 'g')
  3883. let close = substitute(close, '^.\{-}' . s:notslash . ':', '\\(', '') . '\)'
  3884. if exists("b:match_skip")
  3885. let skip = b:match_skip
  3886. elseif exists("b:match_comment") " backwards compatibility and testing!
  3887. let skip = "r:" . b:match_comment
  3888. else
  3889. let skip = 's:comment\|string'
  3890. endif
  3891. let skip = s:ParseSkip(skip)
  3892. let view = winsaveview()
  3893.  
  3894. " Third step: call searchpair().
  3895. " Replace '\('--but not '\\('--with '\%(' and ',' with '\|'.
  3896. let openpat = substitute(open, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g')
  3897. let openpat = substitute(openpat, ',', '\\|', 'g')
  3898. let closepat = substitute(close, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g')
  3899. let closepat = substitute(closepat, ',', '\\|', 'g')
  3900. if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on"))
  3901. let skip = '0'
  3902. else
  3903. execute "if " . skip . "| let skip = '0' | endif"
  3904. endif
  3905. mark '
  3906. let level = v:count1
  3907. while level
  3908. if searchpair(openpat, '', closepat, a:spflag, skip) < 1
  3909. call s:CleanUp(restore_options, a:mode, startline, startcol)
  3910. return {}
  3911. endif
  3912. let level = level - 1
  3913. endwhile
  3914.  
  3915. " Restore options and return view dict to restore the original position.
  3916. call s:CleanUp(restore_options, a:mode, startline, startcol)
  3917. return view
  3918. endfun
  3919.  
  3920. " Search backwards for "if" or "while" or "<tag>" or ...
  3921. " and return "endif" or "endwhile" or "</tag>" or ... .
  3922. " For now, this uses b:match_words and the same script variables
  3923. " as s:Match_wrapper() . Later, it may get its own patterns,
  3924. " either from a buffer variable or passed as arguments.
  3925. " fun! s:Autocomplete()
  3926. " echo "autocomplete not yet implemented :-("
  3927. " if !exists("b:match_words") || b:match_words == ""
  3928. " return ""
  3929. " end
  3930. " let startpos = s:MultiMatch("bW")
  3931. "
  3932. " if startpos == ""
  3933. " return ""
  3934. " endif
  3935. " " - TODO: figure out whether 'if' or '<tag>' matched, and construct
  3936. " " - the appropriate closing.
  3937. " let matchline = getline(".")
  3938. " let curcol = col(".") - 1
  3939. " " - TODO: Change the s:all argument if there is a new set of match pats.
  3940. " let regexp = s:Wholematch(matchline, s:all, curcol)
  3941. " let suf = strlen(matchline) - matchend(matchline, regexp)
  3942. " let prefix = (curcol ? '^.\{' . curcol . '}\%(' : '^\%(')
  3943. " let suffix = (suf ? '\).\{' . suf . '}$' : '\)$')
  3944. " " Reconstruct the version with unresolved backrefs.
  3945. " let patBR = substitute(b:match_words.',', '[,:]*,[,:]*', ',', 'g')
  3946. " let patBR = substitute(patBR, ':\{2,}', ':', "g")
  3947. " " Now, set group and groupBR to the matching group: 'if:endif' or
  3948. " " 'while:endwhile' or whatever.
  3949. " let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR)
  3950. " let i = matchend(group, s:notslash . ",")
  3951. " let groupBR = strpart(group, i)
  3952. " let group = strpart(group, 0, i-1)
  3953. " " Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix
  3954. " if s:do_BR
  3955. " let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline)
  3956. " endif
  3957. " " let g:group = group
  3958. "
  3959. " " - TODO: Construct the closing from group.
  3960. " let fake = "end" . expand("<cword>")
  3961. " execute startpos
  3962. " return fake
  3963. " endfun
  3964.  
  3965. " Close all open structures. "Get the heck out of here!"
  3966. " fun! s:Gthhoh()
  3967. " let close = s:Autocomplete()
  3968. " while strlen(close)
  3969. " put=close
  3970. " let close = s:Autocomplete()
  3971. " endwhile
  3972. " endfun
  3973.  
  3974. " Parse special strings as typical skip arguments for searchpair():
  3975. " s:foo becomes (current syntax item) =~ foo
  3976. " S:foo becomes (current syntax item) !~ foo
  3977. " r:foo becomes (line before cursor) =~ foo
  3978. " R:foo becomes (line before cursor) !~ foo
  3979. 1 0.000005 fun! s:ParseSkip(str)
  3980. let skip = a:str
  3981. if skip[1] == ":"
  3982. if skip[0] == "s"
  3983. let skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '" .
  3984. \ strpart(skip,2) . "'"
  3985. elseif skip[0] == "S"
  3986. let skip = "synIDattr(synID(line('.'),col('.'),1),'name') !~? '" .
  3987. \ strpart(skip,2) . "'"
  3988. elseif skip[0] == "r"
  3989. let skip = "strpart(getline('.'),0,col('.'))=~'" . strpart(skip,2). "'"
  3990. elseif skip[0] == "R"
  3991. let skip = "strpart(getline('.'),0,col('.'))!~'" . strpart(skip,2). "'"
  3992. endif
  3993. endif
  3994. return skip
  3995. endfun
  3996.  
  3997. 1 0.000012 let &cpo = s:save_cpo
  3998. 1 0.000003 unlet s:save_cpo
  3999.  
  4000. " vim:sts=2:sw=2:
  4001.  
  4002. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/matchparen.vim
  4003. Sourced 1 time
  4004. Total time: 0.000282
  4005. Self time: 0.000282
  4006.  
  4007. count total (s) self (s)
  4008. " Vim plugin for showing matching parens
  4009. " Maintainer: Bram Moolenaar <Bram@vim.org>
  4010. " Last Change: 2016 Feb 16
  4011.  
  4012. " Exit quickly when:
  4013. " - this plugin was already loaded (or disabled)
  4014. " - when 'compatible' is set
  4015. " - the "CursorMoved" autocmd event is not available.
  4016. 1 0.000014 if exists("g:loaded_matchparen") || &cp || !exists("##CursorMoved")
  4017. finish
  4018. endif
  4019. 1 0.000003 let g:loaded_matchparen = 1
  4020.  
  4021. 1 0.000002 if !exists("g:matchparen_timeout")
  4022. 1 0.000002 let g:matchparen_timeout = 300
  4023. 1 0.000001 endif
  4024. 1 0.000002 if !exists("g:matchparen_insert_timeout")
  4025. 1 0.000002 let g:matchparen_insert_timeout = 60
  4026. 1 0.000001 endif
  4027.  
  4028. 1 0.000002 augroup matchparen
  4029. " Replace all matchparen autocommands
  4030. 1 0.000009 autocmd! CursorMoved,CursorMovedI,WinEnter * call s:Highlight_Matching_Pair()
  4031. 1 0.000003 if exists('##TextChanged')
  4032. 1 0.000005 autocmd! TextChanged,TextChangedI * call s:Highlight_Matching_Pair()
  4033. 1 0.000001 endif
  4034. 1 0.000001 augroup END
  4035.  
  4036. " Skip the rest if it was already done.
  4037. 1 0.000005 if exists("*s:Highlight_Matching_Pair")
  4038. finish
  4039. endif
  4040.  
  4041. 1 0.000007 let s:cpo_save = &cpo
  4042. 1 0.000008 set cpo-=C
  4043.  
  4044. " The function that is invoked (very often) to define a ":match" highlighting
  4045. " for any matching paren.
  4046. 1 0.000004 function! s:Highlight_Matching_Pair()
  4047. " Remove any previous match.
  4048. if exists('w:paren_hl_on') && w:paren_hl_on
  4049. silent! call matchdelete(3)
  4050. let w:paren_hl_on = 0
  4051. endif
  4052.  
  4053. " Avoid that we remove the popup menu.
  4054. " Return when there are no colors (looks like the cursor jumps).
  4055. if pumvisible() || (&t_Co < 8 && !has("gui_running"))
  4056. return
  4057. endif
  4058.  
  4059. " Get the character under the cursor and check if it's in 'matchpairs'.
  4060. let c_lnum = line('.')
  4061. let c_col = col('.')
  4062. let before = 0
  4063.  
  4064. let text = getline(c_lnum)
  4065. let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)')
  4066. if empty(matches)
  4067. let [c_before, c] = ['', '']
  4068. else
  4069. let [c_before, c] = matches[1:2]
  4070. endif
  4071. let plist = split(&matchpairs, '.\zs[:,]')
  4072. let i = index(plist, c)
  4073. if i < 0
  4074. " not found, in Insert mode try character before the cursor
  4075. if c_col > 1 && (mode() == 'i' || mode() == 'R')
  4076. let before = strlen(c_before)
  4077. let c = c_before
  4078. let i = index(plist, c)
  4079. endif
  4080. if i < 0
  4081. " not found, nothing to do
  4082. return
  4083. endif
  4084. endif
  4085.  
  4086. " Figure out the arguments for searchpairpos().
  4087. if i % 2 == 0
  4088. let s_flags = 'nW'
  4089. let c2 = plist[i + 1]
  4090. else
  4091. let s_flags = 'nbW'
  4092. let c2 = c
  4093. let c = plist[i - 1]
  4094. endif
  4095. if c == '['
  4096. let c = '\['
  4097. let c2 = '\]'
  4098. endif
  4099.  
  4100. " Find the match. When it was just before the cursor move it there for a
  4101. " moment.
  4102. if before > 0
  4103. let has_getcurpos = exists("*getcurpos")
  4104. if has_getcurpos
  4105. " getcurpos() is more efficient but doesn't exist before 7.4.313.
  4106. let save_cursor = getcurpos()
  4107. else
  4108. let save_cursor = winsaveview()
  4109. endif
  4110. call cursor(c_lnum, c_col - before)
  4111. endif
  4112.  
  4113. " Build an expression that detects whether the current cursor position is in
  4114. " certain syntax types (string, comment, etc.), for use as searchpairpos()'s
  4115. " skip argument.
  4116. " We match "escape" for special items, such as lispEscapeSpecial.
  4117. let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' .
  4118. \ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))'
  4119. " If executing the expression determines that the cursor is currently in
  4120. " one of the syntax types, then we want searchpairpos() to find the pair
  4121. " within those syntax types (i.e., not skip). Otherwise, the cursor is
  4122. " outside of the syntax types and s_skip should keep its value so we skip any
  4123. " matching pair inside the syntax types.
  4124. execute 'if' s_skip '| let s_skip = 0 | endif'
  4125.  
  4126. " Limit the search to lines visible in the window.
  4127. let stoplinebottom = line('w$')
  4128. let stoplinetop = line('w0')
  4129. if i % 2 == 0
  4130. let stopline = stoplinebottom
  4131. else
  4132. let stopline = stoplinetop
  4133. endif
  4134.  
  4135. " Limit the search time to 300 msec to avoid a hang on very long lines.
  4136. " This fails when a timeout is not supported.
  4137. if mode() == 'i' || mode() == 'R'
  4138. let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout
  4139. else
  4140. let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout
  4141. endif
  4142. try
  4143. let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout)
  4144. catch /E118/
  4145. " Can't use the timeout, restrict the stopline a bit more to avoid taking
  4146. " a long time on closed folds and long lines.
  4147. " The "viewable" variables give a range in which we can scroll while
  4148. " keeping the cursor at the same position.
  4149. " adjustedScrolloff accounts for very large numbers of scrolloff.
  4150. let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2])
  4151. let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2])
  4152. let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2])
  4153. " one of these stoplines will be adjusted below, but the current values are
  4154. " minimal boundaries within the current window
  4155. if i % 2 == 0
  4156. if has("byte_offset") && has("syntax_items") && &smc > 0
  4157. let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
  4158. let stopline = min([bottom_viewable, byte2line(stopbyte)])
  4159. else
  4160. let stopline = min([bottom_viewable, c_lnum + 100])
  4161. endif
  4162. let stoplinebottom = stopline
  4163. else
  4164. if has("byte_offset") && has("syntax_items") && &smc > 0
  4165. let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
  4166. let stopline = max([top_viewable, byte2line(stopbyte)])
  4167. else
  4168. let stopline = max([top_viewable, c_lnum - 100])
  4169. endif
  4170. let stoplinetop = stopline
  4171. endif
  4172. let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
  4173. endtry
  4174.  
  4175. if before > 0
  4176. if has_getcurpos
  4177. call setpos('.', save_cursor)
  4178. else
  4179. call winrestview(save_cursor)
  4180. endif
  4181. endif
  4182.  
  4183. " If a match is found setup match highlighting.
  4184. if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom
  4185. if exists('*matchaddpos')
  4186. call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3)
  4187. else
  4188. exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) .
  4189. \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
  4190. endif
  4191. let w:paren_hl_on = 1
  4192. endif
  4193. endfunction
  4194.  
  4195. " Define commands that will disable and enable the plugin.
  4196. 1 0.000011 command! NoMatchParen windo silent! call matchdelete(3) | unlet! g:loaded_matchparen |
  4197. \ au! matchparen
  4198. 1 0.000006 command! DoMatchParen runtime plugin/matchparen.vim | windo doau CursorMoved
  4199.  
  4200. 1 0.000010 let &cpo = s:cpo_save
  4201. 1 0.000003 unlet s:cpo_save
  4202.  
  4203. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/netrwPlugin.vim
  4204. Sourced 1 time
  4205. Total time: 0.000592
  4206. Self time: 0.000592
  4207.  
  4208. count total (s) self (s)
  4209. " netrwPlugin.vim: Handles file transfer and remote directory listing across a network
  4210. " PLUGIN SECTION
  4211. " Date: Feb 08, 2016
  4212. " Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
  4213. " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
  4214. " Copyright: Copyright (C) 1999-2013 Charles E. Campbell {{{1
  4215. " Permission is hereby granted to use and distribute this code,
  4216. " with or without modifications, provided that this copyright
  4217. " notice is copied with it. Like anything else that's free,
  4218. " netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided
  4219. " *as is* and comes with no warranty of any kind, either
  4220. " expressed or implied. By using this plugin, you agree that
  4221. " in no event will the copyright holder be liable for any damages
  4222. " resulting from the use of this software.
  4223. "
  4224. " But be doers of the Word, and not only hearers, deluding your own selves {{{1
  4225. " (James 1:22 RSV)
  4226. " =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  4227. " Load Once: {{{1
  4228. 1 0.000011 if &cp || exists("g:loaded_netrwPlugin")
  4229. finish
  4230. endif
  4231. 1 0.000003 let g:loaded_netrwPlugin = "v156"
  4232. 1 0.000006 let s:keepcpo = &cpo
  4233. 1 0.000007 set cpo&vim
  4234. "DechoRemOn
  4235.  
  4236. " ---------------------------------------------------------------------
  4237. " Public Interface: {{{1
  4238.  
  4239. " Local Browsing Autocmds: {{{2
  4240. 1 0.000002 augroup FileExplorer
  4241. 1 0.000020 au!
  4242. 1 0.000006 au BufLeave * if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif
  4243. 1 0.000003 au BufEnter * sil call s:LocalBrowse(expand("<amatch>"))
  4244. 1 0.000006 au VimEnter * sil call s:VimEnter(expand("<amatch>"))
  4245. 1 0.000010 if has("win32") || has("win95") || has("win64") || has("win16")
  4246. au BufEnter .* sil call s:LocalBrowse(expand("<amatch>"))
  4247. endif
  4248. 1 0.000001 augroup END
  4249.  
  4250. " Network Browsing Reading Writing: {{{2
  4251. 1 0.000001 augroup Network
  4252. 1 0.000016 au!
  4253. 1 0.000006 au BufReadCmd file://* call netrw#FileUrlRead(expand("<amatch>"))
  4254. 1 0.000025 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>"))
  4255. 1 0.000024 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>"))
  4256. 1 0.000019 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>"))
  4257. 1 0.000027 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>"))
  4258. 1 0.000002 try
  4259. 1 0.000015 au SourceCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>"))
  4260. 1 0.000003 catch /^Vim\%((\a\+)\)\=:E216/
  4261. au SourcePre ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>"))
  4262. endtry
  4263. 1 0.000002 augroup END
  4264.  
  4265. " Commands: :Nread, :Nwrite, :NetUserPass {{{2
  4266. 1 0.000024 com! -count=1 -nargs=* Nread let s:svpos= winsaveview()<bar>call netrw#NetRead(<count>,<f-args>)<bar>call winrestview(s:svpos)
  4267. 1 0.000015 com! -range=% -nargs=* Nwrite let s:svpos= winsaveview()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call winrestview(s:svpos)
  4268. 1 0.000004 com! -nargs=* NetUserPass call NetUserPass(<f-args>)
  4269. 1 0.000008 com! -nargs=* Nsource let s:svpos= winsaveview()<bar>call netrw#NetSource(<f-args>)<bar>call winrestview(s:svpos)
  4270. 1 0.000004 com! -nargs=? Ntree call netrw#SetTreetop(<q-args>)
  4271.  
  4272. " Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{2
  4273. 1 0.000009 com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(<count>,0,0+<bang>0,<q-args>)
  4274. 1 0.000007 com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(<count>,1,0+<bang>0,<q-args>)
  4275. 1 0.000007 com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(<count>,1,2+<bang>0,<q-args>)
  4276. 1 0.000006 com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(<count>,1,4+<bang>0,<q-args>)
  4277. 1 0.000006 com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(<count>,0,6 ,<q-args>)
  4278. 1 0.000004 com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,<q-args>)
  4279. 1 0.000005 com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,<q-args>)
  4280. 1 0.000006 com! -nargs=* -bar -bang -count=0 -complete=dir Lexplore call netrw#Lexplore(<count>,<bang>0,<q-args>)
  4281.  
  4282. " Commands: NetrwSettings {{{2
  4283. 1 0.000004 com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings()
  4284. 1 0.000004 com! -bang NetrwClean call netrw#Clean(<bang>0)
  4285.  
  4286. " Maps:
  4287. 1 0.000005 if !exists("g:netrw_nogx")
  4288. 1 0.000010 if maparg('gx','n') == ""
  4289. 1 0.000010 if !hasmapto('<Plug>NetrwBrowseX')
  4290. 1 0.000005 nmap <unique> gx <Plug>NetrwBrowseX
  4291. 1 0.000001 endif
  4292. 1 0.000011 nno <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())<cr>
  4293. 1 0.000001 endif
  4294. 1 0.000004 if maparg('gx','v') == ""
  4295. 1 0.000006 if !hasmapto('<Plug>NetrwBrowseXVis')
  4296. 1 0.000005 vmap <unique> gx <Plug>NetrwBrowseXVis
  4297. 1 0.000001 endif
  4298. 1 0.000009 vno <silent> <Plug>NetrwBrowseXVis :<c-u>call netrw#BrowseXVis()<cr>
  4299. 1 0.000001 endif
  4300. 1 0.000001 endif
  4301. 1 0.000003 if exists("g:netrw_usetab") && g:netrw_usetab
  4302. if maparg('<c-tab>','n') == ""
  4303. nmap <unique> <c-tab> <Plug>NetrwShrink
  4304. endif
  4305. nno <silent> <Plug>NetrwShrink :call netrw#Shrink()<cr>
  4306. endif
  4307.  
  4308. " ---------------------------------------------------------------------
  4309. " LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{2
  4310. 1 0.000005 fun! s:LocalBrowse(dirname)
  4311. " Unfortunate interaction -- only DechoMsg debugging calls can be safely used here.
  4312. " Otherwise, the BufEnter event gets triggered when attempts to write to
  4313. " the DBG buffer are made.
  4314.  
  4315. if !exists("s:vimentered")
  4316. " If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will,
  4317. " and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined.
  4318. " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered doesn't exist)")
  4319. " call Dret("s:LocalBrowse")
  4320. return
  4321. endif
  4322.  
  4323. " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered=".s:vimentered.")")
  4324.  
  4325. if has("amiga")
  4326. " The check against '' is made for the Amiga, where the empty
  4327. " string is the current directory and not checking would break
  4328. " things such as the help command.
  4329. " call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)")
  4330. if a:dirname != '' && isdirectory(a:dirname)
  4331. sil! call netrw#LocalBrowseCheck(a:dirname)
  4332. if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
  4333. exe w:netrw_bannercnt
  4334. endif
  4335. endif
  4336.  
  4337. elseif isdirectory(a:dirname)
  4338. " call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)")
  4339. " call Dredir("LocalBrowse ft last set: ","verbose set ft")
  4340. " call Decho("(s:LocalBrowse) COMBAK#23: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
  4341. sil! call netrw#LocalBrowseCheck(a:dirname)
  4342. " call Decho("(s:LocalBrowse) COMBAK#24: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
  4343. if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
  4344. exe w:netrw_bannercnt
  4345. " call Decho("(s:LocalBrowse) COMBAK#25: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
  4346. endif
  4347.  
  4348. else
  4349. " not a directory, ignore it
  4350. " call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...")
  4351. endif
  4352. " call Decho("(s:LocalBrowse) COMBAK#26: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
  4353.  
  4354. " call Dret("s:LocalBrowse")
  4355. endfun
  4356.  
  4357. " ---------------------------------------------------------------------
  4358. " s:VimEnter: after all vim startup stuff is done, this function is called. {{{2
  4359. " Its purpose: to look over all windows and run s:LocalBrowse() on
  4360. " them, which checks if they're directories and will create a directory
  4361. " listing when appropriate.
  4362. " It also sets s:vimentered, letting s:LocalBrowse() know that s:VimEnter()
  4363. " has already been called.
  4364. 1 0.000003 fun! s:VimEnter(dirname)
  4365. " call Dfunc("s:VimEnter(dirname<".a:dirname.">) expand(%)<".expand("%").">")
  4366. let curwin = winnr()
  4367. let s:vimentered = 1
  4368. windo call s:LocalBrowse(expand("%:p"))
  4369. exe curwin."wincmd w"
  4370. " call Dret("s:VimEnter")
  4371. endfun
  4372.  
  4373. " ---------------------------------------------------------------------
  4374. " NetrwStatusLine: {{{1
  4375. 1 0.000002 fun! NetrwStatusLine()
  4376. " let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".")
  4377. 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")
  4378. let &stl= s:netrw_explore_stl
  4379. if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif
  4380. if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif
  4381. return ""
  4382. else
  4383. return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen
  4384. endif
  4385. endfun
  4386.  
  4387. " ------------------------------------------------------------------------
  4388. " NetUserPass: set username and password for subsequent ftp transfer {{{1
  4389. " Usage: :call NetUserPass() -- will prompt for userid and password
  4390. " :call NetUserPass("uid") -- will prompt for password
  4391. " :call NetUserPass("uid","password") -- sets global userid and password
  4392. 1 0.000002 fun! NetUserPass(...)
  4393.  
  4394. " get/set userid
  4395. if a:0 == 0
  4396. " call Dfunc("NetUserPass(a:0<".a:0.">)")
  4397. if !exists("g:netrw_uid") || g:netrw_uid == ""
  4398. " via prompt
  4399. let g:netrw_uid= input('Enter username: ')
  4400. endif
  4401. else " from command line
  4402. " call Dfunc("NetUserPass(a:1<".a:1.">) {")
  4403. let g:netrw_uid= a:1
  4404. endif
  4405.  
  4406. " get password
  4407. if a:0 <= 1 " via prompt
  4408. " call Decho("a:0=".a:0." case <=1:")
  4409. let g:netrw_passwd= inputsecret("Enter Password: ")
  4410. else " from command line
  4411. " call Decho("a:0=".a:0." case >1: a:2<".a:2.">")
  4412. let g:netrw_passwd=a:2
  4413. endif
  4414. " call Dret("NetUserPass")
  4415. endfun
  4416.  
  4417. " ------------------------------------------------------------------------
  4418. " Modelines And Restoration: {{{1
  4419. 1 0.000012 let &cpo= s:keepcpo
  4420. 1 0.000003 unlet s:keepcpo
  4421. " vim:ts=8 fdm=marker
  4422.  
  4423. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/rplugin.vim
  4424. Sourced 1 time
  4425. Total time: 0.000078
  4426. Self time: 0.000078
  4427.  
  4428. count total (s) self (s)
  4429. if exists('g:loaded_remote_plugins')
  4430. finish
  4431. endif
  4432. 1 0.000004 let g:loaded_remote_plugins = 1
  4433.  
  4434. 1 0.000010 command! UpdateRemotePlugins call remote#host#UpdateRemotePlugins()
  4435.  
  4436. 1 0.000002 augroup nvim-rplugin
  4437. 1 0.000020 autocmd!
  4438. 1 0.000011 autocmd FuncUndefined *
  4439. \ call remote#host#LoadRemotePluginsEvent(
  4440. \ 'FuncUndefined', expand('<amatch>'))
  4441. 1 0.000007 autocmd CmdUndefined *
  4442. \ call remote#host#LoadRemotePluginsEvent(
  4443. \ 'CmdUndefined', expand('<amatch>'))
  4444. 1 0.000004 augroup END
  4445.  
  4446. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/rrhelper.vim
  4447. Sourced 1 time
  4448. Total time: 0.000039
  4449. Self time: 0.000039
  4450.  
  4451. count total (s) self (s)
  4452. " Vim plugin with helper function(s) for --remote-wait
  4453. " Maintainer: Flemming Madsen <fma@cci.dk>
  4454. " Last Change: 2008 May 29
  4455.  
  4456. " Has this already been loaded?
  4457. 1 0.000028 if exists("loaded_rrhelper") || !has("clientserver")
  4458. 1 0.000002 finish
  4459.  
  4460. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/shada.vim
  4461. Sourced 1 time
  4462. Total time: 0.000119
  4463. Self time: 0.000119
  4464.  
  4465. count total (s) self (s)
  4466. if exists('g:loaded_shada_plugin')
  4467. finish
  4468. endif
  4469. 1 0.000004 let g:loaded_shada_plugin = 1
  4470.  
  4471. 1 0.000002 augroup ShaDaCommands
  4472. 1 0.000019 autocmd!
  4473. 1 0.000017 autocmd BufReadCmd *.shada,*.shada.tmp.[a-z]
  4474. \ :if !empty(v:cmdarg)|throw '++opt not supported'|endif
  4475. \ |call setline('.', shada#get_strings(readfile(expand('<afile>'),'b')))
  4476. \ |setlocal filetype=shada
  4477. 1 0.000012 autocmd FileReadCmd *.shada,*.shada.tmp.[a-z]
  4478. \ :if !empty(v:cmdarg)|throw '++opt not supported'|endif
  4479. \ |call append("'[", shada#get_strings(readfile(expand('<afile>'), 'b')))
  4480. 1 0.000015 autocmd BufWriteCmd *.shada,*.shada.tmp.[a-z]
  4481. \ :if !empty(v:cmdarg)|throw '++opt not supported'|endif
  4482. \ |if writefile(shada#get_binstrings(getline(1, '$')),
  4483. \expand('<afile>'), 'b') == 0
  4484. \ | let &l:modified = (expand('<afile>') is# bufname(+expand('<abuf>'))
  4485. \? 0
  4486. \: stridx(&cpoptions, '+') != -1)
  4487. \ |endif
  4488. 1 0.000012 autocmd FileWriteCmd *.shada,*.shada.tmp.[a-z]
  4489. \ :if !empty(v:cmdarg)|throw '++opt not supported'|endif
  4490. \ |call writefile(
  4491. \shada#get_binstrings(getline(min([line("'["), line("']")]),
  4492. \max([line("'["), line("']")]))),
  4493. \expand('<afile>'),
  4494. \'b')
  4495. 1 0.000013 autocmd FileAppendCmd *.shada,*.shada.tmp.[a-z]
  4496. \ :if !empty(v:cmdarg)|throw '++opt not supported'|endif
  4497. \ |call writefile(
  4498. \shada#get_binstrings(getline(min([line("'["), line("']")]),
  4499. \max([line("'["), line("']")]))),
  4500. \expand('<afile>'),
  4501. \'ab')
  4502. 1 0.000010 autocmd SourceCmd *.shada,*.shada.tmp.[a-z]
  4503. \ :execute 'rshada' fnameescape(expand('<afile>'))
  4504. 1 0.000003 augroup END
  4505.  
  4506. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/spellfile.vim
  4507. Sourced 1 time
  4508. Total time: 0.000033
  4509. Self time: 0.000033
  4510.  
  4511. count total (s) self (s)
  4512. " Vim plugin for downloading spell files
  4513.  
  4514. 1 0.000014 if exists("loaded_spellfile_plugin") || &cp || exists("#SpellFileMissing")
  4515. finish
  4516. endif
  4517. 1 0.000004 let loaded_spellfile_plugin = 1
  4518.  
  4519. 1 0.000006 autocmd SpellFileMissing * call spellfile#LoadFile(expand('<amatch>'))
  4520.  
  4521. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/tarPlugin.vim
  4522. Sourced 1 time
  4523. Total time: 0.000246
  4524. Self time: 0.000246
  4525.  
  4526. count total (s) self (s)
  4527. " tarPlugin.vim -- a Vim plugin for browsing tarfiles
  4528. " Original was copyright (c) 2002, Michael C. Toren <mct@toren.net>
  4529. " Modified by Charles E. Campbell
  4530. " Distributed under the GNU General Public License.
  4531. "
  4532. " Updates are available from <http://michael.toren.net/code/>. If you
  4533. " find this script useful, or have suggestions for improvements, please
  4534. " let me know.
  4535. " Also look there for further comments and documentation.
  4536. "
  4537. " This part only sets the autocommands. The functions are in autoload/tar.vim.
  4538. " ---------------------------------------------------------------------
  4539. " Load Once: {{{1
  4540. 1 0.000011 if &cp || exists("g:loaded_tarPlugin")
  4541. finish
  4542. endif
  4543. 1 0.000003 let g:loaded_tarPlugin = "v29"
  4544. 1 0.000008 let s:keepcpo = &cpo
  4545. 1 0.000010 set cpo&vim
  4546.  
  4547. " ---------------------------------------------------------------------
  4548. " Public Interface: {{{1
  4549. 1 0.000003 augroup tar
  4550. 1 0.000021 au!
  4551. 1 0.000009 au BufReadCmd tarfile::* call tar#Read(expand("<amatch>"), 1)
  4552. 1 0.000006 au FileReadCmd tarfile::* call tar#Read(expand("<amatch>"), 0)
  4553. 1 0.000007 au BufWriteCmd tarfile::* call tar#Write(expand("<amatch>"))
  4554. 1 0.000005 au FileWriteCmd tarfile::* call tar#Write(expand("<amatch>"))
  4555.  
  4556. 1 0.000005 if has("unix")
  4557. 1 0.000007 au BufReadCmd tarfile::*/* call tar#Read(expand("<amatch>"), 1)
  4558. 1 0.000011 au FileReadCmd tarfile::*/* call tar#Read(expand("<amatch>"), 0)
  4559. 1 0.000006 au BufWriteCmd tarfile::*/* call tar#Write(expand("<amatch>"))
  4560. 1 0.000006 au FileWriteCmd tarfile::*/* call tar#Write(expand("<amatch>"))
  4561. 1 0.000002 endif
  4562.  
  4563. 1 0.000006 au BufReadCmd *.tar.gz call tar#Browse(expand("<amatch>"))
  4564. 1 0.000005 au BufReadCmd *.tar call tar#Browse(expand("<amatch>"))
  4565. 1 0.000005 au BufReadCmd *.lrp call tar#Browse(expand("<amatch>"))
  4566. 1 0.000006 au BufReadCmd *.tar.bz2 call tar#Browse(expand("<amatch>"))
  4567. 1 0.000007 au BufReadCmd *.tar.Z call tar#Browse(expand("<amatch>"))
  4568. 1 0.000005 au BufReadCmd *.tgz call tar#Browse(expand("<amatch>"))
  4569. 1 0.000020 au BufReadCmd *.tar.lzma call tar#Browse(expand("<amatch>"))
  4570. 1 0.000006 au BufReadCmd *.tar.xz call tar#Browse(expand("<amatch>"))
  4571. 1 0.000005 au BufReadCmd *.txz call tar#Browse(expand("<amatch>"))
  4572. 1 0.000002 augroup END
  4573. 1 0.000010 com! -nargs=? -complete=file Vimuntar call tar#Vimuntar(<q-args>)
  4574.  
  4575. " ---------------------------------------------------------------------
  4576. " Restoration And Modelines: {{{1
  4577. " vim: fdm=marker
  4578. 1 0.000014 let &cpo= s:keepcpo
  4579. 1 0.000006 unlet s:keepcpo
  4580.  
  4581. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/tohtml.vim
  4582. Sourced 1 time
  4583. Total time: 0.000154
  4584. Self time: 0.000154
  4585.  
  4586. count total (s) self (s)
  4587. " Vim plugin for converting a syntax highlighted file to HTML.
  4588. " Maintainer: Ben Fritz <fritzophrenic@gmail.com>
  4589. " Last Change: 2015 Sep 08
  4590. "
  4591. " The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and
  4592. " $VIMRUNTIME/syntax/2html.vim
  4593. "
  4594. " TODO: {{{
  4595. " * Options for generating the CSS in external style sheets. New :TOcss
  4596. " command to convert the current color scheme into a (mostly) generic CSS
  4597. " stylesheet which can be re-used. Alternate stylesheet support? Good start
  4598. " by Erik Falor
  4599. " ( https://groups.google.com/d/topic/vim_use/7XTmC4D22dU/discussion ).
  4600. " * Add optional argument to :TOhtml command to specify mode (gui, cterm,
  4601. " term) to use for the styling. Suggestion by "nacitar".
  4602. " * Add way to override or specify which RGB colors map to the color numbers
  4603. " in cterm. Get better defaults than just guessing? Suggestion by "nacitar".
  4604. " * Disable filetype detection until after all processing is done.
  4605. " * Add option for not generating the hyperlink on stuff that looks like a
  4606. " URL? Or just color the link to fit with the colorscheme (and only special
  4607. " when hovering)?
  4608. " * Bug: Opera does not allow printing more than one page if uncopyable
  4609. " regions is turned on. Possible solution: Add normal text line numbers with
  4610. " display:none, set to display:inline for print style sheets, and hide
  4611. " <input> elements for print, to allow Opera printing multiple pages (and
  4612. " other uncopyable areas?). May need to make the new text invisible to IE
  4613. " with conditional comments to prevent copying it, IE for some reason likes
  4614. " to copy hidden text. Other browsers too?
  4615. " * Bug: still a 1px gap throughout the fold column when html_prevent_copy is
  4616. " "fn" in some browsers. Specifically, in Chromium on Ubuntu (but not Chrome
  4617. " on Windows). Perhaps it is font related?
  4618. " * Bug: still some gaps in the fold column when html_prevent_copy contains
  4619. " 'd' and showing the whole diff (observed in multiple browsers). Only gaps
  4620. " on diff lines though.
  4621. " * Undercurl support via CSS3, with fallback to dotted or something:
  4622. " https://groups.google.com/d/topic/vim_use/BzXA6He1pHg/discussion
  4623. " * Redo updates for modified default foldtext (v11) when/if the patch is
  4624. " accepted to modify it.
  4625. " * Test case +diff_one_file-dynamic_folds+expand_tabs-hover_unfold
  4626. " +ignore_conceal-ignore_folding+no_foldcolumn+no_pre+no_progress
  4627. " +number_lines-pre_wrap-use_css+use_xhtml+whole_filler.xhtml
  4628. " does not show the whole diff filler as it is supposed to?
  4629. " * Bug: when 'isprint' is wrong for the current encoding, will generate
  4630. " invalid content. Can/should anything be done about this? Maybe a separate
  4631. " plugin to correct 'isprint' based on encoding?
  4632. " * Check to see if the windows-125\d encodings actually work in Unix without
  4633. " the 8bit- prefix. Add prefix to autoload dictionaries for Unix if not.
  4634. " * Font auto-detection similar to
  4635. " http://www.vim.org/scripts/script.php?script_id=2384 but for a variety of
  4636. " platforms.
  4637. " * Error thrown when sourcing 2html.vim directly when plugins are not loaded.
  4638. " * Pull in code from http://www.vim.org/scripts/script.php?script_id=3113 :
  4639. " - listchars support
  4640. " - full-line background highlight
  4641. " - other?
  4642. " * Make it so deleted lines in a diff don't create side-scrolling (get it
  4643. " free with full-line background highlight above).
  4644. " * Restore open/closed folds and cursor position after processing each file
  4645. " with option not to restore for speed increase.
  4646. " * Add extra meta info (generation time, etc.)?
  4647. " * Tidy up so we can use strict doctype in even more situations
  4648. " * Implementation detail: add threshold for writing the lines to the html
  4649. " buffer before we're done (5000 or so lines should do it)
  4650. " * TODO comments for code cleanup scattered throughout
  4651. "}}}
  4652.  
  4653. 1 0.000007 if exists('g:loaded_2html_plugin')
  4654. finish
  4655. endif
  4656. 1 0.000003 let g:loaded_2html_plugin = 'vim7.4_v2'
  4657.  
  4658. "
  4659. " Changelog: {{{
  4660. " 7.4_v2 (this version): Fix error raised when converting a diff containing
  4661. " an empty buffer. Jan Stocker: allow g:html_font to
  4662. " take a list so it is easier to specfiy fallback
  4663. " fonts in the generated CSS.
  4664. " 7.4_v1 (Vim 7.4.0000): Fix modeline mangling for new "Vim:" format, and
  4665. " also for version-specific modelines like "vim>703:".
  4666. "
  4667. " 7.3 updates: {{{
  4668. " 7.3_v14 (Vim 7.3.1246): Allow suppressing line number anchors using
  4669. " g:html_line_ids=0. Allow customizing
  4670. " important IDs (like line IDs and fold IDs) using
  4671. " g:html_id_expr evalutated when the buffer conversion
  4672. " is started.
  4673. " 7.3_v13 (Vim 7.3.1088): Keep foldmethod at manual in the generated file and
  4674. " insert modeline to set it to manual.
  4675. " Fix bug: diff mode with 2 unsaved buffers creates a
  4676. " duplicate of one buffer instead of including both.
  4677. " Add anchors to each line so you can put '#L123'
  4678. " or '#123' at the end of the URL to jump to line 123
  4679. " (idea by Andy Spencer). Add javascript to open folds
  4680. " to show the anchor being jumped to if it is hidden.
  4681. " Fix XML validation error: &nsbp; not part of XML.
  4682. " Allow TOhtml to chain together with other commands
  4683. " using |.
  4684. " 7.3_v12 (Vim 7.3.0616): Fix modeline mangling to also work for when multiple
  4685. " highlight groups make up the start-of-modeline text.
  4686. " Improve render time of page with uncopyable regions
  4687. " by not using one-input-per-char. Change name of
  4688. " uncopyable option from html_unselectable to
  4689. " html_prevent_copy. Added html_no_invalid option and
  4690. " default to inserting invalid markup for uncopyable
  4691. " regions to prevent MS Word from pasting undeletable
  4692. " <input> elements. Fix 'cpo' handling (Thilo Six).
  4693. " 7.3_v12b1: Add html_unselectable option. Rework logic to
  4694. " eliminate post-processing substitute commands in
  4695. " favor of doing the work up front. Remove unnecessary
  4696. " special treatment of 'LineNr' highlight group. Minor
  4697. " speed improvements. Fix modeline mangling in
  4698. " generated output so it works for text in the first
  4699. " column. Fix missing line number and fold column in
  4700. " diff filler lines. Fix that some fonts have a 1px
  4701. " gap (using a dirty hack, improvements welcome). Add
  4702. " "colorscheme" meta tag. Does NOT include support for
  4703. " the new default foldtext added in v11, as the patch
  4704. " adding it has not yet been included in Vim.
  4705. " 7.3_v11 ( unreleased ): Support new default foldtext from patch by Christian
  4706. " Brabandt in
  4707. " http://groups.google.com/d/topic/vim_dev/B6FSGfq9VoI/discussion.
  4708. " This patch has not yet been included in Vim, thus
  4709. " these changes are removed in the next version.
  4710. " 7.3_v10 (Vim 7.3.0227): Fix error E684 when converting a range wholly inside
  4711. " multiple nested folds with dynamic folding on.
  4712. " Also fix problem with foldtext in this situation.
  4713. " 7.3_v9 (Vim 7.3.0170): Add html_pre_wrap option active with html_use_css
  4714. " and without html_no_pre, default value same as
  4715. " 'wrap' option, (Andy Spencer). Don't use
  4716. " 'fileencoding' for converted document encoding if
  4717. " 'buftype' indicates a special buffer which isn't
  4718. " written.
  4719. " 7.3_v8 (Vim 7.3.0100): Add html_expand_tabs option to allow leaving tab
  4720. " characters in generated output (Andy Spencer).
  4721. " Escape text that looks like a modeline so Vim
  4722. " doesn't use anything in the converted HTML as a
  4723. " modeline. Bugfixes: Fix folding when a fold starts
  4724. " before the conversion range. Remove fold column when
  4725. " there are no folds.
  4726. " 7.3_v7 (Vim 7-3-0063): see betas released on vim_dev below:
  4727. " 7.3_v7b3: Fixed bug, convert Unicode to UTF-8 all the way.
  4728. " 7.3_v7b2: Remove automatic detection of encodings that are not
  4729. " supported by all major browsers according to
  4730. " http://wiki.whatwg.org/wiki/Web_Encodings and
  4731. " convert to UTF-8 for all Unicode encodings. Make
  4732. " HTML encoding to Vim encoding detection be
  4733. " case-insensitive for built-in pairs.
  4734. " 7.3_v7b1: Remove use of setwinvar() function which cannot be
  4735. " called in restricted mode (Andy Spencer). Use
  4736. " 'fencoding' instead of 'encoding' to determine by
  4737. " charset, and make sure the 'fenc' of the generated
  4738. " file matches its indicated charset. Add charsets for
  4739. " all of Vim's natively supported encodings.
  4740. " 7.3_v6 (Vim 7.3.0000): Really fix bug with 'nowrapscan', 'magic' and other
  4741. " user settings interfering with diff mode generation,
  4742. " trailing whitespace (e.g. line number column) when
  4743. " using html_no_pre, and bugs when using
  4744. " html_hover_unfold.
  4745. " 7.3_v5 ( unreleased ): Fix bug with 'nowrapscan' and also with out-of-sync
  4746. " folds in diff mode when first line was folded.
  4747. " 7.3_v4 (Vim 7.3.0000): Bugfixes, especially for xhtml markup, and diff mode
  4748. " 7.3_v3 (Vim 7.3.0000): Refactor option handling and make html_use_css
  4749. " default to true when not set to anything. Use strict
  4750. " doctypes where possible. Rename use_xhtml option to
  4751. " html_use_xhtml for consistency. Use .xhtml extension
  4752. " when using this option. Add meta tag for settings.
  4753. " 7.3_v2 (Vim 7.3.0000): Fix syntax highlighting in diff mode to use both the
  4754. " diff colors and the normal syntax colors
  4755. " 7.3_v1 (Vim 7.3.0000): Add conceal support and meta tags in output
  4756. "}}}
  4757. "}}}
  4758.  
  4759. " Define the :TOhtml command when:
  4760. " - 'compatible' is not set
  4761. " - this plugin was not already loaded
  4762. " - user commands are available. {{{
  4763. 1 0.000014 if !&cp && !exists(":TOhtml") && has("user_commands")
  4764. 1 0.000013 command -range=% -bar TOhtml :call tohtml#Convert2HTML(<line1>, <line2>)
  4765. 1 0.000002 endif "}}}
  4766.  
  4767. " Make sure any patches will probably use consistent indent
  4768. " vim: ts=8 sw=2 sts=2 noet fdm=marker
  4769.  
  4770. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/tutor.vim
  4771. Sourced 1 time
  4772. Total time: 0.000026
  4773. Self time: 0.000026
  4774.  
  4775. count total (s) self (s)
  4776. if exists('g:loaded_tutor_mode_plugin') || &compatible
  4777. finish
  4778. endif
  4779. 1 0.000004 let g:loaded_tutor_mode_plugin = 1
  4780.  
  4781. 1 0.000007 command! -nargs=? -complete=custom,tutor#TutorCmdComplete Tutor call tutor#TutorCmd(<q-args>)
  4782.  
  4783. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/plugin/zipPlugin.vim
  4784. Sourced 1 time
  4785. Total time: 0.000232
  4786. Self time: 0.000232
  4787.  
  4788. count total (s) self (s)
  4789. " zipPlugin.vim: Handles browsing zipfiles
  4790. " PLUGIN PORTION
  4791. " Date: Jun 07, 2013
  4792. " Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
  4793. " License: Vim License (see vim's :help license)
  4794. " Copyright: Copyright (C) 2005-2013 Charles E. Campbell {{{1
  4795. " Permission is hereby granted to use and distribute this code,
  4796. " with or without modifications, provided that this copyright
  4797. " notice is copied with it. Like anything else that's free,
  4798. " zipPlugin.vim is provided *as is* and comes with no warranty
  4799. " of any kind, either expressed or implied. By using this
  4800. " plugin, you agree that in no event will the copyright
  4801. " holder be liable for any damages resulting from the use
  4802. " of this software.
  4803. "
  4804. " (James 4:8 WEB) Draw near to God, and he will draw near to you.
  4805. " Cleanse your hands, you sinners; and purify your hearts, you double-minded.
  4806. " ---------------------------------------------------------------------
  4807. " Load Once: {{{1
  4808. 1 0.000012 if &cp || exists("g:loaded_zipPlugin")
  4809. finish
  4810. endif
  4811. 1 0.000003 let g:loaded_zipPlugin = "v27"
  4812. 1 0.000007 let s:keepcpo = &cpo
  4813. 1 0.000007 set cpo&vim
  4814.  
  4815. " ---------------------------------------------------------------------
  4816. " Options: {{{1
  4817. 1 0.000003 if !exists("g:zipPlugin_ext")
  4818. 1 0.000005 let g:zipPlugin_ext= '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,*.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,*.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm,*.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx'
  4819. 1 0.000001 endif
  4820.  
  4821. " ---------------------------------------------------------------------
  4822. " Public Interface: {{{1
  4823. 1 0.000002 augroup zip
  4824. 1 0.000019 au!
  4825. 1 0.000007 au BufReadCmd zipfile:* call zip#Read(expand("<amatch>"), 1)
  4826. 1 0.000006 au FileReadCmd zipfile:* call zip#Read(expand("<amatch>"), 0)
  4827. 1 0.000003 au BufWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
  4828. 1 0.000003 au FileWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
  4829.  
  4830. 1 0.000003 if has("unix")
  4831. 1 0.000006 au BufReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 1)
  4832. 1 0.000004 au FileReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 0)
  4833. 1 0.000006 au BufWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
  4834. 1 0.000004 au FileWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
  4835. 1 0.000001 endif
  4836.  
  4837. 1 0.000068 exe "au BufReadCmd ".g:zipPlugin_ext.' call zip#Browse(expand("<amatch>"))'
  4838. 1 0.000001 augroup END
  4839.  
  4840. " ---------------------------------------------------------------------
  4841. " Restoration And Modelines: {{{1
  4842. " vim: fdm=marker
  4843. 1 0.000008 let &cpo= s:keepcpo
  4844. 1 0.000003 unlet s:keepcpo
  4845.  
  4846. SCRIPT /data/roxma/test/starttime/plugin/bar.vim
  4847. Sourced 1 time
  4848. Total time: 0.000019
  4849. Self time: 0.000019
  4850.  
  4851. count total (s) self (s)
  4852.  
  4853. 1 0.000006 func s:foo()
  4854. call foo#bar()
  4855. endfunc
  4856.  
  4857. 1 0.000005 au BufWinEnter * call s:foo()
  4858.  
  4859. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/autoload/remote/host.vim
  4860. Sourced 1 time
  4861. Total time: 0.000481
  4862. Self time: 0.000405
  4863.  
  4864. count total (s) self (s)
  4865. let s:hosts = {}
  4866. 1 0.000004 let s:plugin_patterns = {}
  4867. 1 0.000002 let s:plugins_for_host = {}
  4868.  
  4869.  
  4870. " Register a host by associating it with a factory(funcref)
  4871. 1 0.000006 function! remote#host#Register(name, pattern, factory) abort
  4872. let s:hosts[a:name] = {'factory': a:factory, 'channel': 0, 'initialized': 0}
  4873. let s:plugin_patterns[a:name] = a:pattern
  4874. if type(a:factory) == type(1) && a:factory
  4875. " Passed a channel directly
  4876. let s:hosts[a:name].channel = a:factory
  4877. endif
  4878. endfunction
  4879.  
  4880.  
  4881. " Register a clone to an existing host. The new host will use the same factory
  4882. " as `source`, but it will run as a different process. This can be used by
  4883. " plugins that should run isolated from other plugins created for the same host
  4884. " type
  4885. 1 0.000004 function! remote#host#RegisterClone(name, orig_name) abort
  4886. if !has_key(s:hosts, a:orig_name)
  4887. throw 'No host named "'.a:orig_name.'" is registered'
  4888. endif
  4889. let Factory = s:hosts[a:orig_name].factory
  4890. let s:hosts[a:name] = {
  4891. \ 'factory': Factory,
  4892. \ 'channel': 0,
  4893. \ 'initialized': 0,
  4894. \ 'orig_name': a:orig_name
  4895. \ }
  4896. endfunction
  4897.  
  4898.  
  4899. " Get a host channel, bootstrapping it if necessary
  4900. 1 0.000003 function! remote#host#Require(name) abort
  4901. if empty(s:plugins_for_host)
  4902. call remote#host#LoadRemotePlugins()
  4903. endif
  4904. if !has_key(s:hosts, a:name)
  4905. throw 'No host named "'.a:name.'" is registered'
  4906. endif
  4907. let host = s:hosts[a:name]
  4908. if !host.channel && !host.initialized
  4909. let host_info = {
  4910. \ 'name': a:name,
  4911. \ 'orig_name': get(host, 'orig_name', a:name)
  4912. \ }
  4913. let host.channel = call(host.factory, [host_info])
  4914. let host.initialized = 1
  4915. endif
  4916. return host.channel
  4917. endfunction
  4918.  
  4919.  
  4920. 1 0.000003 function! remote#host#IsRunning(name) abort
  4921. if !has_key(s:hosts, a:name)
  4922. throw 'No host named "'.a:name.'" is registered'
  4923. endif
  4924. return s:hosts[a:name].channel != 0
  4925. endfunction
  4926.  
  4927.  
  4928. " Example of registering a Python plugin with two commands (one async), one
  4929. " autocmd (async) and one function (sync):
  4930. "
  4931. " let s:plugin_path = expand('<sfile>:p:h').'/nvim_plugin.py'
  4932. " call remote#host#RegisterPlugin('python', s:plugin_path, [
  4933. " \ {'type': 'command', 'name': 'PyCmd', 'sync': 1, 'opts': {}},
  4934. " \ {'type': 'command', 'name': 'PyAsyncCmd', 'sync': 0, 'opts': {'eval': 'cursor()'}},
  4935. " \ {'type': 'autocmd', 'name': 'BufEnter', 'sync': 0, 'opts': {'eval': 'expand("<afile>")'}},
  4936. " \ {'type': 'function', 'name': 'PyFunc', 'sync': 1, 'opts': {}}
  4937. " \ ])
  4938. "
  4939. " The third item in a declaration is a boolean: non zero means the command,
  4940. " autocommand or function will be executed synchronously with rpcrequest.
  4941. 1 0.000004 function! remote#host#RegisterPlugin(host, path, specs) abort
  4942. let plugins = remote#host#PluginsForHost(a:host)
  4943.  
  4944. for plugin in plugins
  4945. if plugin.path == a:path
  4946. throw 'Plugin "'.a:path.'" is already registered'
  4947. endif
  4948. endfor
  4949.  
  4950. if has_key(s:hosts, a:host) && remote#host#IsRunning(a:host)
  4951. " For now we won't allow registration of plugins when the host is already
  4952. " running.
  4953. throw 'Host "'.a:host.'" is already running'
  4954. endif
  4955.  
  4956. for spec in a:specs
  4957. let type = spec.type
  4958. let name = spec.name
  4959. let sync = spec.sync
  4960. let opts = spec.opts
  4961. let rpc_method = a:path
  4962. if type == 'command'
  4963. let rpc_method .= ':command:'.name
  4964. call remote#define#CommandOnHost(a:host, rpc_method, sync, name, opts)
  4965. elseif type == 'autocmd'
  4966. " Since multiple handlers can be attached to the same autocmd event by a
  4967. " single plugin, we need a way to uniquely identify the rpc method to
  4968. " call. The solution is to append the autocmd pattern to the method
  4969. " name(This still has a limit: one handler per event/pattern combo, but
  4970. " there's no need to allow plugins define multiple handlers in that case)
  4971. let rpc_method .= ':autocmd:'.name.':'.get(opts, 'pattern', '*')
  4972. call remote#define#AutocmdOnHost(a:host, rpc_method, sync, name, opts)
  4973. elseif type == 'function'
  4974. let rpc_method .= ':function:'.name
  4975. call remote#define#FunctionOnHost(a:host, rpc_method, sync, name, opts)
  4976. else
  4977. echoerr 'Invalid declaration type: '.type
  4978. endif
  4979. endfor
  4980.  
  4981. call add(plugins, {'path': a:path, 'specs': a:specs})
  4982. endfunction
  4983.  
  4984.  
  4985. " Get the path to the rplugin manifest file.
  4986. 1 0.000006 function! s:GetManifestPath() abort
  4987. let manifest_base = ''
  4988.  
  4989. if exists('$NVIM_RPLUGIN_MANIFEST')
  4990. return fnamemodify($NVIM_RPLUGIN_MANIFEST, ':p')
  4991. endif
  4992.  
  4993. let dest = has('win32') ? '$LOCALAPPDATA' : '$XDG_DATA_HOME'
  4994. if !exists(dest)
  4995. let dest = has('win32') ? '~/AppData/Local' : '~/.local/share'
  4996. endif
  4997.  
  4998. let dest = fnamemodify(expand(dest), ':p')
  4999. if !empty(dest) && !filereadable(dest)
  5000. let dest .= ('/' ==# dest[-1:] ? '' : '/') . 'nvim'
  5001. call mkdir(dest, 'p', 0700)
  5002. let manifest_base = dest
  5003. endif
  5004.  
  5005. return manifest_base.'/rplugin.vim'
  5006. endfunction
  5007.  
  5008.  
  5009. " Old manifest file based on known script locations.
  5010. 1 0.000004 function! s:GetOldManifestPath() abort
  5011. let prefix = exists('$MYVIMRC')
  5012. \ ? $MYVIMRC
  5013. \ : matchstr(get(split(execute('scriptnames'), '\n'), 0, ''), '\f\+$')
  5014. return fnamemodify(expand(prefix, 1), ':h')
  5015. \.'/.'.fnamemodify(prefix, ':t').'-rplugin~'
  5016. endfunction
  5017.  
  5018.  
  5019. 1 0.000002 function! s:GetManifest() abort
  5020. let manifest = s:GetManifestPath()
  5021.  
  5022. if !filereadable(manifest)
  5023. " Check if an old manifest file exists and move it to the new location.
  5024. let old_manifest = s:GetOldManifestPath()
  5025. if filereadable(old_manifest)
  5026. call rename(old_manifest, manifest)
  5027. endif
  5028. endif
  5029.  
  5030. return manifest
  5031. endfunction
  5032.  
  5033.  
  5034. 1 0.000002 function! remote#host#LoadRemotePlugins() abort
  5035. let manifest = s:GetManifest()
  5036. if filereadable(manifest)
  5037. execute 'source' fnameescape(manifest)
  5038. endif
  5039. endfunction
  5040.  
  5041.  
  5042. 1 0.000003 function! remote#host#LoadRemotePluginsEvent(event, pattern) abort
  5043. autocmd! nvim-rplugin
  5044. call remote#host#LoadRemotePlugins()
  5045. if exists('#'.a:event.'#'.a:pattern) " Avoid 'No matching autocommands'.
  5046. execute 'silent doautocmd <nomodeline>' a:event a:pattern
  5047. endif
  5048. endfunction
  5049.  
  5050.  
  5051. 1 0.000002 function! s:RegistrationCommands(host) abort
  5052. " Register a temporary host clone for discovering specs
  5053. let host_id = a:host.'-registration-clone'
  5054. call remote#host#RegisterClone(host_id, a:host)
  5055. let pattern = s:plugin_patterns[a:host]
  5056. let paths = globpath(&rtp, 'rplugin/'.a:host.'/'.pattern, 0, 1)
  5057. let paths = map(paths, 'tr(resolve(v:val),"\\","/")') " Normalize slashes #4795
  5058. let paths = uniq(sort(paths))
  5059. if empty(paths)
  5060. return []
  5061. endif
  5062.  
  5063. for path in paths
  5064. call remote#host#RegisterPlugin(host_id, path, [])
  5065. endfor
  5066. let channel = remote#host#Require(host_id)
  5067. let lines = []
  5068. let registered = []
  5069. for path in paths
  5070. unlet! specs
  5071. let specs = rpcrequest(channel, 'specs', path)
  5072. if type(specs) != type([])
  5073. " host didn't return a spec list, indicates a failure while loading a
  5074. " plugin
  5075. continue
  5076. endif
  5077. call add(lines, "call remote#host#RegisterPlugin('".a:host
  5078. \ ."', '".path."', [")
  5079. for spec in specs
  5080. call add(lines, " \\ ".string(spec).",")
  5081. endfor
  5082. call add(lines, " \\ ])")
  5083. call add(registered, path)
  5084. endfor
  5085. echomsg printf("remote/host: %s host registered plugins %s",
  5086. \ a:host, string(map(registered, "fnamemodify(v:val, ':t')")))
  5087.  
  5088. " Delete the temporary host clone
  5089. call rpcstop(s:hosts[host_id].channel)
  5090. call remove(s:hosts, host_id)
  5091. call remove(s:plugins_for_host, host_id)
  5092. return lines
  5093. endfunction
  5094.  
  5095.  
  5096. 1 0.000004 function! remote#host#UpdateRemotePlugins() abort
  5097. let commands = []
  5098. let hosts = keys(s:hosts)
  5099. for host in hosts
  5100. if has_key(s:plugin_patterns, host)
  5101. try
  5102. let commands +=
  5103. \ ['" '.host.' plugins']
  5104. \ + s:RegistrationCommands(host)
  5105. \ + ['', '']
  5106. catch
  5107. echomsg v:throwpoint
  5108. echomsg v:exception
  5109. endtry
  5110. endif
  5111. endfor
  5112. call writefile(commands, s:GetManifest())
  5113. echomsg printf('remote/host: generated rplugin manifest: %s',
  5114. \ s:GetManifest())
  5115. endfunction
  5116.  
  5117.  
  5118. 1 0.000002 function! remote#host#PluginsForHost(host) abort
  5119. if !has_key(s:plugins_for_host, a:host)
  5120. let s:plugins_for_host[a:host] = []
  5121. end
  5122. return s:plugins_for_host[a:host]
  5123. endfunction
  5124.  
  5125.  
  5126. 1 0.000004 function! remote#host#LoadErrorForHost(host, log) abort
  5127. return 'Failed to load '. a:host . ' host. '.
  5128. \ 'You can try to see what happened by starting nvim with '.
  5129. \ a:log . ' set and opening the generated log file.'.
  5130. \ ' Also, the host stderr is available in messages.'
  5131. endfunction
  5132.  
  5133.  
  5134. " Registration of standard hosts
  5135.  
  5136. " Python/Python3
  5137. 1 0.000065 0.000028 call remote#host#Register('python', '*',
  5138. \ function('provider#pythonx#Require'))
  5139. 1 0.000032 0.000011 call remote#host#Register('python3', '*',
  5140. \ function('provider#pythonx#Require'))
  5141.  
  5142. " Ruby
  5143. 1 0.000028 0.000009 call remote#host#Register('ruby', '*.rb',
  5144.  
  5145. SCRIPT /data/roxma/.local/share/nvim/rplugin.vim
  5146. Sourced 1 time
  5147. Total time: 0.004597
  5148. Self time: 0.000154
  5149.  
  5150. count total (s) self (s)
  5151. " python3 plugins
  5152. 1 0.004376 0.000125 call remote#host#RegisterPlugin('python3', '/data/roxma/.local_software/neovim/plugged/LanguageClient-neovim/rplugin/python3/LanguageClient', [
  5153. \ {'sync': v:true, 'name': 'LanguageClient_alive', 'type': 'function', 'opts': {}},
  5154. \ {'sync': v:false, 'name': 'LanguageClient_completionItem/resolve', 'type': 'function', 'opts': {}},
  5155. \ {'sync': v:false, 'name': 'LanguageClient_completionManager_refresh', 'type': 'function', 'opts': {}},
  5156. \ {'sync': v:false, 'name': 'LanguageClient_exit', 'type': 'function', 'opts': {}},
  5157. \ {'sync': v:false, 'name': 'LanguageClient_FZFSinkTextDocumentDocumentSymbol', 'type': 'function', 'opts': {}},
  5158. \ {'sync': v:false, 'name': 'LanguageClient_FZFSinkTextDocumentReferences', 'type': 'function', 'opts': {}},
  5159. \ {'sync': v:false, 'name': 'LanguageClient_FZFSinkWorkspaceSymbol', 'type': 'function', 'opts': {}},
  5160. \ {'sync': v:false, 'name': 'CursorMoved', 'type': 'autocmd', 'opts': {'pattern': '*'}},
  5161. \ {'sync': v:false, 'name': 'LanguageClient_initialize', 'type': 'function', 'opts': {}},
  5162. \ {'sync': v:false, 'name': 'LanguageClient_registerServerCommands', 'type': 'function', 'opts': {}},
  5163. \ {'sync': v:false, 'name': 'LanguageClient_setLoggingLevel', 'type': 'function', 'opts': {}},
  5164. \ {'sync': v:false, 'name': 'LanguageClientStart', 'type': 'command', 'opts': {}},
  5165. \ {'sync': v:false, 'name': 'LanguageClientStop', 'type': 'command', 'opts': {}},
  5166. \ {'sync': v:false, 'name': 'TextChanged', 'type': 'autocmd', 'opts': {'pattern': '*'}},
  5167. \ {'sync': v:false, 'name': 'TextChangedI', 'type': 'autocmd', 'opts': {'pattern': '*'}},
  5168. \ {'sync': v:false, 'name': 'LanguageClient_textDocument_completion', 'type': 'function', 'opts': {}},
  5169. \ {'sync': v:false, 'name': 'LanguageClient_textDocument_definition', 'type': 'function', 'opts': {}},
  5170. \ {'sync': v:false, 'name': 'LanguageClient_textDocument_didClose', 'type': 'function', 'opts': {}},
  5171. \ {'sync': v:false, 'name': 'BufReadPost', 'type': 'autocmd', 'opts': {'pattern': '*'}},
  5172. \ {'sync': v:false, 'name': 'BufWritePost', 'type': 'autocmd', 'opts': {'pattern': '*'}},
  5173. \ {'sync': v:false, 'name': 'LanguageClient_textDocument_documentSymbol', 'type': 'function', 'opts': {}},
  5174. \ {'sync': v:false, 'name': 'LanguageClient_textDocument_hover', 'type': 'function', 'opts': {}},
  5175. \ {'sync': v:false, 'name': 'LanguageClient_textDocument_references', 'type': 'function', 'opts': {}},
  5176. \ {'sync': v:false, 'name': 'LanguageClient_textDocument_rename', 'type': 'function', 'opts': {}},
  5177. \ {'sync': v:false, 'name': 'LanguageClient_textDocument_signatureHelp', 'type': 'function', 'opts': {}},
  5178. \ {'sync': v:false, 'name': 'LanguageClient_workspace_symbol', 'type': 'function', 'opts': {}},
  5179. \ ])
  5180. 1 0.000206 0.000014 call remote#host#RegisterPlugin('python3', '/data/roxma/.local_software/neovim/plugged/deoplete.nvim/rplugin/python3/deoplete', [
  5181. \ {'sync': v:true, 'name': '_deoplete', 'type': 'function', 'opts': {}},
  5182. \ ])
  5183.  
  5184.  
  5185. " ruby plugins
  5186.  
  5187.  
  5188. " python plugins
  5189.  
  5190.  
  5191.  
  5192. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/autoload/remote/define.vim
  5193. Sourced 1 time
  5194. Total time: 0.000277
  5195. Self time: 0.000277
  5196.  
  5197. count total (s) self (s)
  5198. function! remote#define#CommandOnHost(host, method, sync, name, opts)
  5199. let prefix = ''
  5200.  
  5201. if has_key(a:opts, 'range')
  5202. if a:opts.range == '' || a:opts.range == '%'
  5203. " -range or -range=%, pass the line range in a list
  5204. let prefix = '<line1>,<line2>'
  5205. elseif matchstr(a:opts.range, '\d') != ''
  5206. " -range=N, pass the count
  5207. let prefix = '<count>'
  5208. endif
  5209. elseif has_key(a:opts, 'count')
  5210. let prefix = '<count>'
  5211. endif
  5212.  
  5213. let forward_args = [prefix.a:name]
  5214.  
  5215. if has_key(a:opts, 'bang')
  5216. call add(forward_args, '<bang>')
  5217. endif
  5218.  
  5219. if has_key(a:opts, 'register')
  5220. call add(forward_args, ' <register>')
  5221. endif
  5222.  
  5223. if has_key(a:opts, 'nargs')
  5224. call add(forward_args, ' <args>')
  5225. endif
  5226.  
  5227. exe s:GetCommandPrefix(a:name, a:opts)
  5228. \ .' call remote#define#CommandBootstrap("'.a:host.'"'
  5229. \ . ', "'.a:method.'"'
  5230. \ . ', '.string(a:sync)
  5231. \ . ', "'.a:name.'"'
  5232. \ . ', '.string(a:opts).''
  5233. \ . ', "'.join(forward_args, '').'"'
  5234. \ . ')'
  5235. endfunction
  5236.  
  5237.  
  5238. 1 0.000004 function! remote#define#CommandBootstrap(host, method, sync, name, opts, forward)
  5239. let channel = remote#host#Require(a:host)
  5240.  
  5241. if channel
  5242. call remote#define#CommandOnChannel(channel, a:method, a:sync, a:name, a:opts)
  5243. exe a:forward
  5244. else
  5245. exe 'delcommand '.a:name
  5246. echoerr 'Host "'a:host.'" is not available, deleting command "'.a:name.'"'
  5247. endif
  5248. endfunction
  5249.  
  5250.  
  5251. 1 0.000003 function! remote#define#CommandOnChannel(channel, method, sync, name, opts)
  5252. let rpcargs = [a:channel, '"'.a:method.'"']
  5253. if has_key(a:opts, 'nargs')
  5254. " -nargs, pass arguments in a list
  5255. call add(rpcargs, '[<f-args>]')
  5256. endif
  5257.  
  5258. if has_key(a:opts, 'range')
  5259. if a:opts.range == '' || a:opts.range == '%'
  5260. " -range or -range=%, pass the line range in a list
  5261. call add(rpcargs, '[<line1>, <line2>]')
  5262. elseif matchstr(a:opts.range, '\d') != ''
  5263. " -range=N, pass the count
  5264. call add(rpcargs, '<count>')
  5265. endif
  5266. elseif has_key(a:opts, 'count')
  5267. " count
  5268. call add(rpcargs, '<count>')
  5269. endif
  5270.  
  5271. if has_key(a:opts, 'bang')
  5272. " bang
  5273. call add(rpcargs, '<q-bang> == "!"')
  5274. endif
  5275.  
  5276. if has_key(a:opts, 'register')
  5277. " register
  5278. call add(rpcargs, '<q-reg>')
  5279. endif
  5280.  
  5281. call s:AddEval(rpcargs, a:opts)
  5282. exe s:GetCommandPrefix(a:name, a:opts)
  5283. \ . ' call '.s:GetRpcFunction(a:sync).'('.join(rpcargs, ', ').')'
  5284. endfunction
  5285.  
  5286.  
  5287. 1 0.000005 function! remote#define#AutocmdOnHost(host, method, sync, name, opts)
  5288. let group = s:GetNextAutocmdGroup()
  5289. let forward = '"doau '.group.' '.a:name.' ".'.'expand("<amatch>")'
  5290. let a:opts.group = group
  5291. let bootstrap_def = s:GetAutocmdPrefix(a:name, a:opts)
  5292. \ .' call remote#define#AutocmdBootstrap("'.a:host.'"'
  5293. \ . ', "'.a:method.'"'
  5294. \ . ', '.string(a:sync)
  5295. \ . ', "'.a:name.'"'
  5296. \ . ', '.string(a:opts).''
  5297. \ . ', "'.escape(forward, '"').'"'
  5298. \ . ')'
  5299. exe bootstrap_def
  5300. endfunction
  5301.  
  5302.  
  5303. 1 0.000004 function! remote#define#AutocmdBootstrap(host, method, sync, name, opts, forward)
  5304. let channel = remote#host#Require(a:host)
  5305.  
  5306. exe 'autocmd! '.a:opts.group
  5307. if channel
  5308. call remote#define#AutocmdOnChannel(channel, a:method, a:sync, a:name,
  5309. \ a:opts)
  5310. exe eval(a:forward)
  5311. else
  5312. exe 'augroup! '.a:opts.group
  5313. echoerr 'Host "'a:host.'" for "'.a:name.'" autocmd is not available'
  5314. endif
  5315. endfunction
  5316.  
  5317.  
  5318. 1 0.000002 function! remote#define#AutocmdOnChannel(channel, method, sync, name, opts)
  5319. let rpcargs = [a:channel, '"'.a:method.'"']
  5320. call s:AddEval(rpcargs, a:opts)
  5321.  
  5322. let autocmd_def = s:GetAutocmdPrefix(a:name, a:opts)
  5323. \ . ' call '.s:GetRpcFunction(a:sync).'('.join(rpcargs, ', ').')'
  5324. exe autocmd_def
  5325. endfunction
  5326.  
  5327.  
  5328. 1 0.000002 function! remote#define#FunctionOnHost(host, method, sync, name, opts)
  5329. let group = s:GetNextAutocmdGroup()
  5330. exe 'autocmd! '.group.' FuncUndefined '.a:name
  5331. \ .' call remote#define#FunctionBootstrap("'.a:host.'"'
  5332. \ . ', "'.a:method.'"'
  5333. \ . ', '.string(a:sync)
  5334. \ . ', "'.a:name.'"'
  5335. \ . ', '.string(a:opts)
  5336. \ . ', "'.group.'"'
  5337. \ . ')'
  5338. endfunction
  5339.  
  5340.  
  5341. 1 0.000003 function! remote#define#FunctionBootstrap(host, method, sync, name, opts, group)
  5342. let channel = remote#host#Require(a:host)
  5343.  
  5344. exe 'autocmd! '.a:group
  5345. exe 'augroup! '.a:group
  5346. if channel
  5347. call remote#define#FunctionOnChannel(channel, a:method, a:sync, a:name,
  5348. \ a:opts)
  5349. else
  5350. echoerr 'Host "'a:host.'" for "'.a:name.'" function is not available'
  5351. endif
  5352. endfunction
  5353.  
  5354.  
  5355. 1 0.000003 function! remote#define#FunctionOnChannel(channel, method, sync, name, opts)
  5356. let rpcargs = [a:channel, '"'.a:method.'"', 'a:000']
  5357. if has_key(a:opts, 'range')
  5358. call add(rpcargs, '[a:firstline, a:lastline]')
  5359. endif
  5360. call s:AddEval(rpcargs, a:opts)
  5361.  
  5362. let function_def = s:GetFunctionPrefix(a:name, a:opts)
  5363. \ . 'return '.s:GetRpcFunction(a:sync).'('.join(rpcargs, ', ').')'
  5364. \ . "\nendfunction"
  5365. exe function_def
  5366. endfunction
  5367.  
  5368.  
  5369. 1 0.000003 function! s:GetRpcFunction(sync)
  5370. if a:sync
  5371. return 'rpcrequest'
  5372. endif
  5373. return 'rpcnotify'
  5374. endfunction
  5375.  
  5376.  
  5377. 1 0.000004 function! s:GetCommandPrefix(name, opts)
  5378. return 'command!'.s:StringifyOpts(a:opts, ['nargs', 'complete', 'range',
  5379. \ 'count', 'bang', 'bar', 'register']).' '.a:name
  5380. endfunction
  5381.  
  5382.  
  5383. " Each msgpack-rpc autocommand has it's own unique group, which is derived
  5384. " from an autoincrementing gid(group id). This is required for replacing the
  5385. " autocmd implementation with the lazy-load mechanism
  5386. 1 0.000005 let s:next_gid = 1
  5387. 1 0.000004 function! s:GetNextAutocmdGroup()
  5388. let gid = s:next_gid
  5389. let s:next_gid += 1
  5390.  
  5391. let group_name = 'RPC_DEFINE_AUTOCMD_GROUP_'.gid
  5392. " Ensure the group is defined
  5393. exe 'augroup '.group_name.' | augroup END'
  5394. return group_name
  5395. endfunction
  5396.  
  5397.  
  5398. 1 0.000002 function! s:GetAutocmdPrefix(name, opts)
  5399. if has_key(a:opts, 'group')
  5400. let group = a:opts.group
  5401. else
  5402. let group = s:GetNextAutocmdGroup()
  5403. endif
  5404. let rv = ['autocmd!', group, a:name]
  5405.  
  5406. if has_key(a:opts, 'pattern')
  5407. call add(rv, a:opts.pattern)
  5408. else
  5409. call add(rv, '*')
  5410. endif
  5411.  
  5412. if has_key(a:opts, 'nested') && a:opts.nested
  5413. call add(rv, 'nested')
  5414. endif
  5415.  
  5416. return join(rv, ' ')
  5417. endfunction
  5418.  
  5419.  
  5420. 1 0.000002 function! s:GetFunctionPrefix(name, opts)
  5421. let res = "function! ".a:name."(...)"
  5422. if has_key(a:opts, 'range')
  5423. let res = res." range"
  5424. endif
  5425. return res."\n"
  5426. endfunction
  5427.  
  5428.  
  5429. 1 0.000002 function! s:StringifyOpts(opts, keys)
  5430. let rv = []
  5431. for key in a:keys
  5432. if has_key(a:opts, key)
  5433. call add(rv, ' -'.key)
  5434. let val = a:opts[key]
  5435. if type(val) != type('') || val != ''
  5436. call add(rv, '='.val)
  5437. endif
  5438. endif
  5439. endfor
  5440. return join(rv, '')
  5441. endfunction
  5442.  
  5443.  
  5444. 1 0.000002 function! s:AddEval(rpcargs, opts)
  5445. if has_key(a:opts, 'eval')
  5446. if type(a:opts.eval) != type('') || a:opts.eval == ''
  5447. throw "Eval option must be a non-empty string"
  5448. endif
  5449. " evaluate an expression and pass as argument
  5450. call add(a:rpcargs, 'eval("'.escape(a:opts.eval, '"').'")')
  5451. endif
  5452. endfunction
  5453.  
  5454. SCRIPT /data/roxma/test/starttime/autoload/foo.vim
  5455. Sourced 1 time
  5456. Total time: 0.000014
  5457. Self time: 0.000014
  5458.  
  5459. count total (s) self (s)
  5460.  
  5461. 1 0.000005 fun foo#bar()
  5462. echo 'hi'
  5463. endf
  5464.  
  5465.  
  5466. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/autoload/provider/pythonx.vim
  5467. Sourced 1 time
  5468. Total time: 0.000127
  5469. Self time: 0.000127
  5470.  
  5471. count total (s) self (s)
  5472. " The Python provider helper
  5473. 1 0.000005 if exists('s:loaded_pythonx_provider')
  5474. finish
  5475. endif
  5476.  
  5477. 1 0.000003 let s:loaded_pythonx_provider = 1
  5478.  
  5479. 1 0.000004 let s:stderr = {}
  5480. 1 0.000003 let s:job_opts = {'rpc': v:true}
  5481.  
  5482. " TODO(bfredl): this logic is common and should be builtin
  5483. 1 0.000003 function! s:job_opts.on_stderr(chan_id, data, event)
  5484. let stderr = get(s:stderr, a:chan_id, [''])
  5485. let last = remove(stderr, -1)
  5486. let a:data[0] = last.a:data[0]
  5487. call extend(stderr, a:data)
  5488. let s:stderr[a:chan_id] = stderr
  5489. endfunction
  5490.  
  5491. 1 0.000003 function! provider#pythonx#Require(host) abort
  5492. let ver = (a:host.orig_name ==# 'python') ? 2 : 3
  5493.  
  5494. " Python host arguments
  5495. let prog = (ver == '2' ? provider#python#Prog() : provider#python3#Prog())
  5496. let args = [prog, '-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
  5497.  
  5498. " Collect registered Python plugins into args
  5499. let python_plugins = remote#host#PluginsForHost(a:host.name)
  5500. for plugin in python_plugins
  5501. call add(args, plugin.path)
  5502. endfor
  5503.  
  5504. try
  5505. let channel_id = jobstart(args, s:job_opts)
  5506. if rpcrequest(channel_id, 'poll') ==# 'ok'
  5507. return channel_id
  5508. endif
  5509. catch
  5510. echomsg v:throwpoint
  5511. echomsg v:exception
  5512. for row in get(s:stderr, channel_id, [])
  5513. echomsg row
  5514. endfor
  5515. endtry
  5516. throw remote#host#LoadErrorForHost(a:host.orig_name,
  5517. \ '$NVIM_PYTHON_LOG_FILE')
  5518. endfunction
  5519.  
  5520. 1 0.000003 function! provider#pythonx#Detect(major_ver) abort
  5521. if a:major_ver == 2
  5522. if exists('g:python_host_prog')
  5523. return [g:python_host_prog, '']
  5524. else
  5525. let progs = ['python2', 'python2.7', 'python2.6', 'python']
  5526. endif
  5527. else
  5528. if exists('g:python3_host_prog')
  5529. return [g:python3_host_prog, '']
  5530. else
  5531. let progs = ['python3', 'python3.7', 'python3.6', 'python3.5',
  5532. \ 'python3.4', 'python3.3', 'python']
  5533. endif
  5534. endif
  5535.  
  5536. let errors = []
  5537.  
  5538. for prog in progs
  5539. let [result, err] = s:check_interpreter(prog, a:major_ver)
  5540. if result
  5541. return [prog, err]
  5542. endif
  5543. " Accumulate errors in case we don't find
  5544. " any suitable Python interpreter.
  5545. call add(errors, err)
  5546. endfor
  5547.  
  5548. " No suitable Python interpreter found.
  5549. return ['', 'provider/pythonx: Could not load Python ' . a:major_ver
  5550. \ . ":\n" . join(errors, "\n")]
  5551. endfunction
  5552.  
  5553. 1 0.000003 function! s:check_interpreter(prog, major_ver) abort
  5554. let prog_path = exepath(a:prog)
  5555. if prog_path ==# ''
  5556. return [0, a:prog . ' not found in search path or not executable.']
  5557. endif
  5558.  
  5559. let min_version = (a:major_ver == 2) ? '2.6' : '3.3'
  5560.  
  5561. " Try to load neovim module, and output Python version.
  5562. " Return codes:
  5563. " 0 Neovim module can be loaded.
  5564. " 2 Neovim module cannot be loaded.
  5565. " Otherwise something else went wrong (e.g. 1 or 127).
  5566. let prog_ver = system([ a:prog , '-c' ,
  5567. \ 'import sys; ' .
  5568. \ 'sys.path.remove(""); ' .
  5569. \ 'sys.stdout.write(str(sys.version_info[0]) + "." + str(sys.version_info[1])); ' .
  5570. \ 'import pkgutil; ' .
  5571. \ 'exit(2*int(pkgutil.get_loader("neovim") is None))'
  5572. \ ])
  5573.  
  5574. if v:shell_error == 2 || v:shell_error == 0
  5575. " Check version only for expected return codes.
  5576. if prog_ver !~ '^' . a:major_ver
  5577. return [0, prog_path . ' is Python ' . prog_ver . ' and cannot provide Python '
  5578. \ . a:major_ver . '.']
  5579. elseif prog_ver =~ '^' . a:major_ver && prog_ver < min_version
  5580. return [0, prog_path . ' is Python ' . prog_ver . ' and cannot provide Python >= '
  5581. \ . min_version . '.']
  5582. endif
  5583. endif
  5584.  
  5585. if v:shell_error == 2
  5586. return [0, prog_path . ' does not have the neovim module installed. '
  5587. \ . 'See ":help provider-python".']
  5588. elseif v:shell_error == 127
  5589. " This can happen with pyenv's shims.
  5590. return [0, prog_path . ' does not exist: ' . prog_ver]
  5591. elseif v:shell_error
  5592. return [0, 'Checking ' . prog_path . ' caused an unknown error. '
  5593. \ . '(' . v:shell_error . ', output: ' . prog_ver . ')'
  5594. \ . ' Please report this at github.com/neovim/neovim.']
  5595. endif
  5596.  
  5597. return [1, '']
  5598. endfunction
  5599.  
  5600. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/autoload/provider/python3.vim
  5601. Sourced 1 time
  5602. Total time: 0.046328
  5603. Self time: 0.000177
  5604.  
  5605. count total (s) self (s)
  5606. " The Python3 provider uses a Python3 host to emulate an environment for running
  5607. " python3 plugins. See ":help provider".
  5608. "
  5609. " Associating the plugin with the Python3 host is the first step because
  5610. " plugins will be passed as command-line arguments
  5611.  
  5612. 1 0.000006 if exists('g:loaded_python3_provider')
  5613. finish
  5614. endif
  5615. 1 0.000004 let g:loaded_python3_provider = 1
  5616.  
  5617. 1 0.045829 0.000019 let [s:prog, s:err] = provider#pythonx#Detect(3)
  5618.  
  5619. 1 0.000009 function! provider#python3#Prog()
  5620. return s:prog
  5621. endfunction
  5622.  
  5623. 1 0.000004 function! provider#python3#Error()
  5624. return s:err
  5625. endfunction
  5626.  
  5627. 1 0.000003 if s:prog == ''
  5628. " Detection failed
  5629. finish
  5630. endif
  5631.  
  5632. " The Python3 provider plugin will run in a separate instance of the Python3
  5633. " host.
  5634. 1 0.000073 0.000029 call remote#host#RegisterClone('legacy-python3-provider', 'python3')
  5635. 1 0.000307 0.000011 call remote#host#RegisterPlugin('legacy-python3-provider', 'script_host.py', [])
  5636.  
  5637. 1 0.000007 function! provider#python3#Call(method, args)
  5638. if s:err != ''
  5639. return
  5640. endif
  5641. if !exists('s:host')
  5642. let s:rpcrequest = function('rpcrequest')
  5643.  
  5644. " Ensure that we can load the Python3 host before bootstrapping
  5645. try
  5646. let s:host = remote#host#Require('legacy-python3-provider')
  5647. catch
  5648. let s:err = v:exception
  5649. echohl WarningMsg
  5650. echomsg v:exception
  5651. echohl None
  5652. return
  5653. endtry
  5654. endif
  5655. return call(s:rpcrequest, insert(insert(a:args, 'python_'.a:method), s:host))
  5656. endfunction
  5657.  
  5658. SCRIPT /data/roxma/.local_software/neovim_master/share/nvim/runtime/scripts.vim
  5659. Sourced 1 time
  5660. Total time: 0.000699
  5661. Self time: 0.000699
  5662.  
  5663. count total (s) self (s)
  5664. " Vim support file to detect file types in scripts
  5665. "
  5666. " Maintainer: Bram Moolenaar <Bram@vim.org>
  5667. " Last change: 2016 May 21
  5668.  
  5669. " This file is called by an autocommand for every file that has just been
  5670. " loaded into a buffer. It checks if the type of file can be recognized by
  5671. " the file contents. The autocommand is in $VIMRUNTIME/filetype.vim.
  5672.  
  5673.  
  5674. " Only do the rest when the FileType autocommand has not been triggered yet.
  5675. 1 0.000005 if did_filetype()
  5676. finish
  5677. endif
  5678.  
  5679. " Load the user defined scripts file first
  5680. " Only do this when the FileType autocommand has not been triggered yet
  5681. 1 0.000006 if exists("myscriptsfile") && filereadable(expand(myscriptsfile))
  5682. execute "source " . myscriptsfile
  5683. if did_filetype()
  5684. finish
  5685. endif
  5686. endif
  5687.  
  5688. " Line continuation is used here, remove 'C' from 'cpoptions'
  5689. 1 0.000018 let s:cpo_save = &cpo
  5690. 1 0.000012 set cpo&vim
  5691.  
  5692. 1 0.000007 let s:line1 = getline(1)
  5693.  
  5694. 1 0.000007 if s:line1 =~ "^#!"
  5695. " A script that starts with "#!".
  5696.  
  5697. " Check for a line like "#!/usr/bin/env VAR=val bash". Turn it into
  5698. " "#!/usr/bin/bash" to make matching easier.
  5699. if s:line1 =~ '^#!\s*\S*\<env\s'
  5700. let s:line1 = substitute(s:line1, '\S\+=\S\+', '', 'g')
  5701. let s:line1 = substitute(s:line1, '\<env\s\+', '', '')
  5702. endif
  5703.  
  5704. " Get the program name.
  5705. " Only accept spaces in PC style paths: "#!c:/program files/perl [args]".
  5706. " If the word env is used, use the first word after the space:
  5707. " "#!/usr/bin/env perl [path/args]"
  5708. " If there is no path use the first word: "#!perl [path/args]".
  5709. " Otherwise get the last word after a slash: "#!/usr/bin/perl [path/args]".
  5710. if s:line1 =~ '^#!\s*\a:[/\\]'
  5711. let s:name = substitute(s:line1, '^#!.*[/\\]\(\i\+\).*', '\1', '')
  5712. elseif s:line1 =~ '^#!.*\<env\>'
  5713. let s:name = substitute(s:line1, '^#!.*\<env\>\s\+\(\i\+\).*', '\1', '')
  5714. elseif s:line1 =~ '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)'
  5715. let s:name = substitute(s:line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '')
  5716. else
  5717. let s:name = substitute(s:line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '')
  5718. endif
  5719.  
  5720. " tcl scripts may have #!/bin/sh in the first line and "exec wish" in the
  5721. " third line. Suggested by Steven Atkinson.
  5722. if getline(3) =~ '^exec wish'
  5723. let s:name = 'wish'
  5724. endif
  5725.  
  5726. " Bourne-like shell scripts: bash bash2 ksh ksh93 sh
  5727. if s:name =~ '^\(bash\d*\|\|ksh\d*\|sh\)\>'
  5728. call SetFileTypeSH(s:line1) " defined in filetype.vim
  5729.  
  5730. " csh scripts
  5731. elseif s:name =~ '^csh\>'
  5732. if exists("g:filetype_csh")
  5733. call SetFileTypeShell(g:filetype_csh)
  5734. else
  5735. call SetFileTypeShell("csh")
  5736. endif
  5737.  
  5738. " tcsh scripts
  5739. elseif s:name =~ '^tcsh\>'
  5740. call SetFileTypeShell("tcsh")
  5741.  
  5742. " Z shell scripts
  5743. elseif s:name =~ '^zsh\>'
  5744. set ft=zsh
  5745.  
  5746. " TCL scripts
  5747. elseif s:name =~ '^\(tclsh\|wish\|expectk\|itclsh\|itkwish\)\>'
  5748. set ft=tcl
  5749.  
  5750. " Expect scripts
  5751. elseif s:name =~ '^expect\>'
  5752. set ft=expect
  5753.  
  5754. " Gnuplot scripts
  5755. elseif s:name =~ '^gnuplot\>'
  5756. set ft=gnuplot
  5757.  
  5758. " Makefiles
  5759. elseif s:name =~ 'make\>'
  5760. set ft=make
  5761.  
  5762. " Lua
  5763. elseif s:name =~ 'lua'
  5764. set ft=lua
  5765.  
  5766. " Perl 6
  5767. elseif s:name =~ 'perl6'
  5768. set ft=perl6
  5769.  
  5770. " Perl
  5771. elseif s:name =~ 'perl'
  5772. set ft=perl
  5773.  
  5774. " PHP
  5775. elseif s:name =~ 'php'
  5776. set ft=php
  5777.  
  5778. " Python
  5779. elseif s:name =~ 'python'
  5780. set ft=python
  5781.  
  5782. " Groovy
  5783. elseif s:name =~ '^groovy\>'
  5784. set ft=groovy
  5785.  
  5786. " Ruby
  5787. elseif s:name =~ 'ruby'
  5788. set ft=ruby
  5789.  
  5790. " BC calculator
  5791. elseif s:name =~ '^bc\>'
  5792. set ft=bc
  5793.  
  5794. " sed
  5795. elseif s:name =~ 'sed\>'
  5796. set ft=sed
  5797.  
  5798. " OCaml-scripts
  5799. elseif s:name =~ 'ocaml'
  5800. set ft=ocaml
  5801.  
  5802. " Awk scripts
  5803. elseif s:name =~ 'awk\>'
  5804. set ft=awk
  5805.  
  5806. " Website MetaLanguage
  5807. elseif s:name =~ 'wml'
  5808. set ft=wml
  5809.  
  5810. " Scheme scripts
  5811. elseif s:name =~ 'scheme'
  5812. set ft=scheme
  5813.  
  5814. " CFEngine scripts
  5815. elseif s:name =~ 'cfengine'
  5816. set ft=cfengine
  5817.  
  5818. " Erlang scripts
  5819. elseif s:name =~ 'escript'
  5820. set ft=erlang
  5821.  
  5822. endif
  5823. unlet s:name
  5824.  
  5825. else
  5826. " File does not start with "#!".
  5827.  
  5828. 1 0.000003 let s:line2 = getline(2)
  5829. 1 0.000002 let s:line3 = getline(3)
  5830. 1 0.000002 let s:line4 = getline(4)
  5831. 1 0.000002 let s:line5 = getline(5)
  5832.  
  5833. " Bourne-like shell scripts: sh ksh bash bash2
  5834. 1 0.000004 if s:line1 =~ '^:$'
  5835. call SetFileTypeSH(s:line1) " defined in filetype.vim
  5836.  
  5837. " Z shell scripts
  5838. elseif s:line1 =~ '^#compdef\>' || s:line1 =~ '^#autoload\>' ||
  5839. \ "\n".s:line1."\n".s:line2."\n".s:line3."\n".s:line4."\n".s:line5 =~ '\n\s*emulate\s\+\%(-[LR]\s\+\)\=[ckz]\=sh\>'
  5840. set ft=zsh
  5841.  
  5842. " ELM Mail files
  5843. elseif s:line1 =~ '^From \([a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\=\|-\) .* \(19\|20\)\d\d$'
  5844. set ft=mail
  5845.  
  5846. " Mason
  5847. elseif s:line1 =~ '^<[%&].*>'
  5848. set ft=mason
  5849.  
  5850. " Vim scripts (must have '" vim' as the first line to trigger this)
  5851. elseif s:line1 =~ '^" *[vV]im$'
  5852. set ft=vim
  5853.  
  5854. " MOO
  5855. elseif s:line1 =~ '^\*\* LambdaMOO Database, Format Version \%([1-3]\>\)\@!\d\+ \*\*$'
  5856. set ft=moo
  5857.  
  5858. " Diff file:
  5859. " - "diff" in first line (context diff)
  5860. " - "Only in " in first line
  5861. " - "--- " in first line and "+++ " in second line (unified diff).
  5862. " - "*** " in first line and "--- " in second line (context diff).
  5863. " - "# It was generated by makepatch " in the second line (makepatch diff).
  5864. " - "Index: <filename>" in the first line (CVS file)
  5865. " - "=== ", line of "=", "---", "+++ " (SVK diff)
  5866. " - "=== ", "--- ", "+++ " (bzr diff, common case)
  5867. " - "=== (removed|added|renamed|modified)" (bzr diff, alternative)
  5868. " - "# HG changeset patch" in first line (Mercurial export format)
  5869. elseif s:line1 =~ '^\(diff\>\|Only in \|\d\+\(,\d\+\)\=[cda]\d\+\>\|# It was generated by makepatch \|Index:\s\+\f\+\r\=$\|===== \f\+ \d\+\.\d\+ vs edited\|==== //\f\+#\d\+\|# HG changeset patch\)'
  5870. \ || (s:line1 =~ '^--- ' && s:line2 =~ '^+++ ')
  5871. \ || (s:line1 =~ '^\* looking for ' && s:line2 =~ '^\* comparing to ')
  5872. \ || (s:line1 =~ '^\*\*\* ' && s:line2 =~ '^--- ')
  5873. \ || (s:line1 =~ '^=== ' && ((s:line2 =~ '^=\{66\}' && s:line3 =~ '^--- ' && s:line4 =~ '^+++') || (s:line2 =~ '^--- ' && s:line3 =~ '^+++ ')))
  5874. \ || (s:line1 =~ '^=== \(removed\|added\|renamed\|modified\)')
  5875. set ft=diff
  5876.  
  5877. " PostScript Files (must have %!PS as the first line, like a2ps output)
  5878. elseif s:line1 =~ '^%![ \t]*PS'
  5879. set ft=postscr
  5880.  
  5881. " M4 scripts: Guess there is a line that starts with "dnl".
  5882. elseif s:line1 =~ '^\s*dnl\>'
  5883. \ || s:line2 =~ '^\s*dnl\>'
  5884. \ || s:line3 =~ '^\s*dnl\>'
  5885. \ || s:line4 =~ '^\s*dnl\>'
  5886. \ || s:line5 =~ '^\s*dnl\>'
  5887. set ft=m4
  5888.  
  5889. " SiCAD scripts (must have procn or procd as the first line to trigger this)
  5890. elseif s:line1 =~? '^ *proc[nd] *$'
  5891. set ft=sicad
  5892.  
  5893. " Purify log files start with "**** Purify"
  5894. elseif s:line1 =~ '^\*\*\*\* Purify'
  5895. set ft=purifylog
  5896.  
  5897. " XML
  5898. elseif s:line1 =~ '<?\s*xml.*?>'
  5899. set ft=xml
  5900.  
  5901. " XHTML (e.g.: PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN")
  5902. elseif s:line1 =~ '\<DTD\s\+XHTML\s'
  5903. set ft=xhtml
  5904.  
  5905. " HTML (e.g.: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN")
  5906. " Avoid "doctype html", used by slim.
  5907. elseif s:line1 =~? '<!DOCTYPE\s\+html\>'
  5908. set ft=html
  5909.  
  5910. " PDF
  5911. elseif s:line1 =~ '^%PDF-'
  5912. set ft=pdf
  5913.  
  5914. " XXD output
  5915. elseif s:line1 =~ '^\x\{7}: \x\{2} \=\x\{2} \=\x\{2} \=\x\{2} '
  5916. set ft=xxd
  5917.  
  5918. " RCS/CVS log output
  5919. elseif s:line1 =~ '^RCS file:' || s:line2 =~ '^RCS file:'
  5920. set ft=rcslog
  5921.  
  5922. " CVS commit
  5923. elseif s:line2 =~ '^CVS:' || getline("$") =~ '^CVS: '
  5924. set ft=cvs
  5925.  
  5926. " Prescribe
  5927. elseif s:line1 =~ '^!R!'
  5928. set ft=prescribe
  5929.  
  5930. " Send-pr
  5931. elseif s:line1 =~ '^SEND-PR:'
  5932. set ft=sendpr
  5933.  
  5934. " SNNS files
  5935. elseif s:line1 =~ '^SNNS network definition file'
  5936. set ft=snnsnet
  5937. elseif s:line1 =~ '^SNNS pattern definition file'
  5938. set ft=snnspat
  5939. elseif s:line1 =~ '^SNNS result file'
  5940. set ft=snnsres
  5941.  
  5942. " Virata
  5943. elseif s:line1 =~ '^%.\{-}[Vv]irata'
  5944. \ || s:line2 =~ '^%.\{-}[Vv]irata'
  5945. \ || s:line3 =~ '^%.\{-}[Vv]irata'
  5946. \ || s:line4 =~ '^%.\{-}[Vv]irata'
  5947. \ || s:line5 =~ '^%.\{-}[Vv]irata'
  5948. set ft=virata
  5949.  
  5950. " Strace
  5951. elseif s:line1 =~ '^\(\[pid \d\+\] \)\=[0-9:.]* *execve(' || s:line1 =~ '^__libc_start_main'
  5952. set ft=strace
  5953.  
  5954. " VSE JCL
  5955. elseif s:line1 =~ '^\* $$ JOB\>' || s:line1 =~ '^// *JOB\>'
  5956. set ft=vsejcl
  5957.  
  5958. " TAK and SINDA
  5959. elseif s:line4 =~ 'K & K Associates' || s:line2 =~ 'TAK 2000'
  5960. set ft=takout
  5961. elseif s:line3 =~ 'S Y S T E M S I M P R O V E D '
  5962. set ft=sindaout
  5963. elseif getline(6) =~ 'Run Date: '
  5964. set ft=takcmp
  5965. elseif getline(9) =~ 'Node File 1'
  5966. set ft=sindacmp
  5967.  
  5968. " DNS zone files
  5969. elseif s:line1.s:line2.s:line3.s:line4 =~ '^; <<>> DiG [0-9.]\+ <<>>\|BIND.*named\|$ORIGIN\|$TTL\|IN\s\+SOA'
  5970. set ft=bindzone
  5971.  
  5972. " BAAN
  5973. elseif s:line1 =~ '|\*\{1,80}' && s:line2 =~ 'VRC '
  5974. \ || s:line2 =~ '|\*\{1,80}' && s:line3 =~ 'VRC '
  5975. set ft=baan
  5976.  
  5977. " Valgrind
  5978. elseif s:line1 =~ '^==\d\+== valgrind' || s:line3 =~ '^==\d\+== Using valgrind'
  5979. set ft=valgrind
  5980.  
  5981. " Go docs
  5982. elseif s:line1 =~ '^PACKAGE DOCUMENTATION$'
  5983. set ft=godoc
  5984.  
  5985. " Renderman Interface Bytestream
  5986. elseif s:line1 =~ '^##RenderMan'
  5987. set ft=rib
  5988.  
  5989. " Scheme scripts
  5990. elseif s:line1 =~ 'exec\s\+\S*scheme' || s:line2 =~ 'exec\s\+\S*scheme'
  5991. set ft=scheme
  5992.  
  5993. " Git output
  5994. elseif s:line1 =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$'
  5995. set ft=git
  5996.  
  5997. " Gprof (gnu profiler)
  5998. elseif s:line1 == 'Flat profile:'
  5999. \ && s:line2 == ''
  6000. \ && s:line3 =~ '^Each sample counts as .* seconds.$'
  6001. set ft=gprof
  6002.  
  6003. " Erlang terms
  6004. " (See also: http://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#Choosing-Modes)
  6005. elseif s:line1 =~? '-\*-.*erlang.*-\*-'
  6006. set ft=erlang
  6007.  
  6008. " CVS diff
  6009. else
  6010. 1 0.000003 let s:lnum = 1
  6011. 1 0.000006 while getline(s:lnum) =~ "^? " && s:lnum < line("$")
  6012. let s:lnum += 1
  6013. endwhile
  6014. 1 0.000004 if getline(s:lnum) =~ '^Index:\s\+\f\+$'
  6015. set ft=diff
  6016.  
  6017. " locale input files: Formal Definitions of Cultural Conventions
  6018. " filename must be like en_US, fr_FR@euro or en_US.UTF-8
  6019. elseif expand("%") =~ '\a\a_\a\a\($\|[.@]\)\|i18n$\|POSIX$\|translit_'
  6020. let s:lnum = 1
  6021. while s:lnum < 100 && s:lnum < line("$")
  6022. if getline(s:lnum) =~ '^LC_\(IDENTIFICATION\|CTYPE\|COLLATE\|MONETARY\|NUMERIC\|TIME\|MESSAGES\|PAPER\|TELEPHONE\|MEASUREMENT\|NAME\|ADDRESS\)$'
  6023. setf fdcc
  6024. break
  6025. endif
  6026. let s:lnum += 1
  6027. endwhile
  6028. endif
  6029. 1 0.000002 unlet s:lnum
  6030.  
  6031. 1 0.000001 endif
  6032.  
  6033. 1 0.000002 unlet s:line2 s:line3 s:line4 s:line5
  6034.  
  6035. 1 0.000001 endif
  6036.  
  6037. " Restore 'cpoptions'
  6038. 1 0.000012 let &cpo = s:cpo_save
  6039.  
  6040. 1 0.000003 unlet s:cpo_save s:line1
  6041.  
  6042. FUNCTION remote#host#IsRunning()
  6043. Called 3 times
  6044. Total time: 0.000072
  6045. Self time: 0.000072
  6046.  
  6047. count total (s) self (s)
  6048. 3 0.000016 if !has_key(s:hosts, a:name)
  6049. throw 'No host named "'.a:name.'" is registered'
  6050. endif
  6051. 3 0.000012 return s:hosts[a:name].channel != 0
  6052.  
  6053. FUNCTION remote#host#RegisterClone()
  6054. Called 1 time
  6055. Total time: 0.000044
  6056. Self time: 0.000044
  6057.  
  6058. count total (s) self (s)
  6059. 1 0.000010 if !has_key(s:hosts, a:orig_name)
  6060. throw 'No host named "'.a:orig_name.'" is registered'
  6061. endif
  6062. 1 0.000011 let Factory = s:hosts[a:orig_name].factory
  6063. 1 0.000012 let s:hosts[a:name] = { 'factory': Factory, 'channel': 0, 'initialized': 0, 'orig_name': a:orig_name }
  6064.  
  6065. FUNCTION remote#host#RegisterPlugin()
  6066. Called 3 times
  6067. Total time: 0.004739
  6068. Self time: 0.001965
  6069.  
  6070. count total (s) self (s)
  6071. 3 0.000096 0.000039 let plugins = remote#host#PluginsForHost(a:host)
  6072.  
  6073. 4 0.000012 for plugin in plugins
  6074. 1 0.000002 if plugin.path == a:path
  6075. throw 'Plugin "'.a:path.'" is already registered'
  6076. endif
  6077. 1 0.000001 endfor
  6078.  
  6079. 3 0.000104 0.000032 if has_key(s:hosts, a:host) && remote#host#IsRunning(a:host)
  6080. " For now we won't allow registration of plugins when the host is already
  6081. " running.
  6082. throw 'Host "'.a:host.'" is already running'
  6083. endif
  6084.  
  6085. 30 0.000075 for spec in a:specs
  6086. 27 0.000066 let type = spec.type
  6087. 27 0.000051 let name = spec.name
  6088. 27 0.000046 let sync = spec.sync
  6089. 27 0.000047 let opts = spec.opts
  6090. 27 0.000055 let rpc_method = a:path
  6091. 27 0.000051 if type == 'command'
  6092. 2 0.000007 let rpc_method .= ':command:'.name
  6093. 2 0.000556 0.000027 call remote#define#CommandOnHost(a:host, rpc_method, sync, name, opts)
  6094. 2 0.000004 elseif type == 'autocmd'
  6095. " Since multiple handlers can be attached to the same autocmd event by a
  6096. " single plugin, we need a way to uniquely identify the rpc method to
  6097. " call. The solution is to append the autocmd pattern to the method
  6098. " name(This still has a limit: one handler per event/pattern combo, but
  6099. " there's no need to allow plugins define multiple handlers in that case)
  6100. 5 0.000034 let rpc_method .= ':autocmd:'.name.':'.get(opts, 'pattern', '*')
  6101. 5 0.000794 0.000052 call remote#define#AutocmdOnHost(a:host, rpc_method, sync, name, opts)
  6102. 5 0.000010 elseif type == 'function'
  6103. 20 0.000061 let rpc_method .= ':function:'.name
  6104. 20 0.001650 0.000276 call remote#define#FunctionOnHost(a:host, rpc_method, sync, name, opts)
  6105. 20 0.000024 else
  6106. echoerr 'Invalid declaration type: '.type
  6107. endif
  6108. 27 0.000031 endfor
  6109.  
  6110. 3 0.000129 call add(plugins, {'path': a:path, 'specs': a:specs})
  6111.  
  6112. FUNCTION remote#host#LoadRemotePlugins()
  6113. Called 1 time
  6114. Total time: 0.004900
  6115. Self time: 0.000116
  6116.  
  6117. count total (s) self (s)
  6118. 1 0.000186 0.000020 let manifest = s:GetManifest()
  6119. 1 0.000006 if filereadable(manifest)
  6120. 1 0.004702 0.000084 execute 'source' fnameescape(manifest)
  6121. 1 0.000002 endif
  6122.  
  6123. FUNCTION provider#python3#Prog()
  6124. Called 1 time
  6125. Total time: 0.000009
  6126. Self time: 0.000009
  6127.  
  6128. count total (s) self (s)
  6129. 1 0.000006 return s:prog
  6130.  
  6131. FUNCTION <SNR>23_foo()
  6132. Called 2 times
  6133. Total time: 0.005981
  6134. Self time: 0.000164
  6135.  
  6136. count total (s) self (s)
  6137. 2 0.005974 0.000157 call foo#bar()
  6138.  
  6139. FUNCTION <SNR>24_GetManifest()
  6140. Called 1 time
  6141. Total time: 0.000166
  6142. Self time: 0.000041
  6143.  
  6144. count total (s) self (s)
  6145. 1 0.000138 0.000013 let manifest = s:GetManifestPath()
  6146.  
  6147. 1 0.000010 if !filereadable(manifest)
  6148. " Check if an old manifest file exists and move it to the new location.
  6149. let old_manifest = s:GetOldManifestPath()
  6150. if filereadable(old_manifest)
  6151. call rename(old_manifest, manifest)
  6152. endif
  6153. endif
  6154.  
  6155. 1 0.000002 return manifest
  6156.  
  6157. FUNCTION <SNR>24_GetManifestPath()
  6158. Called 1 time
  6159. Total time: 0.000125
  6160. Self time: 0.000125
  6161.  
  6162. count total (s) self (s)
  6163. 1 0.000004 let manifest_base = ''
  6164.  
  6165. 1 0.000007 if exists('$NVIM_RPLUGIN_MANIFEST')
  6166. return fnamemodify($NVIM_RPLUGIN_MANIFEST, ':p')
  6167. endif
  6168.  
  6169. 1 0.000012 let dest = has('win32') ? '$LOCALAPPDATA' : '$XDG_DATA_HOME'
  6170. 1 0.000004 if !exists(dest)
  6171. 1 0.000006 let dest = has('win32') ? '~/AppData/Local' : '~/.local/share'
  6172. 1 0.000001 endif
  6173.  
  6174. 1 0.000041 let dest = fnamemodify(expand(dest), ':p')
  6175. 1 0.000007 if !empty(dest) && !filereadable(dest)
  6176. 1 0.000009 let dest .= ('/' ==# dest[-1:] ? '' : '/') . 'nvim'
  6177. 1 0.000011 call mkdir(dest, 'p', 0700)
  6178. 1 0.000003 let manifest_base = dest
  6179. 1 0.000001 endif
  6180.  
  6181. 1 0.000004 return manifest_base.'/rplugin.vim'
  6182.  
  6183. FUNCTION remote#host#Require()
  6184. Called 3 times
  6185. Total time: 0.240231
  6186. Self time: 0.000257
  6187.  
  6188. count total (s) self (s)
  6189. 3 0.000013 if empty(s:plugins_for_host)
  6190. call remote#host#LoadRemotePlugins()
  6191. endif
  6192. 3 0.000018 if !has_key(s:hosts, a:name)
  6193. throw 'No host named "'.a:name.'" is registered'
  6194. endif
  6195. 3 0.000012 let host = s:hosts[a:name]
  6196. 3 0.000008 if !host.channel && !host.initialized
  6197. 1 0.000005 let host_info = { 'name': a:name, 'orig_name': get(host, 'orig_name', a:name) }
  6198. 1 0.240099 0.000124 let host.channel = call(host.factory, [host_info])
  6199. 1 0.000006 let host.initialized = 1
  6200. 1 0.000003 endif
  6201. 3 0.000011 return host.channel
  6202.  
  6203. FUNCTION remote#host#Register()
  6204. Called 3 times
  6205. Total time: 0.000076
  6206. Self time: 0.000076
  6207.  
  6208. count total (s) self (s)
  6209. 3 0.000026 let s:hosts[a:name] = {'factory': a:factory, 'channel': 0, 'initialized': 0}
  6210. 3 0.000011 let s:plugin_patterns[a:name] = a:pattern
  6211. 3 0.000016 if type(a:factory) == type(1) && a:factory
  6212. " Passed a channel directly
  6213. let s:hosts[a:name].channel = a:factory
  6214. endif
  6215.  
  6216. FUNCTION remote#host#PluginsForHost()
  6217. Called 4 times
  6218. Total time: 0.000075
  6219. Self time: 0.000075
  6220.  
  6221. count total (s) self (s)
  6222. 4 0.000026 if !has_key(s:plugins_for_host, a:host)
  6223. 2 0.000012 let s:plugins_for_host[a:host] = []
  6224. 2 0.000003 end
  6225. 4 0.000015 return s:plugins_for_host[a:host]
  6226.  
  6227. FUNCTION provider#pythonx#Require()
  6228. Called 1 time
  6229. Total time: 0.239823
  6230. Self time: 0.193428
  6231.  
  6232. count total (s) self (s)
  6233. 1 0.000007 let ver = (a:host.orig_name ==# 'python') ? 2 : 3
  6234.  
  6235. " Python host arguments
  6236. 1 0.046537 0.000160 let prog = (ver == '2' ? provider#python#Prog() : provider#python3#Prog())
  6237. 1 0.000007 let args = [prog, '-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
  6238.  
  6239. " Collect registered Python plugins into args
  6240. 1 0.000030 0.000012 let python_plugins = remote#host#PluginsForHost(a:host.name)
  6241. 3 0.000013 for plugin in python_plugins
  6242. 2 0.000017 call add(args, plugin.path)
  6243. 2 0.000004 endfor
  6244.  
  6245. 1 0.000002 try
  6246. 1 0.010767 let channel_id = jobstart(args, s:job_opts)
  6247. 1 0.182367 if rpcrequest(channel_id, 'poll') ==# 'ok'
  6248. 1 0.000014 return channel_id
  6249. endif
  6250. catch
  6251. echomsg v:throwpoint
  6252. echomsg v:exception
  6253. for row in get(s:stderr, channel_id, [])
  6254. echomsg row
  6255. endfor
  6256. endtry
  6257. throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_PYTHON_LOG_FILE')
  6258.  
  6259. FUNCTION <SNR>26_StringifyOpts()
  6260. Called 2 times
  6261. Total time: 0.000292
  6262. Self time: 0.000292
  6263.  
  6264. count total (s) self (s)
  6265. 2 0.000005 let rv = []
  6266. 16 0.000028 for key in a:keys
  6267. 14 0.000037 if has_key(a:opts, key)
  6268. call add(rv, ' -'.key)
  6269. let val = a:opts[key]
  6270. if type(val) != type('') || val != ''
  6271. call add(rv, '='.val)
  6272. endif
  6273. endif
  6274. 14 0.000020 endfor
  6275. 2 0.000007 return join(rv, '')
  6276.  
  6277. FUNCTION remote#define#AutocmdOnChannel()
  6278. Called 3 times
  6279. Total time: 0.000474
  6280. Self time: 0.000222
  6281.  
  6282. count total (s) self (s)
  6283. 3 0.000018 let rpcargs = [a:channel, '"'.a:method.'"']
  6284. 3 0.000094 0.000035 call s:AddEval(rpcargs, a:opts)
  6285.  
  6286. 3 0.000286 0.000093 let autocmd_def = s:GetAutocmdPrefix(a:name, a:opts) . ' call '.s:GetRpcFunction(a:sync).'('.join(rpcargs, ', ').')'
  6287. 3 0.000068 exe autocmd_def
  6288.  
  6289. FUNCTION remote#define#FunctionOnHost()
  6290. Called 20 times
  6291. Total time: 0.001077
  6292. Self time: 0.000728
  6293.  
  6294. count total (s) self (s)
  6295. 20 0.000469 0.000119 let group = s:GetNextAutocmdGroup()
  6296. 20 0.000578 exe 'autocmd! '.group.' FuncUndefined '.a:name .' call remote#define#FunctionBootstrap("'.a:host.'"' . ', "'.a:method.'"' . ', '.string(a:sync) . ', "'.a:name.'"' . ', '.string(a:opts) . ', "'.group.'"' . ')'
  6297.  
  6298. FUNCTION provider#pythonx#Detect()
  6299. Called 1 time
  6300. Total time: 0.045810
  6301. Self time: 0.000083
  6302.  
  6303. count total (s) self (s)
  6304. 1 0.000002 if a:major_ver == 2
  6305. if exists('g:python_host_prog')
  6306. return [g:python_host_prog, '']
  6307. else
  6308. let progs = ['python2', 'python2.7', 'python2.6', 'python']
  6309. endif
  6310. else
  6311. 1 0.000003 if exists('g:python3_host_prog')
  6312. return [g:python3_host_prog, '']
  6313. else
  6314. 1 0.000004 let progs = ['python3', 'python3.7', 'python3.6', 'python3.5', 'python3.4', 'python3.3', 'python']
  6315. 1 0.000001 endif
  6316. 1 0.000001 endif
  6317.  
  6318. 1 0.000002 let errors = []
  6319.  
  6320. 1 0.000003 for prog in progs
  6321. 1 0.045750 0.000022 let [result, err] = s:check_interpreter(prog, a:major_ver)
  6322. 1 0.000005 if result
  6323. 1 0.000005 return [prog, err]
  6324. endif
  6325. " Accumulate errors in case we don't find
  6326. " any suitable Python interpreter.
  6327. call add(errors, err)
  6328. endfor
  6329.  
  6330. " No suitable Python interpreter found.
  6331. return ['', 'provider/pythonx: Could not load Python ' . a:major_ver . ":\n" . join(errors, "\n")]
  6332.  
  6333. FUNCTION <SNR>13_Highlight_Matching_Pair()
  6334. Called 3 times
  6335. Total time: 0.000522
  6336. Self time: 0.000522
  6337.  
  6338. count total (s) self (s)
  6339. " Remove any previous match.
  6340. 3 0.000036 if exists('w:paren_hl_on') && w:paren_hl_on
  6341. silent! call matchdelete(3)
  6342. let w:paren_hl_on = 0
  6343. endif
  6344.  
  6345. " Avoid that we remove the popup menu.
  6346. " Return when there are no colors (looks like the cursor jumps).
  6347. 3 0.000023 if pumvisible() || (&t_Co < 8 && !has("gui_running"))
  6348. return
  6349. endif
  6350.  
  6351. " Get the character under the cursor and check if it's in 'matchpairs'.
  6352. 3 0.000018 let c_lnum = line('.')
  6353. 3 0.000010 let c_col = col('.')
  6354. 3 0.000006 let before = 0
  6355.  
  6356. 3 0.000015 let text = getline(c_lnum)
  6357. 3 0.000096 let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)')
  6358. 3 0.000013 if empty(matches)
  6359. let [c_before, c] = ['', '']
  6360. else
  6361. 3 0.000023 let [c_before, c] = matches[1:2]
  6362. 3 0.000004 endif
  6363. 3 0.000077 let plist = split(&matchpairs, '.\zs[:,]')
  6364. 3 0.000015 let i = index(plist, c)
  6365. 3 0.000006 if i < 0
  6366. " not found, in Insert mode try character before the cursor
  6367. 3 0.000011 if c_col > 1 && (mode() == 'i' || mode() == 'R')
  6368. let before = strlen(c_before)
  6369. let c = c_before
  6370. let i = index(plist, c)
  6371. endif
  6372. 3 0.000006 if i < 0
  6373. " not found, nothing to do
  6374. 3 0.000006 return
  6375. endif
  6376. endif
  6377.  
  6378. " Figure out the arguments for searchpairpos().
  6379. if i % 2 == 0
  6380. let s_flags = 'nW'
  6381. let c2 = plist[i + 1]
  6382. else
  6383. let s_flags = 'nbW'
  6384. let c2 = c
  6385. let c = plist[i - 1]
  6386. endif
  6387. if c == '['
  6388. let c = '\['
  6389. let c2 = '\]'
  6390. endif
  6391.  
  6392. " Find the match. When it was just before the cursor move it there for a
  6393. " moment.
  6394. if before > 0
  6395. let has_getcurpos = exists("*getcurpos")
  6396. if has_getcurpos
  6397. " getcurpos() is more efficient but doesn't exist before 7.4.313.
  6398. let save_cursor = getcurpos()
  6399. else
  6400. let save_cursor = winsaveview()
  6401. endif
  6402. call cursor(c_lnum, c_col - before)
  6403. endif
  6404.  
  6405. " Build an expression that detects whether the current cursor position is in
  6406. " certain syntax types (string, comment, etc.), for use as searchpairpos()'s
  6407. " skip argument.
  6408. " We match "escape" for special items, such as lispEscapeSpecial.
  6409. let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))'
  6410. " If executing the expression determines that the cursor is currently in
  6411. " one of the syntax types, then we want searchpairpos() to find the pair
  6412. " within those syntax types (i.e., not skip). Otherwise, the cursor is
  6413. " outside of the syntax types and s_skip should keep its value so we skip any
  6414. " matching pair inside the syntax types.
  6415. execute 'if' s_skip '| let s_skip = 0 | endif'
  6416.  
  6417. " Limit the search to lines visible in the window.
  6418. let stoplinebottom = line('w$')
  6419. let stoplinetop = line('w0')
  6420. if i % 2 == 0
  6421. let stopline = stoplinebottom
  6422. else
  6423. let stopline = stoplinetop
  6424. endif
  6425.  
  6426. " Limit the search time to 300 msec to avoid a hang on very long lines.
  6427. " This fails when a timeout is not supported.
  6428. if mode() == 'i' || mode() == 'R'
  6429. let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout
  6430. else
  6431. let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout
  6432. endif
  6433. try
  6434. let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout)
  6435. catch /E118/
  6436. " Can't use the timeout, restrict the stopline a bit more to avoid taking
  6437. " a long time on closed folds and long lines.
  6438. " The "viewable" variables give a range in which we can scroll while
  6439. " keeping the cursor at the same position.
  6440. " adjustedScrolloff accounts for very large numbers of scrolloff.
  6441. let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2])
  6442. let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2])
  6443. let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2])
  6444. " one of these stoplines will be adjusted below, but the current values are
  6445. " minimal boundaries within the current window
  6446. if i % 2 == 0
  6447. if has("byte_offset") && has("syntax_items") && &smc > 0
  6448. let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
  6449. let stopline = min([bottom_viewable, byte2line(stopbyte)])
  6450. else
  6451. let stopline = min([bottom_viewable, c_lnum + 100])
  6452. endif
  6453. let stoplinebottom = stopline
  6454. else
  6455. if has("byte_offset") && has("syntax_items") && &smc > 0
  6456. let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
  6457. let stopline = max([top_viewable, byte2line(stopbyte)])
  6458. else
  6459. let stopline = max([top_viewable, c_lnum - 100])
  6460. endif
  6461. let stoplinetop = stopline
  6462. endif
  6463. let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
  6464. endtry
  6465.  
  6466. if before > 0
  6467. if has_getcurpos
  6468. call setpos('.', save_cursor)
  6469. else
  6470. call winrestview(save_cursor)
  6471. endif
  6472. endif
  6473.  
  6474. " If a match is found setup match highlighting.
  6475. if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom
  6476. if exists('*matchaddpos')
  6477. call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3)
  6478. else
  6479. exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
  6480. endif
  6481. let w:paren_hl_on = 1
  6482. endif
  6483.  
  6484. FUNCTION remote#define#AutocmdOnHost()
  6485. Called 5 times
  6486. Total time: 0.000742
  6487. Self time: 0.000374
  6488.  
  6489. count total (s) self (s)
  6490. 5 0.000142 0.000033 let group = s:GetNextAutocmdGroup()
  6491. 5 0.000027 let forward = '"doau '.group.' '.a:name.' ".'.'expand("<amatch>")'
  6492. 5 0.000041 let a:opts.group = group
  6493. 5 0.000399 0.000141 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, '"').'"' . ')'
  6494. 5 0.000117 exe bootstrap_def
  6495.  
  6496. FUNCTION <SNR>26_GetNextAutocmdGroup()
  6497. Called 25 times
  6498. Total time: 0.000458
  6499. Self time: 0.000458
  6500.  
  6501. count total (s) self (s)
  6502. 25 0.000056 let gid = s:next_gid
  6503. 25 0.000050 let s:next_gid += 1
  6504.  
  6505. 25 0.000070 let group_name = 'RPC_DEFINE_AUTOCMD_GROUP_'.gid
  6506. " Ensure the group is defined
  6507. 25 0.000159 exe 'augroup '.group_name.' | augroup END'
  6508. 25 0.000042 return group_name
  6509.  
  6510. FUNCTION <SNR>26_GetAutocmdPrefix()
  6511. Called 8 times
  6512. Total time: 0.000428
  6513. Self time: 0.000428
  6514.  
  6515. count total (s) self (s)
  6516. 8 0.000029 if has_key(a:opts, 'group')
  6517. 8 0.000023 let group = a:opts.group
  6518. 8 0.000011 else
  6519. let group = s:GetNextAutocmdGroup()
  6520. endif
  6521. 8 0.000031 let rv = ['autocmd!', group, a:name]
  6522.  
  6523. 8 0.000021 if has_key(a:opts, 'pattern')
  6524. 8 0.000082 call add(rv, a:opts.pattern)
  6525. 8 0.000009 else
  6526. call add(rv, '*')
  6527. endif
  6528.  
  6529. 8 0.000026 if has_key(a:opts, 'nested') && a:opts.nested
  6530. call add(rv, 'nested')
  6531. endif
  6532.  
  6533. 8 0.000046 return join(rv, ' ')
  6534.  
  6535. FUNCTION remote#define#CommandOnHost()
  6536. Called 2 times
  6537. Total time: 0.000529
  6538. Self time: 0.000205
  6539.  
  6540. count total (s) self (s)
  6541. 2 0.000005 let prefix = ''
  6542.  
  6543. 2 0.000006 if has_key(a:opts, 'range')
  6544. if a:opts.range == '' || a:opts.range == '%'
  6545. " -range or -range=%, pass the line range in a list
  6546. let prefix = '<line1>,<line2>'
  6547. elseif matchstr(a:opts.range, '\d') != ''
  6548. " -range=N, pass the count
  6549. let prefix = '<count>'
  6550. endif
  6551. elseif has_key(a:opts, 'count')
  6552. let prefix = '<count>'
  6553. endif
  6554.  
  6555. 2 0.000007 let forward_args = [prefix.a:name]
  6556.  
  6557. 2 0.000004 if has_key(a:opts, 'bang')
  6558. call add(forward_args, '<bang>')
  6559. endif
  6560.  
  6561. 2 0.000005 if has_key(a:opts, 'register')
  6562. call add(forward_args, ' <register>')
  6563. endif
  6564.  
  6565. 2 0.000004 if has_key(a:opts, 'nargs')
  6566. call add(forward_args, ' <args>')
  6567. endif
  6568.  
  6569. 2 0.000438 0.000113 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, '').'"' . ')'
  6570.  
  6571. FUNCTION <SNR>14_VimEnter()
  6572. Called 1 time
  6573. Total time: 0.000097
  6574. Self time: 0.000044
  6575.  
  6576. count total (s) self (s)
  6577. " call Dfunc("s:VimEnter(dirname<".a:dirname.">) expand(%)<".expand("%").">")
  6578. 1 0.000006 let curwin = winnr()
  6579. 1 0.000002 let s:vimentered = 1
  6580. 1 0.000077 0.000024 windo call s:LocalBrowse(expand("%:p"))
  6581. 1 0.000009 exe curwin."wincmd w"
  6582. " call Dret("s:VimEnter")
  6583.  
  6584. FUNCTION <SNR>26_GetRpcFunction()
  6585. Called 3 times
  6586. Total time: 0.000024
  6587. Self time: 0.000024
  6588.  
  6589. count total (s) self (s)
  6590. 3 0.000006 if a:sync
  6591. return 'rpcrequest'
  6592. endif
  6593. 3 0.000004 return 'rpcnotify'
  6594.  
  6595. FUNCTION remote#host#LoadRemotePluginsEvent()
  6596. Called 1 time
  6597. Total time: 0.005023
  6598. Self time: 0.000123
  6599.  
  6600. count total (s) self (s)
  6601. 1 0.000062 autocmd! nvim-rplugin
  6602. 1 0.004946 0.000046 call remote#host#LoadRemotePlugins()
  6603. 1 0.000008 if exists('#'.a:event.'#'.a:pattern) " Avoid 'No matching autocommands'.
  6604. execute 'silent doautocmd <nomodeline>' a:event a:pattern
  6605. endif
  6606.  
  6607. FUNCTION <SNR>28_check_interpreter()
  6608. Called 1 time
  6609. Total time: 0.045727
  6610. Self time: 0.045727
  6611.  
  6612. count total (s) self (s)
  6613. 1 0.000016 let prog_path = exepath(a:prog)
  6614. 1 0.000002 if prog_path ==# ''
  6615. return [0, a:prog . ' not found in search path or not executable.']
  6616. endif
  6617.  
  6618. 1 0.000003 let min_version = (a:major_ver == 2) ? '2.6' : '3.3'
  6619.  
  6620. " Try to load neovim module, and output Python version.
  6621. " Return codes:
  6622. " 0 Neovim module can be loaded.
  6623. " 2 Neovim module cannot be loaded.
  6624. " Otherwise something else went wrong (e.g. 1 or 127).
  6625. 1 0.045565 let prog_ver = system([ a:prog , '-c' , 'import sys; ' . 'sys.path.remove(""); ' . 'sys.stdout.write(str(sys.version_info[0]) + "." + str(sys.version_info[1])); ' . 'import pkgutil; ' . 'exit(2*int(pkgutil.get_loader("neovim") is None))' ])
  6626.  
  6627. 1 0.000019 if v:shell_error == 2 || v:shell_error == 0
  6628. " Check version only for expected return codes.
  6629. 1 0.000043 if prog_ver !~ '^' . a:major_ver
  6630. return [0, prog_path . ' is Python ' . prog_ver . ' and cannot provide Python ' . a:major_ver . '.']
  6631. elseif prog_ver =~ '^' . a:major_ver && prog_ver < min_version
  6632. return [0, prog_path . ' is Python ' . prog_ver . ' and cannot provide Python >= ' . min_version . '.']
  6633. endif
  6634. 1 0.000002 endif
  6635.  
  6636. 1 0.000002 if v:shell_error == 2
  6637. return [0, prog_path . ' does not have the neovim module installed. ' . 'See ":help provider-python".']
  6638. elseif v:shell_error == 127
  6639. " This can happen with pyenv's shims.
  6640. return [0, prog_path . ' does not exist: ' . prog_ver]
  6641. elseif v:shell_error
  6642. return [0, 'Checking ' . prog_path . ' caused an unknown error. ' . '(' . v:shell_error . ', output: ' . prog_ver . ')' . ' Please report this at github.com/neovim/neovim.']
  6643. endif
  6644.  
  6645. 1 0.000004 return [1, '']
  6646.  
  6647. FUNCTION <SNR>26_GetCommandPrefix()
  6648. Called 2 times
  6649. Total time: 0.000325
  6650. Self time: 0.000033
  6651.  
  6652. count total (s) self (s)
  6653. 2 0.000322 0.000030 return 'command!'.s:StringifyOpts(a:opts, ['nargs', 'complete', 'range', 'count', 'bang', 'bar', 'register']).' '.a:name
  6654.  
  6655. FUNCTION remote#define#AutocmdBootstrap()
  6656. Called 3 times
  6657. Total time: 0.241226
  6658. Self time: 0.000424
  6659.  
  6660. count total (s) self (s)
  6661. 3 0.240282 0.000051 let channel = remote#host#Require(a:host)
  6662.  
  6663. 3 0.000186 exe 'autocmd! '.a:opts.group
  6664. 3 0.000010 if channel
  6665. 3 0.000544 0.000069 call remote#define#AutocmdOnChannel(channel, a:method, a:sync, a:name, a:opts)
  6666. 3 0.000166 0.000069 exe eval(a:forward)
  6667. 3 0.000005 else
  6668. exe 'augroup! '.a:opts.group
  6669. echoerr 'Host "'a:host.'" for "'.a:name.'" autocmd is not available'
  6670. endif
  6671.  
  6672. FUNCTION foo#bar()
  6673. Called 2 times
  6674. Total time: 0.000044
  6675. Self time: 0.000044
  6676.  
  6677. count total (s) self (s)
  6678. 2 0.000041 echo 'hi'
  6679.  
  6680. FUNCTION <SNR>14_LocalBrowse()
  6681. Called 3 times
  6682. Total time: 0.000118
  6683. Self time: 0.000118
  6684.  
  6685. count total (s) self (s)
  6686. " Unfortunate interaction -- only DechoMsg debugging calls can be safely used here.
  6687. " Otherwise, the BufEnter event gets triggered when attempts to write to
  6688. " the DBG buffer are made.
  6689.  
  6690. 3 0.000010 if !exists("s:vimentered")
  6691. " If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will,
  6692. " and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined.
  6693. " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered doesn't exist)")
  6694. " call Dret("s:LocalBrowse")
  6695. 1 0.000001 return
  6696. endif
  6697.  
  6698. " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered=".s:vimentered.")")
  6699.  
  6700. 2 0.000012 if has("amiga")
  6701. " The check against '' is made for the Amiga, where the empty
  6702. " string is the current directory and not checking would break
  6703. " things such as the help command.
  6704. " call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)")
  6705. if a:dirname != '' && isdirectory(a:dirname)
  6706. sil! call netrw#LocalBrowseCheck(a:dirname)
  6707. if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
  6708. exe w:netrw_bannercnt
  6709. endif
  6710. endif
  6711.  
  6712. elseif isdirectory(a:dirname)
  6713. " call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)")
  6714. " call Dredir("LocalBrowse ft last set: ","verbose set ft")
  6715. " call Decho("(s:LocalBrowse) COMBAK#23: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
  6716. sil! call netrw#LocalBrowseCheck(a:dirname)
  6717. " call Decho("(s:LocalBrowse) COMBAK#24: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
  6718. if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
  6719. exe w:netrw_bannercnt
  6720. " call Decho("(s:LocalBrowse) COMBAK#25: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
  6721. endif
  6722.  
  6723. else
  6724. " not a directory, ignore it
  6725. " call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...")
  6726. 2 0.000002 endif
  6727. " call Decho("(s:LocalBrowse) COMBAK#26: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
  6728.  
  6729. " call Dret("s:LocalBrowse")
  6730.  
  6731. FUNCTION <SNR>26_AddEval()
  6732. Called 3 times
  6733. Total time: 0.000059
  6734. Self time: 0.000059
  6735.  
  6736. count total (s) self (s)
  6737. 3 0.000013 if has_key(a:opts, 'eval')
  6738. if type(a:opts.eval) != type('') || a:opts.eval == ''
  6739. throw "Eval option must be a non-empty string"
  6740. endif
  6741. " evaluate an expression and pass as argument
  6742. call add(a:rpcargs, 'eval("'.escape(a:opts.eval, '"').'")')
  6743. endif
  6744.  
  6745. FUNCTIONS SORTED ON TOTAL TIME
  6746. count total (s) self (s) function
  6747. 3 0.241226 0.000424 remote#define#AutocmdBootstrap()
  6748. 3 0.240231 0.000257 remote#host#Require()
  6749. 1 0.239823 0.193428 provider#pythonx#Require()
  6750. 1 0.045810 0.000083 provider#pythonx#Detect()
  6751. 1 0.045727 <SNR>28_check_interpreter()
  6752. 2 0.005981 0.000164 <SNR>23_foo()
  6753. 1 0.005023 0.000123 remote#host#LoadRemotePluginsEvent()
  6754. 1 0.004900 0.000116 remote#host#LoadRemotePlugins()
  6755. 3 0.004739 0.001965 remote#host#RegisterPlugin()
  6756. 20 0.001077 0.000728 remote#define#FunctionOnHost()
  6757. 5 0.000742 0.000374 remote#define#AutocmdOnHost()
  6758. 2 0.000529 0.000205 remote#define#CommandOnHost()
  6759. 3 0.000522 <SNR>13_Highlight_Matching_Pair()
  6760. 3 0.000474 0.000222 remote#define#AutocmdOnChannel()
  6761. 25 0.000458 <SNR>26_GetNextAutocmdGroup()
  6762. 8 0.000428 <SNR>26_GetAutocmdPrefix()
  6763. 2 0.000325 0.000033 <SNR>26_GetCommandPrefix()
  6764. 2 0.000292 <SNR>26_StringifyOpts()
  6765. 1 0.000166 0.000041 <SNR>24_GetManifest()
  6766. 1 0.000125 <SNR>24_GetManifestPath()
  6767.  
  6768. FUNCTIONS SORTED ON SELF TIME
  6769. count total (s) self (s) function
  6770. 1 0.239823 0.193428 provider#pythonx#Require()
  6771. 1 0.045727 <SNR>28_check_interpreter()
  6772. 3 0.004739 0.001965 remote#host#RegisterPlugin()
  6773. 20 0.001077 0.000728 remote#define#FunctionOnHost()
  6774. 3 0.000522 <SNR>13_Highlight_Matching_Pair()
  6775. 25 0.000458 <SNR>26_GetNextAutocmdGroup()
  6776. 8 0.000428 <SNR>26_GetAutocmdPrefix()
  6777. 3 0.241226 0.000424 remote#define#AutocmdBootstrap()
  6778. 5 0.000742 0.000374 remote#define#AutocmdOnHost()
  6779. 2 0.000292 <SNR>26_StringifyOpts()
  6780. 3 0.240231 0.000257 remote#host#Require()
  6781. 3 0.000474 0.000222 remote#define#AutocmdOnChannel()
  6782. 2 0.000529 0.000205 remote#define#CommandOnHost()
  6783. 2 0.005981 0.000164 <SNR>23_foo()
  6784. 1 0.000125 <SNR>24_GetManifestPath()
  6785. 1 0.005023 0.000123 remote#host#LoadRemotePluginsEvent()
  6786. 3 0.000118 <SNR>14_LocalBrowse()
  6787. 1 0.004900 0.000116 remote#host#LoadRemotePlugins()
  6788. 1 0.045810 0.000083 provider#pythonx#Detect()
  6789. 3 0.000076 remote#host#Register()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement