Skip to content

Instantly share code, notes, and snippets.

@myitcv
Created November 8, 2018 07:05
Show Gist options
  • Save myitcv/0f1e026d43628431dc7a9daf8728e56e to your computer and use it in GitHub Desktop.
Save myitcv/0f1e026d43628431dc7a9daf8728e56e to your computer and use it in GitHub Desktop.
SCRIPT /home/myitcv/.vim/ftplugin/go.vim
Sourced 1 time
Total time: 0.000160
Self time: 0.000160
count total (s) self (s)
1 0.000065 nmap <buffer> <Leader>h : <C-u>call go#tool#Info(0)<CR>
1 0.000024 nmap <F6> :GoImports<CR>
1 0.000012 setlocal noexpandtab
1 0.000011 setlocal ts=3
1 0.000007 setlocal sw=3
1 0.000005 let g:go_fmt_command = "goimports"
1 0.000003 let g:go_gocode_bin="gocode"
1 0.000002 let g:go_goimports_bin="goimports"
1 0.000003 let g:go_godef_bin="godef"
1 0.000002 let g:go_oracle_bin="oracle"
1 0.000002 let g:go_gotags_bin="gotags"
1 0.000002 let g:go_golint_bin="golint"
1 0.000002 let g:go_errcheck_bin="errcheck"
" Go related
1 0.000002 let g:go_disable_autoinstall = 1
1 0.000004 let g:go_def_mode = 'godef'
SCRIPT /home/myitcv/.vim/plugged/vim-go/ftplugin/go.vim
Sourced 1 time
Total time: 0.001078
Self time: 0.000828
count total (s) self (s)
" Copyright 2013 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" go.vim: Vim filetype plugin for Go.
1 0.000009 if exists("b:did_ftplugin")
finish
1 0.000002 endif
1 0.000003 let b:did_ftplugin = 1
1 0.000003 let b:undo_ftplugin = "setl fo< com< cms<"
1 0.000008 setlocal formatoptions-=t
1 0.000005 setlocal comments=s1:/*,mb:*,ex:*/,://
1 0.000005 setlocal commentstring=//\ %s
1 0.000005 setlocal noexpandtab
1 0.000606 0.000363 compiler go
" Set gocode completion
1 0.000008 setlocal omnifunc=go#complete#Complete
1 0.000006 if get(g:, "go_doc_keywordprg_enabled", 1)
" keywordprg doesn't allow to use vim commands, override it
1 0.000031 nnoremap <buffer> <silent> K :GoDoc<cr>
1 0.000001 endif
1 0.000004 if get(g:, "go_def_mapping_enabled", 1)
" these are default Vim mappings, we're overriding them to make them
" useful again for Go source code
1 0.000048 nnoremap <buffer> <silent> gd :GoDef<cr>
1 0.000014 nnoremap <buffer> <silent> <C-]> :GoDef<cr>
1 0.000012 nnoremap <buffer> <silent> <C-LeftMouse> <LeftMouse>:GoDef<cr>
1 0.000012 nnoremap <buffer> <silent> g<LeftMouse> <LeftMouse>:GoDef<cr>
1 0.000012 nnoremap <buffer> <silent> <C-w><C-]> :<C-u>call go#def#Jump("split")<CR>
1 0.000012 nnoremap <buffer> <silent> <C-w>] :<C-u>call go#def#Jump("split")<CR>
1 0.000011 nnoremap <buffer> <silent> <C-t> :<C-U>call go#def#StackPop(v:count1)<cr>
1 0.000001 endif
1 0.000004 if get(g:, "go_textobj_enabled", 1)
1 0.000012 onoremap <buffer> <silent> af :<c-u>call go#textobj#Function('a')<cr>
1 0.000013 xnoremap <buffer> <silent> af :<c-u>call go#textobj#Function('a')<cr>
1 0.000011 onoremap <buffer> <silent> if :<c-u>call go#textobj#Function('i')<cr>
1 0.000011 xnoremap <buffer> <silent> if :<c-u>call go#textobj#Function('i')<cr>
1 0.000014 onoremap <buffer> <silent> ac :<c-u>call go#textobj#Comment('a')<cr>
1 0.000011 xnoremap <buffer> <silent> ac :<c-u>call go#textobj#Comment('a')<cr>
1 0.000010 onoremap <buffer> <silent> ic :<c-u>call go#textobj#Comment('i')<cr>
1 0.000010 xnoremap <buffer> <silent> ic :<c-u>call go#textobj#Comment('i')<cr>
" Remap ]] and [[ to jump betweeen functions as they are useless in Go
1 0.000012 nnoremap <buffer> <silent> ]] :<c-u>call go#textobj#FunctionJump('n', 'next')<cr>
1 0.000012 nnoremap <buffer> <silent> [[ :<c-u>call go#textobj#FunctionJump('n', 'prev')<cr>
1 0.000011 onoremap <buffer> <silent> ]] :<c-u>call go#textobj#FunctionJump('o', 'next')<cr>
1 0.000011 onoremap <buffer> <silent> [[ :<c-u>call go#textobj#FunctionJump('o', 'prev')<cr>
1 0.000011 xnoremap <buffer> <silent> ]] :<c-u>call go#textobj#FunctionJump('v', 'next')<cr>
1 0.000011 xnoremap <buffer> <silent> [[ :<c-u>call go#textobj#FunctionJump('v', 'prev')<cr>
1 0.000001 endif
1 0.000038 0.000031 if go#config#AutoTypeInfo() || go#config#AutoSameids()
let &l:updatetime= get(g:, "go_updatetime", 800)
1 0.000001 endif
" NOTE(arslan): experimental, disabled by default, doesn't work well. No
" documentation as well. If anyone feels adventurous, enable the following and
" try to search for Go identifiers ;)
"
" if get(g:, "go_sameid_search_enabled", 0)
" autocmd FileType go nnoremap <buffer> <silent> * :<c-u>call Sameids_search(0)<CR>
" autocmd FileType go nnoremap <buffer> <silent> # :<c-u>call Sameids_search(1)<CR>
" autocmd FileType go nnoremap <buffer> <silent> n :<c-u>call Sameids_repeat(0)<CR>
" autocmd FileType go nnoremap <buffer> <silent> N :<c-u>call Sameids_repeat(1)<CR>
" autocmd FileType go cabbrev nohlsearch <C-r>=Sameids_nohlsearch()<CR>
" endif
" " mode 0: next 1: prev
" function! Sameids_repeat(mode)
" let matches = getmatches()
" if empty(matches)
" return
" endif
" let cur_offset = go#util#OffsetCursor()
" " reverse list to make it easy to find the prev occurrence
" if a:mode
" call reverse(matches)
" endif
" for m in matches
" if !has_key(m, "group")
" return
" endif
" if m.group != "goSameId"
" return
" endif
" let offset = go#util#Offset(m.pos1[0], m.pos1[1])
" if a:mode && cur_offset > offset
" call cursor(m.pos1[0], m.pos1[1])
" return
" elseif !a:mode && cur_offset < offset
" call cursor(m.pos1[0], m.pos1[1])
" return
" endif
" endfor
" " reached start/end, jump to the end/start
" let initial_match = matches[0]
" if !has_key(initial_match, "group")
" return
" endif
" if initial_match.group != "goSameId"
" return
" endif
" call cursor(initial_match.pos1[0], initial_match.pos1[1])
" endfunction
" function! Sameids_search(mode)
" call go#guru#SameIds()
" call Sameids_repeat(a:mode)
" endfunction
" function! Sameids_nohlsearch()
" call go#guru#ClearSameIds()
" return "nohlsearch"
" endfunction
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/compiler/go.vim
Sourced 1 time
Total time: 0.000179
Self time: 0.000179
count total (s) self (s)
" Copyright 2013 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" compiler/go.vim: Vim compiler file for Go.
1 0.000006 if exists("g:current_compiler")
finish
1 0.000001 endif
1 0.000005 let g:current_compiler = "go"
1 0.000006 if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
1 0.000001 endif
1 0.000012 let s:save_cpo = &cpo
1 0.000017 set cpo-=C
1 0.000015 if filereadable("makefile") || filereadable("Makefile")
CompilerSet makeprg=make
1 0.000001 else
1 0.000011 CompilerSet makeprg=go\ build
1 0.000001 endif
" Define the patterns that will be recognized by QuickFix when parsing the
" output of Go command that use this errorforamt (when called make, cexpr or
" lmake, lexpr). This is the global errorformat, however some command might
" use a different output, for those we define them directly and modify the
" errorformat ourselves. More information at:
" http://vimdoc.sourceforge.net/htmldoc/quickfix.html#errorformat
1 0.000010 CompilerSet errorformat =%-G#\ %.%# " Ignore lines beginning with '#' ('# command-line-arguments' line sometimes appears?)
1 0.000008 CompilerSet errorformat+=%-G%.%#panic:\ %m " Ignore lines containing 'panic: message'
1 0.000006 CompilerSet errorformat+=%Ecan\'t\ load\ package:\ %m " Start of multiline error string is 'can\'t load package'
1 0.000008 CompilerSet errorformat+=%A%f:%l:%c:\ %m " Start of multiline unspecified string is 'filename:linenumber:columnnumber:'
1 0.000006 CompilerSet errorformat+=%A%f:%l:\ %m " Start of multiline unspecified string is 'filename:linenumber:'
1 0.000006 CompilerSet errorformat+=%C%*\\s%m " Continuation of multiline error message is indented
1 0.000006 CompilerSet errorformat+=%-G%.%# " All lines not matching any of the above patterns are ignored
1 0.000020 let &cpo = s:save_cpo
1 0.000003 unlet s:save_cpo
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/usr/vim/share/vim/vim81/compiler/go.vim
Sourced 1 time
Total time: 0.000019
Self time: 0.000019
count total (s) self (s)
" Vim compiler file
" Compiler: Go
" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
" Last Change: 2014 Aug 16
1 0.000007 if exists('current_compiler')
1 0.000002 finish
endif
let current_compiler = 'go'
if exists(':CompilerSet') != 2
command -nargs=* CompilerSet setlocal <args>
endif
let s:save_cpo = &cpo
set cpo-=C
CompilerSet makeprg=go\ build
CompilerSet errorformat=
\%-G#\ %.%#,
\%A%f:%l:%c:\ %m,
\%A%f:%l:\ %m,
\%C%*\\s%m,
\%-G%.%#
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: sw=2 sts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/ftplugin/go/commands.vim
Sourced 1 time
Total time: 0.000529
Self time: 0.000529
count total (s) self (s)
" -- gorename
1 0.000017 command! -nargs=? -complete=customlist,go#rename#Complete GoRename call go#rename#Rename(<bang>0, <f-args>)
" -- guru
1 0.000009 command! -nargs=* -complete=customlist,go#package#Complete GoGuruScope call go#guru#Scope(<f-args>)
1 0.000009 command! -range=% GoImplements call go#guru#Implements(<count>)
1 0.000008 command! -range=% GoPointsTo call go#guru#PointsTo(<count>)
1 0.000009 command! -range=% GoWhicherrs call go#guru#Whicherrs(<count>)
1 0.000007 command! -range=% GoCallees call go#guru#Callees(<count>)
1 0.000009 command! -range=% GoDescribe call go#guru#Describe(<count>)
1 0.000006 command! -range=% GoCallers call go#guru#Callers(<count>)
1 0.000008 command! -range=% GoCallstack call go#guru#Callstack(<count>)
1 0.000007 command! -range=% GoFreevars call go#guru#Freevars(<count>)
1 0.000009 command! -range=% GoChannelPeers call go#guru#ChannelPeers(<count>)
1 0.000007 command! -range=% GoReferrers call go#guru#Referrers(<count>)
1 0.000005 command! -range=0 GoSameIds call go#guru#SameIds(1)
1 0.000008 command! -range=0 GoSameIdsClear call go#guru#ClearSameIds()
1 0.000006 command! -range=0 GoSameIdsToggle call go#guru#ToggleSameIds()
1 0.000007 command! -range=0 GoSameIdsAutoToggle call go#guru#AutoToogleSameIds()
" -- tags
1 0.000014 command! -nargs=* -range GoAddTags call go#tags#Add(<line1>, <line2>, <count>, <f-args>)
1 0.000014 command! -nargs=* -range GoRemoveTags call go#tags#Remove(<line1>, <line2>, <count>, <f-args>)
" -- mod
1 0.000005 command! -nargs=0 -range GoModFmt call go#mod#Format()
" -- tool
1 0.000006 command! -nargs=* -complete=customlist,go#tool#ValidFiles GoFiles echo go#tool#Files(<f-args>)
1 0.000004 command! -nargs=0 GoDeps echo go#tool#Deps()
1 0.000005 command! -nargs=0 GoInfo call go#tool#Info(1)
1 0.000007 command! -nargs=0 GoAutoTypeInfoToggle call go#complete#ToggleAutoTypeInfo()
" -- cmd
1 0.000008 command! -nargs=* -bang GoBuild call go#cmd#Build(<bang>0,<f-args>)
1 0.000009 command! -nargs=? -bang GoBuildTags call go#cmd#BuildTags(<bang>0, <f-args>)
1 0.000009 command! -nargs=* -bang GoGenerate call go#cmd#Generate(<bang>0,<f-args>)
1 0.000009 command! -nargs=* -bang -complete=file GoRun call go#cmd#Run(<bang>0,<f-args>)
1 0.000009 command! -nargs=* -bang GoInstall call go#cmd#Install(<bang>0, <f-args>)
" -- test
1 0.000009 command! -nargs=* -bang GoTest call go#test#Test(<bang>0, 0, <f-args>)
1 0.000008 command! -nargs=* -bang GoTestFunc call go#test#Func(<bang>0, <f-args>)
1 0.000009 command! -nargs=* -bang GoTestCompile call go#test#Test(<bang>0, 1, <f-args>)
" -- cover
1 0.000009 command! -nargs=* -bang GoCoverage call go#coverage#Buffer(<bang>0, <f-args>)
1 0.000004 command! -nargs=* -bang GoCoverageClear call go#coverage#Clear()
1 0.000009 command! -nargs=* -bang GoCoverageToggle call go#coverage#BufferToggle(<bang>0, <f-args>)
1 0.000009 command! -nargs=* -bang GoCoverageBrowser call go#coverage#Browser(<bang>0, <f-args>)
" -- play
1 0.000012 command! -nargs=0 -range=% GoPlay call go#play#Share(<count>, <line1>, <line2>)
" -- def
1 0.000004 command! -nargs=* -range GoDef :call go#def#Jump('')
1 0.000007 command! -nargs=? GoDefPop :call go#def#StackPop(<f-args>)
1 0.000005 command! -nargs=? GoDefStack :call go#def#Stack(<f-args>)
1 0.000007 command! -nargs=? GoDefStackClear :call go#def#StackClear(<f-args>)
" -- doc
1 0.000009 command! -nargs=* -range -complete=customlist,go#package#Complete GoDoc call go#doc#Open('new', 'split', <f-args>)
1 0.000006 command! -nargs=* -range -complete=customlist,go#package#Complete GoDocBrowser call go#doc#OpenBrowser(<f-args>)
" -- fmt
1 0.000004 command! -nargs=0 GoFmt call go#fmt#Format(-1)
1 0.000007 command! -nargs=0 GoFmtAutoSaveToggle call go#fmt#ToggleFmtAutoSave()
1 0.000004 command! -nargs=0 GoImports call go#fmt#Format(1)
" -- asmfmt
1 0.000006 command! -nargs=0 GoAsmFmtAutoSaveToggle call go#asmfmt#ToggleAsmFmtAutoSave()
" -- import
1 0.000009 command! -nargs=? -complete=customlist,go#package#Complete GoDrop call go#import#SwitchImport(0, '', <f-args>, '')
1 0.000012 command! -nargs=1 -bang -complete=customlist,go#package#Complete GoImport call go#import#SwitchImport(1, '', <f-args>, '<bang>')
1 0.000011 command! -nargs=* -bang -complete=customlist,go#package#Complete GoImportAs call go#import#SwitchImport(1, <f-args>, '<bang>')
" -- linters
1 0.000008 command! -nargs=* GoMetaLinter call go#lint#Gometa(0, <f-args>)
1 0.000007 command! -nargs=0 GoMetaLinterAutoSaveToggle call go#lint#ToggleMetaLinterAutoSave()
1 0.000007 command! -nargs=* GoLint call go#lint#Golint(<f-args>)
1 0.000009 command! -nargs=* -bang GoVet call go#lint#Vet(<bang>0, <f-args>)
1 0.000007 command! -nargs=* -complete=customlist,go#package#Complete GoErrCheck call go#lint#Errcheck(<f-args>)
" -- alternate
1 0.000008 command! -bang GoAlternate call go#alternate#Switch(<bang>0, '')
" -- decls
1 0.000007 command! -nargs=? -complete=file GoDecls call go#decls#Decls(0, <q-args>)
1 0.000007 command! -nargs=? -complete=dir GoDeclsDir call go#decls#Decls(1, <q-args>)
" -- impl
1 0.000007 command! -nargs=* -complete=customlist,go#impl#Complete GoImpl call go#impl#Impl(<f-args>)
" -- template
1 0.000008 command! -nargs=0 GoTemplateAutoCreateToggle call go#template#ToggleAutoCreate()
" -- keyify
1 0.000004 command! -nargs=0 GoKeyify call go#keyify#Keyify()
" -- fillstruct
1 0.000006 command! -nargs=0 GoFillStruct call go#fillstruct#FillStruct()
" -- debug
1 0.000006 if !exists(':GoDebugStart')
command! -nargs=* -complete=customlist,go#package#Complete GoDebugStart call go#debug#Start(0, <f-args>)
command! -nargs=* -complete=customlist,go#package#Complete GoDebugTest call go#debug#Start(1, <f-args>)
command! -nargs=? GoDebugBreakpoint call go#debug#Breakpoint(<f-args>)
1 0.000001 endif
" -- issue
1 0.000005 command! -nargs=0 GoReportGitHubIssue call go#issue#New()
" -- iferr
1 0.000004 command! -nargs=0 GoIfErr call go#iferr#Generate()
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/ftplugin/go/mappings.vim
Sourced 1 time
Total time: 0.000748
Self time: 0.000748
count total (s) self (s)
" go_jump_to_error defines whether we should pass the bang attribute to the
" command or not. This is only used for mappings, because the user can't pass
" the bang attribute to the plug mappings below. So instead of hardcoding it
" as 0 (no '!' attribute) or 1 (with '!' attribute) we pass the user setting,
" which by default is enabled. For commands the user has the ability to pass
" the '!', such as :GoBuild or :GoBuild!
1 0.000005 if !exists("g:go_jump_to_error")
let g:go_jump_to_error = 1
1 0.000000 endif
" Some handy plug mappings
1 0.000023 nnoremap <silent> <Plug>(go-run) :<C-u>call go#cmd#Run(!g:go_jump_to_error)<CR>
1 0.000021 if has("nvim")
nnoremap <silent> <Plug>(go-run-vertical) :<C-u>call go#cmd#RunTerm(!g:go_jump_to_error, 'vsplit', [])<CR>
nnoremap <silent> <Plug>(go-run-split) :<C-u>call go#cmd#RunTerm(!g:go_jump_to_error, 'split', [])<CR>
nnoremap <silent> <Plug>(go-run-tab) :<C-u>call go#cmd#RunTerm(!g:go_jump_to_error, 'tabe', [])<CR>
1 0.000001 endif
1 0.000019 nnoremap <silent> <Plug>(go-build) :<C-u>call go#cmd#Build(!g:go_jump_to_error)<CR>
1 0.000015 nnoremap <silent> <Plug>(go-generate) :<C-u>call go#cmd#Generate(!g:go_jump_to_error)<CR>
1 0.000013 nnoremap <silent> <Plug>(go-install) :<C-u>call go#cmd#Install(!g:go_jump_to_error)<CR>
1 0.000014 nnoremap <silent> <Plug>(go-test) :<C-u>call go#test#Test(!g:go_jump_to_error, 0)<CR>
1 0.000013 nnoremap <silent> <Plug>(go-test-func) :<C-u>call go#test#Func(!g:go_jump_to_error)<CR>
1 0.000014 nnoremap <silent> <Plug>(go-test-compile) :<C-u>call go#test#Test(!g:go_jump_to_error, 1)<CR>
1 0.000014 nnoremap <silent> <Plug>(go-coverage) :<C-u>call go#coverage#Buffer(!g:go_jump_to_error)<CR>
1 0.000013 nnoremap <silent> <Plug>(go-coverage-clear) :<C-u>call go#coverage#Clear()<CR>
1 0.000017 nnoremap <silent> <Plug>(go-coverage-toggle) :<C-u>call go#coverage#BufferToggle(!g:go_jump_to_error)<CR>
1 0.000015 nnoremap <silent> <Plug>(go-coverage-browser) :<C-u>call go#coverage#Browser(!g:go_jump_to_error)<CR>
1 0.000012 nnoremap <silent> <Plug>(go-files) :<C-u>call go#tool#Files()<CR>
1 0.000011 nnoremap <silent> <Plug>(go-deps) :<C-u>call go#tool#Deps()<CR>
1 0.000011 nnoremap <silent> <Plug>(go-info) :<C-u>call go#tool#Info(1)<CR>
1 0.000017 nnoremap <silent> <Plug>(go-import) :<C-u>call go#import#SwitchImport(1, '', expand('<cword>'), '')<CR>
1 0.000011 nnoremap <silent> <Plug>(go-imports) :<C-u>call go#fmt#Format(1)<CR>
1 0.000012 nnoremap <silent> <Plug>(go-implements) :<C-u>call go#guru#Implements(-1)<CR>
1 0.000012 nnoremap <silent> <Plug>(go-callees) :<C-u>call go#guru#Callees(-1)<CR>
1 0.000013 nnoremap <silent> <Plug>(go-callers) :<C-u>call go#guru#Callers(-1)<CR>
1 0.000012 nnoremap <silent> <Plug>(go-describe) :<C-u>call go#guru#Describe(-1)<CR>
1 0.000012 nnoremap <silent> <Plug>(go-callstack) :<C-u>call go#guru#Callstack(-1)<CR>
1 0.000014 xnoremap <silent> <Plug>(go-freevars) :<C-u>call go#guru#Freevars(0)<CR>
1 0.000013 nnoremap <silent> <Plug>(go-channelpeers) :<C-u>call go#guru#ChannelPeers(-1)<CR>
1 0.000012 nnoremap <silent> <Plug>(go-referrers) :<C-u>call go#guru#Referrers(-1)<CR>
1 0.000012 nnoremap <silent> <Plug>(go-sameids) :<C-u>call go#guru#SameIds(1)<CR>
1 0.000012 nnoremap <silent> <Plug>(go-pointsto) :<C-u>call go#guru#PointsTo(-1)<CR>
1 0.000012 nnoremap <silent> <Plug>(go-whicherrs) :<C-u>call go#guru#Whicherrs(-1)<CR>
1 0.000014 nnoremap <silent> <Plug>(go-sameids-toggle) :<C-u>call go#guru#ToggleSameIds()<CR>
1 0.000013 nnoremap <silent> <Plug>(go-rename) :<C-u>call go#rename#Rename(!g:go_jump_to_error)<CR>
1 0.000011 nnoremap <silent> <Plug>(go-decls) :<C-u>call go#decls#Decls(0, '')<CR>
1 0.000012 nnoremap <silent> <Plug>(go-decls-dir) :<C-u>call go#decls#Decls(1, '')<CR>
1 0.000012 nnoremap <silent> <Plug>(go-def) :<C-u>call go#def#Jump('')<CR>
1 0.000013 nnoremap <silent> <Plug>(go-def-vertical) :<C-u>call go#def#Jump("vsplit")<CR>
1 0.000012 nnoremap <silent> <Plug>(go-def-split) :<C-u>call go#def#Jump("split")<CR>
1 0.000011 nnoremap <silent> <Plug>(go-def-tab) :<C-u>call go#def#Jump("tab")<CR>
1 0.000011 nnoremap <silent> <Plug>(go-def-pop) :<C-u>call go#def#StackPop()<CR>
1 0.000018 nnoremap <silent> <Plug>(go-def-stack) :<C-u>call go#def#Stack()<CR>
1 0.000024 nnoremap <silent> <Plug>(go-def-stack-clear) :<C-u>call go#def#StackClear()<CR>
1 0.000023 nnoremap <silent> <Plug>(go-doc) :<C-u>call go#doc#Open("new", "split")<CR>
1 0.000026 nnoremap <silent> <Plug>(go-doc-tab) :<C-u>call go#doc#Open("tabnew", "tabe")<CR>
1 0.000014 nnoremap <silent> <Plug>(go-doc-vertical) :<C-u>call go#doc#Open("vnew", "vsplit")<CR>
1 0.000013 nnoremap <silent> <Plug>(go-doc-split) :<C-u>call go#doc#Open("new", "split")<CR>
1 0.000012 nnoremap <silent> <Plug>(go-doc-browser) :<C-u>call go#doc#OpenBrowser()<CR>
1 0.000012 nnoremap <silent> <Plug>(go-metalinter) :<C-u>call go#lint#Gometa(0)<CR>
1 0.000011 nnoremap <silent> <Plug>(go-lint) :<C-u>call go#lint#Golint()<CR>
1 0.000014 nnoremap <silent> <Plug>(go-vet) :<C-u>call go#lint#Vet(!g:go_jump_to_error)<CR>
1 0.000014 nnoremap <silent> <Plug>(go-alternate-edit) :<C-u>call go#alternate#Switch(0, "edit")<CR>
1 0.000014 nnoremap <silent> <Plug>(go-alternate-vertical) :<C-u>call go#alternate#Switch(0, "vsplit")<CR>
1 0.000013 nnoremap <silent> <Plug>(go-alternate-split) :<C-u>call go#alternate#Switch(0, "split")<CR>
1 0.000011 nnoremap <silent> <Plug>(go-iferr) :<C-u>call go#iferr#Generate()<CR>
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/ftplugin/go/snippets.vim
Sourced 1 time
Total time: 0.000013
Self time: 0.000013
count total (s) self (s)
1 0.000007 if exists("g:go_loaded_gosnippets")
1 0.000002 finish
endif
let g:go_loaded_gosnippets = 1
function! s:GoUltiSnips() abort
if get(g:, 'did_plugin_ultisnips') isnot 1
return
endif
if !exists("g:UltiSnipsSnippetDirectories")
let g:UltiSnipsSnippetDirectories = ["gosnippets/UltiSnips"]
else
let g:UltiSnipsSnippetDirectories += ["gosnippets/UltiSnips"]
endif
endfunction
function! s:GoNeosnippet() abort
if get(g:, 'loaded_neosnippet') isnot 1
return
endif
let g:neosnippet#enable_snipmate_compatibility = 1
let l:gosnippets_dir = globpath(&rtp, 'gosnippets/snippets')
if type(g:neosnippet#snippets_directory) == type([])
let g:neosnippet#snippets_directory += [l:gosnippets_dir]
elseif type(g:neosnippet#snippets_directory) == type("")
if strlen(g:neosnippet#snippets_directory) > 0
let g:neosnippet#snippets_directory = g:neosnippet#snippets_directory . "," . l:gosnippets_dir
else
let g:neosnippet#snippets_directory = l:gosnippets_dir
endif
endif
endfunction
function! s:GoMinisnip() abort
if get(g:, 'loaded_minisnip') isnot 1
return
endif
if exists('g:minisnip_dir')
let g:minisnip_dir .= go#util#PathListSep() . globpath(&rtp, 'gosnippets/minisnip')
else
let g:minisnip_dir = globpath(&rtp, 'gosnippets/minisnip')
endif
endfunction
let s:engine = go#config#SnippetEngine()
if s:engine is? "automatic"
if get(g:, 'did_plugin_ultisnips') is 1
call s:GoUltiSnips()
elseif get(g:, 'loaded_neosnippet') is 1
call s:GoNeosnippet()
elseif get(g:, 'loaded_minisnip') is 1
call s:GoMinisnip()
endif
elseif s:engine is? "ultisnips"
call s:GoUltiSnips()
elseif s:engine is? "neosnippet"
call s:GoNeosnippet()
elseif s:engine is? "minisnip"
call s:GoMinisnip()
endif
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/ftplugin/go/tagbar.vim
Sourced 1 time
Total time: 0.000072
Self time: 0.000072
count total (s) self (s)
" Check if tagbar is installed under plugins or is directly under rtp
" this covers pathogen + Vundle/Bundle
"
" Also make sure the ctags command exists
"
1 0.000064 if !executable('ctags')
1 0.000001 finish
elseif globpath(&rtp, 'plugin/tagbar.vim') == ""
finish
endif
if !exists("g:go_gotags_bin")
let g:go_gotags_bin = "gotags"
endif
function! s:SetTagbar()
let bin_path = go#path#CheckBinPath(g:go_gotags_bin)
if empty(bin_path)
return
endif
if !exists("g:tagbar_type_go")
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : bin_path,
\ 'ctagsargs' : '-sort -silent'
\ }
endif
endfunction
call s:SetTagbar()
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/usr/vim/share/vim/vim81/ftplugin/go.vim
Sourced 1 time
Total time: 0.000012
Self time: 0.000012
count total (s) self (s)
" Vim filetype plugin file
" Language: Go
" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
" Last Change: 2014 Aug 16
1 0.000005 if exists('b:did_ftplugin')
1 0.000001 finish
endif
let b:did_ftplugin = 1
setlocal formatoptions-=t
setlocal comments=s1:/*,mb:*,ex:*/,://
setlocal commentstring=//\ %s
let b:undo_ftplugin = 'setl fo< com< cms<'
" vim: sw=2 sts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/indent/go.vim
Sourced 1 time
Total time: 0.000048
Self time: 0.000048
count total (s) self (s)
" Copyright 2011 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" indent/go.vim: Vim indent file for Go.
"
" TODO:
" - function invocations split across lines
" - general line splits (line ends in an operator)
1 0.000004 if exists("b:did_indent")
finish
1 0.000000 endif
1 0.000002 let b:did_indent = 1
" C indentation is too far off useful, mainly due to Go's := operator.
" Let's just define our own.
1 0.000013 setlocal nolisp
1 0.000005 setlocal autoindent
1 0.000003 setlocal indentexpr=GoIndent(v:lnum)
1 0.000003 setlocal indentkeys+=<:>,0=},0=)
1 0.000003 if exists("*GoIndent")
1 0.000002 finish
endif
function! GoIndent(lnum) abort
let prevlnum = prevnonblank(a:lnum-1)
if prevlnum == 0
" top of file
return 0
endif
" grab the previous and current line, stripping comments.
let prevl = substitute(getline(prevlnum), '//.*$', '', '')
let thisl = substitute(getline(a:lnum), '//.*$', '', '')
let previ = indent(prevlnum)
let ind = previ
for synid in synstack(a:lnum, 1)
if synIDattr(synid, 'name') == 'goRawString'
if prevl =~ '\%(\%(:\?=\)\|(\|,\)\s*`[^`]*$'
" previous line started a multi-line raw string
return 0
endif
" return -1 to keep the current indent.
return -1
endif
endfor
if prevl =~ '[({]\s*$'
" previous line opened a block
let ind += shiftwidth()
endif
if prevl =~# '^\s*\(case .*\|default\):$'
" previous line is part of a switch statement
let ind += shiftwidth()
endif
" TODO: handle if the previous line is a label.
if thisl =~ '^\s*[)}]'
" this line closed a block
let ind -= shiftwidth()
endif
" Colons are tricky.
" We want to outdent if it's part of a switch ("case foo:" or "default:").
" We ignore trying to deal with jump labels because (a) they're rare, and
" (b) they're hard to disambiguate from a composite literal key.
if thisl =~# '^\s*\(case .*\|default\):$'
let ind -= shiftwidth()
endif
return ind
endfunction
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/usr/vim/share/vim/vim81/indent/go.vim
Sourced 1 time
Total time: 0.000012
Self time: 0.000012
count total (s) self (s)
" Vim indent file
" Language: Go
" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
" Last Change: 2017 Jun 13
"
" TODO:
" - function invocations split across lines
" - general line splits (line ends in an operator)
1 0.000004 if exists('b:did_indent')
1 0.000001 finish
endif
let b:did_indent = 1
" C indentation is too far off useful, mainly due to Go's := operator.
" Let's just define our own.
setlocal nolisp
setlocal autoindent
setlocal indentexpr=GoIndent(v:lnum)
setlocal indentkeys+=<:>,0=},0=)
if exists('*GoIndent')
finish
endif
function! GoIndent(lnum)
let l:prevlnum = prevnonblank(a:lnum-1)
if l:prevlnum == 0
" top of file
return 0
endif
" grab the previous and current line, stripping comments.
let l:prevl = substitute(getline(l:prevlnum), '//.*$', '', '')
let l:thisl = substitute(getline(a:lnum), '//.*$', '', '')
let l:previ = indent(l:prevlnum)
let l:ind = l:previ
if l:prevl =~ '[({]\s*$'
" previous line opened a block
let l:ind += shiftwidth()
endif
if l:prevl =~# '^\s*\(case .*\|default\):$'
" previous line is part of a switch statement
let l:ind += shiftwidth()
endif
" TODO: handle if the previous line is a label.
if l:thisl =~ '^\s*[)}]'
" this line closed a block
let l:ind -= shiftwidth()
endif
" Colons are tricky.
" We want to outdent if it's part of a switch ("case foo:" or "default:").
" We ignore trying to deal with jump labels because (a) they're rare, and
" (b) they're hard to disambiguate from a composite literal key.
if l:thisl =~# '^\s*\(case .*\|default\):$'
let l:ind -= shiftwidth()
endif
return l:ind
endfunction
" vim: sw=2 sts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/syntax/go.vim
Sourced 2 times
Total time: 0.003097
Self time: 0.002722
count total (s) self (s)
" Copyright 2009 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" go.vim: Vim syntax file for Go.
" Quit when a (custom) syntax file was already loaded
2 0.000008 if exists("b:current_syntax")
finish
2 0.000002 endif
2 0.000003 syn case match
2 0.000012 syn keyword goPackage package
2 0.000006 syn keyword goImport import contained
2 0.000003 syn keyword goVar var contained
2 0.000005 syn keyword goConst const contained
2 0.000009 hi def link goPackage Statement
2 0.000006 hi def link goImport Statement
2 0.000005 hi def link goVar Keyword
2 0.000005 hi def link goConst Keyword
2 0.000006 hi def link goDeclaration Keyword
" Keywords within functions
2 0.000008 syn keyword goStatement defer go goto return break continue fallthrough
2 0.000009 syn keyword goConditional if else switch select
2 0.000005 syn keyword goLabel case default
2 0.000004 syn keyword goRepeat for range
2 0.000005 hi def link goStatement Statement
2 0.000006 hi def link goConditional Conditional
2 0.000004 hi def link goLabel Label
2 0.000005 hi def link goRepeat Repeat
" Predefined types
2 0.000005 syn keyword goType chan map bool string error
2 0.000005 syn keyword goSignedInts int int8 int16 int32 int64 rune
2 0.000006 syn keyword goUnsignedInts byte uint uint8 uint16 uint32 uint64 uintptr
2 0.000004 syn keyword goFloats float32 float64
2 0.000006 syn keyword goComplexes complex64 complex128
2 0.000005 hi def link goType Type
2 0.000005 hi def link goSignedInts Type
2 0.000007 hi def link goUnsignedInts Type
2 0.000006 hi def link goFloats Type
2 0.000007 hi def link goComplexes Type
" Predefined functions and values
2 0.000025 syn keyword goBuiltins append cap close complex copy delete imag len
2 0.000012 syn keyword goBuiltins make new panic print println real recover
2 0.000007 syn keyword goBoolean true false
2 0.000006 syn keyword goPredefinedIdentifiers nil iota
2 0.000008 hi def link goBuiltins Identifier
2 0.000007 hi def link goBoolean Boolean
2 0.000006 hi def link goPredefinedIdentifiers goBoolean
" Comments; their contents
2 0.000009 syn keyword goTodo contained TODO FIXME XXX BUG
2 0.000009 syn cluster goCommentGroup contains=goTodo
2 0.000023 syn region goComment start="//" end="$" contains=goGenerate,@goCommentGroup,@Spell
2 0.000068 0.000024 if go#config#FoldEnable('comment')
syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell fold
syn match goComment "\v(^\s*//.*\n)+" contains=goGenerate,@goCommentGroup,@Spell fold
2 0.000002 else
2 0.000011 syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell
2 0.000001 endif
2 0.000006 hi def link goComment Comment
2 0.000005 hi def link goTodo Todo
2 0.000031 0.000022 if go#config#HighlightGenerateTags()
syn match goGenerateVariables contained /\(\$GOARCH\|\$GOOS\|\$GOFILE\|\$GOLINE\|\$GOPACKAGE\|\$DOLLAR\)\>/
syn region goGenerate start="^\s*//go:generate" end="$" contains=goGenerateVariables
hi def link goGenerate PreProc
hi def link goGenerateVariables Special
2 0.000002 endif
" Go escapes
2 0.000010 syn match goEscapeOctal display contained "\\[0-7]\{3}"
2 0.000009 syn match goEscapeC display contained +\\[abfnrtv\\'"]+
2 0.000006 syn match goEscapeX display contained "\\x\x\{2}"
2 0.000009 syn match goEscapeU display contained "\\u\x\{4}"
2 0.000007 syn match goEscapeBigU display contained "\\U\x\{8}"
2 0.000009 syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+
2 0.000004 hi def link goEscapeOctal goSpecialString
2 0.000005 hi def link goEscapeC goSpecialString
2 0.000005 hi def link goEscapeX goSpecialString
2 0.000004 hi def link goEscapeU goSpecialString
2 0.000004 hi def link goEscapeBigU goSpecialString
2 0.000005 hi def link goSpecialString Special
2 0.000005 hi def link goEscapeError Error
" Strings and their contents
2 0.000021 syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
2 0.000024 0.000016 if go#config#HighlightStringSpellcheck()
2 0.000023 syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup,@Spell
2 0.000012 syn region goRawString start=+`+ end=+`+ contains=@Spell
else
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
syn region goRawString start=+`+ end=+`+
2 0.000002 endif
2 0.000036 0.000029 if go#config#HighlightFormatStrings()
" [n] notation is valid for specifying explicit argument indexes
" 1. Match a literal % not preceded by a %.
" 2. Match any number of -, #, 0, space, or +
" 3. Match * or [n]* or any number or nothing before a .
" 4. Match * or [n]* or any number or nothing after a .
" 5. Match [n] or nothing before a verb
" 6. Match a formatting verb
2 0.000039 syn match goFormatSpecifier /\
\([^%]\(%%\)*\)\
\@<=%[-#0 +]*\
\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\
\%(\.\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\)\=\
\%(\[\d\+\]\)\=[vTtbcdoqxXUeEfFgGsp]/ contained containedin=goString,goRawString
2 0.000006 hi def link goFormatSpecifier goSpecialString
2 0.000001 endif
2 0.000005 hi def link goString String
2 0.000004 hi def link goRawString String
" Characters; their contents
2 0.000018 syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
2 0.000015 syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup
2 0.000005 hi def link goCharacter Character
" Regions
2 0.000008 syn region goParen start='(' end=')' transparent
2 0.000045 0.000014 if go#config#FoldEnable('block')
2 0.000009 syn region goBlock start="{" end="}" transparent fold
else
syn region goBlock start="{" end="}" transparent
2 0.000001 endif
" import
2 0.000041 0.000016 if go#config#FoldEnable('import')
2 0.000021 syn region goImport start='import (' end=')' transparent fold contains=goImport,goString,goComment
else
syn region goImport start='import (' end=')' transparent contains=goImport,goString,goComment
2 0.000002 endif
" var, const
2 0.000039 0.000017 if go#config#FoldEnable('varconst')
2 0.000038 syn region goVar start='var (' end='^\s*)$' transparent fold
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments,goPointerOperator
2 0.000039 syn region goConst start='const (' end='^\s*)$' transparent fold
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments,goPointerOperator
else
syn region goVar start='var (' end='^\s*)$' transparent
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments,goPointerOperator
syn region goConst start='const (' end='^\s*)$' transparent
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments,goPointerOperator
2 0.000001 endif
" Single-line var, const, and import.
2 0.000020 syn match goSingleDecl /\(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst
" Integers
2 0.000011 syn match goDecimalInt "\<-\=\d\+\%([Ee][-+]\=\d\+\)\=\>"
2 0.000006 syn match goHexadecimalInt "\<-\=0[xX]\x\+\>"
2 0.000006 syn match goOctalInt "\<-\=0\o\+\>"
2 0.000006 syn match goOctalError "\<-\=0\o*[89]\d*\>"
2 0.000005 hi def link goDecimalInt Integer
2 0.000004 hi def link goHexadecimalInt Integer
2 0.000003 hi def link goOctalInt Integer
2 0.000005 hi def link goOctalError Error
2 0.000004 hi def link Integer Number
" Floating point
2 0.000009 syn match goFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=\>"
2 0.000008 syn match goFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=\>"
2 0.000004 hi def link goFloat Float
" Imaginary literals
2 0.000011 syn match goImaginary "\<-\=\d\+i\>"
2 0.000008 syn match goImaginary "\<-\=\d\+[Ee][-+]\=\d\+i\>"
2 0.000009 syn match goImaginaryFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=i\>"
2 0.000008 syn match goImaginaryFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=i\>"
2 0.000004 hi def link goImaginary Number
2 0.000004 hi def link goImaginaryFloat Float
" Spaces after "[]"
2 0.000037 0.000029 if go#config#HighlightArrayWhitespaceError()
syn match goSpaceError display "\(\[\]\)\@<=\s\+"
2 0.000002 endif
" Spacing errors around the 'chan' keyword
2 0.000019 0.000013 if go#config#HighlightChanWhitespaceError()
" receive-only annotation on chan type
"
" \(\<chan\>\)\@<!<- (only pick arrow when it doesn't come after a chan)
" this prevents picking up 'chan<- chan<-' but not '<- chan'
syn match goSpaceError display "\(\(\<chan\>\)\@<!<-\)\@<=\s\+\(\<chan\>\)\@="
" send-only annotation on chan type
"
" \(<-\)\@<!\<chan\> (only pick chan when it doesn't come after an arrow)
" this prevents picking up '<-chan <-chan' but not 'chan <-'
syn match goSpaceError display "\(\(<-\)\@<!\<chan\>\)\@<=\s\+\(<-\)\@="
" value-ignoring receives in a few contexts
syn match goSpaceError display "\(\(^\|[={(,;]\)\s*<-\)\@<=\s\+"
2 0.000002 endif
" Extra types commonly seen
2 0.000025 0.000018 if go#config#HighlightExtraTypes()
syn match goExtraType /\<bytes\.\(Buffer\)\>/
syn match goExtraType /\<context\.\(Context\)\>/
syn match goExtraType /\<io\.\(Reader\|ReadSeeker\|ReadWriter\|ReadCloser\|ReadWriteCloser\|Writer\|WriteCloser\|Seeker\)\>/
syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/
syn match goExtraType /\<unsafe\.Pointer\>/
2 0.000001 endif
" Space-tab error
2 0.000022 0.000017 if go#config#HighlightSpaceTabError()
syn match goSpaceError display " \+\t"me=e-1
2 0.000001 endif
" Trailing white space error
2 0.000023 0.000017 if go#config#HighlightTrailingWhitespaceError()
syn match goSpaceError display excludenl "\s\+$"
2 0.000001 endif
2 0.000007 hi def link goExtraType Type
2 0.000004 hi def link goSpaceError Error
" included from: https://github.com/athom/more-colorful.vim/blob/master/after/syntax/go.vim
"
" Comments; their contents
2 0.000004 syn keyword goTodo contained NOTE
2 0.000006 hi def link goTodo Todo
2 0.000006 syn match goVarArgs /\.\.\./
" Operators;
2 0.000020 0.000015 if go#config#HighlightOperators()
" match single-char operators: - + % < > ! & | ^ * =
" and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= ==
syn match goOperator /[-+%<>!&|^*=]=\?/
" match / and /=
syn match goOperator /\/\%(=\|\ze[^/*]\)/
" match two-char operators: << >> &^
" and corresponding three-char operators: <<= >>= &^=
syn match goOperator /\%(<<\|>>\|&^\)=\?/
" match remaining two-char operators: := && || <- ++ --
syn match goOperator /:=\|||\|<-\|++\|--/
" match ...
hi def link goPointerOperator goOperator
hi def link goVarArgs goOperator
2 0.000001 endif
2 0.000006 hi def link goOperator Operator
" Functions;
2 0.000041 0.000031 if go#config#HighlightFunctions() || go#config#HighlightFunctionArguments()
syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction,goSimpleArguments skipwhite skipnl
syn match goReceiverVar /\w\+\ze\s\+\(\w\|\*\)/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained
syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
syn match goFunction /\w\+/ nextgroup=goSimpleArguments contained skipwhite skipnl
syn match goReceiverType /\w\+/ contained
if go#config#HighlightFunctionArguments()
syn match goSimpleArguments /(\(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goArgumentName nextgroup=goSimpleArguments skipwhite skipnl
syn match goArgumentName /\w\+\(\s*,\s*\w\+\)*\ze\s\+\(\w\|\.\|\*\|\[\)/ contained nextgroup=goArgumentType skipwhite skipnl
syn match goArgumentType /\([^,)]\|\_s\)\+,\?/ contained nextgroup=goArgumentName skipwhite skipnl
\ contains=goVarArgs,goType,goSignedInts,goUnsignedInts,goFloats,goComplexes,goDeclType,goBlock
hi def link goReceiverVar goArgumentName
hi def link goArgumentName Identifier
endif
syn match goReceiver /(\s*\w\+\(\s\+\*\?\s*\w\+\)\?\s*)\ze\s*\w/ contained nextgroup=goFunction contains=goReceiverVar skipwhite skipnl
2 0.000002 else
2 0.000005 syn keyword goDeclaration func
2 0.000001 endif
2 0.000005 hi def link goFunction Function
" Function calls;
2 0.000018 0.000011 if go#config#HighlightFunctionCalls()
syn match goFunctionCall /\w\+\ze(/ contains=goBuiltins,goDeclaration
2 0.000001 endif
2 0.000005 hi def link goFunctionCall Type
" Fields;
2 0.000020 0.000015 if go#config#HighlightFields()
syn match goField /\.\w\+\([.\ \n\r\:\)\[,]\)\@=/hs=s+1
2 0.000000 endif
2 0.000006 hi def link goField Identifier
" Structs & Interfaces;
2 0.000014 0.000010 if go#config#HighlightTypes()
syn match goTypeConstructor /\<\w\+{\@=/
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
syn match goDeclType /\<\(interface\|struct\)\>/ skipwhite skipnl
hi def link goReceiverType Type
2 0.000001 else
2 0.000004 syn keyword goDeclType struct interface
2 0.000003 syn keyword goDeclaration type
2 0.000002 endif
2 0.000005 hi def link goTypeConstructor Type
2 0.000005 hi def link goTypeName Type
2 0.000004 hi def link goTypeDecl Keyword
2 0.000004 hi def link goDeclType Keyword
" Variable Assignments
2 0.000029 0.000023 if go#config#HighlightVariableAssignments()
syn match goVarAssign /\v[_.[:alnum:]]+(,\s*[_.[:alnum:]]+)*\ze(\s*([-^+|^\/%&]|\*|\<\<|\>\>|\&\^)?\=[^=])/
hi def link goVarAssign Special
2 0.000001 endif
" Variable Declarations
2 0.000021 0.000016 if go#config#HighlightVariableDeclarations()
syn match goVarDefs /\v\w+(,\s*\w+)*\ze(\s*:\=)/
hi def link goVarDefs Special
2 0.000002 endif
" Build Constraints
2 0.000021 0.000017 if go#config#HighlightBuildConstraints()
syn match goBuildKeyword display contained "+build"
" Highlight the known values of GOOS, GOARCH, and other +build options.
syn keyword goBuildDirectives contained
\ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
\ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64
\ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc
\ s390 s390x sparc sparc64 cgo ignore race
" Other words in the build directive are build tags not listed above, so
" avoid highlighting them as comments by using a matchgroup just for the
" start of the comment.
" The rs=s+2 option lets the \s*+build portion be part of the inner region
" instead of the matchgroup so it will be highlighted as a goBuildKeyword.
syn region goBuildComment matchgroup=goBuildCommentStart
\ start="//\s*+build\s"rs=s+2 end="$"
\ contains=goBuildKeyword,goBuildDirectives
hi def link goBuildCommentStart Comment
hi def link goBuildDirectives Type
hi def link goBuildKeyword PreProc
2 0.000001 endif
2 0.000068 0.000034 if go#config#HighlightBuildConstraints() || go#config#FoldEnable('package_comment')
" One or more line comments that are followed immediately by a "package"
" declaration are treated like package documentation, so these must be
" matched as comments to avoid looking like working build constraints.
" The he, me, and re options let the "package" itself be highlighted by
" the usual rules.
2 0.000068 0.000046 exe 'syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/'
\ . ' end=/\v\n\s*package/he=e-7,me=e-7,re=e-7'
\ . ' contains=@goCommentGroup,@Spell'
\ . (go#config#FoldEnable('package_comment') ? ' fold' : '')
2 0.000064 0.000041 exe 'syn region goPackageComment start=/\v^\s*\/\*.*\n(.*\n)*\s*\*\/\npackage/'
\ . ' end=/\v\*\/\n\s*package/he=e-7,me=e-7,re=e-7'
\ . ' contains=@goCommentGroup,@Spell'
\ . (go#config#FoldEnable('package_comment') ? ' fold' : '')
2 0.000006 hi def link goPackageComment Comment
2 0.000001 endif
" :GoCoverage commands
2 0.000004 hi def link goCoverageNormalText Comment
2 0.000005 function! s:hi()
hi def link goSameId Search
" :GoCoverage commands
hi def goCoverageCovered ctermfg=green guifg=#A6E22E
hi def goCoverageUncover ctermfg=red guifg=#F92672
" :GoDebug commands
if go#config#HighlightDebug()
hi GoDebugBreakpoint term=standout ctermbg=117 ctermfg=0 guibg=#BAD4F5 guifg=Black
hi GoDebugCurrent term=reverse ctermbg=12 ctermfg=7 guibg=DarkBlue guifg=White
endif
endfunction
2 0.000005 augroup vim-go-hi
2 0.000357 autocmd!
2 0.000013 autocmd ColorScheme * call s:hi()
2 0.000002 augroup end
2 0.000085 0.000013 call s:hi()
" Search backwards for a global declaration to start processing the syntax.
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
" There's a bug in the implementation of grouphere. For now, use the
" following as a more expensive/less precise workaround.
2 0.000004 syn sync minlines=500
2 0.000006 let b:current_syntax = "go"
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/usr/vim/share/vim/vim81/syntax/go.vim
Sourced 2 times
Total time: 0.000035
Self time: 0.000035
count total (s) self (s)
" Vim syntax file
" Language: Go
" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
" Last Change: 2014 Aug 16
" Options:
" There are some options for customizing the highlighting; the recommended
" settings are the default values, but you can write:
" let OPTION_NAME = 0
" in your ~/.vimrc file to disable particular options. You can also write:
" let OPTION_NAME = 1
" to enable particular options. At present, all options default to on.
"
" - g:go_highlight_array_whitespace_error
" Highlights white space after "[]".
" - g:go_highlight_chan_whitespace_error
" Highlights white space around the communications operator that don't
" follow the standard style.
" - g:go_highlight_extra_types
" Highlights commonly used library types (io.Reader, etc.).
" - g:go_highlight_space_tab_error
" Highlights instances of tabs following spaces.
" - g:go_highlight_trailing_whitespace_error
" Highlights trailing white space.
" Quit when a (custom) syntax file was already loaded
2 0.000010 if exists('b:current_syntax')
2 0.000003 finish
endif
if !exists('g:go_highlight_array_whitespace_error')
let g:go_highlight_array_whitespace_error = 1
endif
if !exists('g:go_highlight_chan_whitespace_error')
let g:go_highlight_chan_whitespace_error = 1
endif
if !exists('g:go_highlight_extra_types')
let g:go_highlight_extra_types = 1
endif
if !exists('g:go_highlight_space_tab_error')
let g:go_highlight_space_tab_error = 1
endif
if !exists('g:go_highlight_trailing_whitespace_error')
let g:go_highlight_trailing_whitespace_error = 1
endif
syn case match
syn keyword goDirective package import
syn keyword goDeclaration var const type
syn keyword goDeclType struct interface
hi def link goDirective Statement
hi def link goDeclaration Keyword
hi def link goDeclType Keyword
" Keywords within functions
syn keyword goStatement defer go goto return break continue fallthrough
syn keyword goConditional if else switch select
syn keyword goLabel case default
syn keyword goRepeat for range
hi def link goStatement Statement
hi def link goConditional Conditional
hi def link goLabel Label
hi def link goRepeat Repeat
" Predefined types
syn keyword goType chan map bool string error
syn keyword goSignedInts int int8 int16 int32 int64 rune
syn keyword goUnsignedInts byte uint uint8 uint16 uint32 uint64 uintptr
syn keyword goFloats float32 float64
syn keyword goComplexes complex64 complex128
hi def link goType Type
hi def link goSignedInts Type
hi def link goUnsignedInts Type
hi def link goFloats Type
hi def link goComplexes Type
" Treat func specially: it's a declaration at the start of a line, but a type
" elsewhere. Order matters here.
syn match goType /\<func\>/
syn match goDeclaration /^func\>/
" Predefined functions and values
syn keyword goBuiltins append cap close complex copy delete imag len
syn keyword goBuiltins make new panic print println real recover
syn keyword goConstants iota true false nil
hi def link goBuiltins Keyword
hi def link goConstants Keyword
" Comments; their contents
syn keyword goTodo contained TODO FIXME XXX BUG
syn cluster goCommentGroup contains=goTodo
syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell
syn region goComment start="//" end="$" contains=@goCommentGroup,@Spell
hi def link goComment Comment
hi def link goTodo Todo
" Go escapes
syn match goEscapeOctal display contained "\\[0-7]\{3}"
syn match goEscapeC display contained +\\[abfnrtv\\'"]+
syn match goEscapeX display contained "\\x\x\{2}"
syn match goEscapeU display contained "\\u\x\{4}"
syn match goEscapeBigU display contained "\\U\x\{8}"
syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+
hi def link goEscapeOctal goSpecialString
hi def link goEscapeC goSpecialString
hi def link goEscapeX goSpecialString
hi def link goEscapeU goSpecialString
hi def link goEscapeBigU goSpecialString
hi def link goSpecialString Special
hi def link goEscapeError Error
" Strings and their contents
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
syn region goRawString start=+`+ end=+`+
hi def link goString String
hi def link goRawString String
" Characters; their contents
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup
hi def link goCharacter Character
" Regions
syn region goBlock start="{" end="}" transparent fold
syn region goParen start='(' end=')' transparent
" Integers
syn match goDecimalInt "\<\d\+\([Ee]\d\+\)\?\>"
syn match goHexadecimalInt "\<0x\x\+\>"
syn match goOctalInt "\<0\o\+\>"
syn match goOctalError "\<0\o*[89]\d*\>"
hi def link goDecimalInt Integer
hi def link goHexadecimalInt Integer
hi def link goOctalInt Integer
hi def link Integer Number
" Floating point
syn match goFloat "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>"
syn match goFloat "\<\.\d\+\([Ee][-+]\d\+\)\?\>"
syn match goFloat "\<\d\+[Ee][-+]\d\+\>"
hi def link goFloat Float
" Imaginary literals
syn match goImaginary "\<\d\+i\>"
syn match goImaginary "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>"
syn match goImaginary "\<\.\d\+\([Ee][-+]\d\+\)\?i\>"
syn match goImaginary "\<\d\+[Ee][-+]\d\+i\>"
hi def link goImaginary Number
" Spaces after "[]"
if go_highlight_array_whitespace_error != 0
syn match goSpaceError display "\(\[\]\)\@<=\s\+"
endif
" Spacing errors around the 'chan' keyword
if go_highlight_chan_whitespace_error != 0
" receive-only annotation on chan type
syn match goSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@="
" send-only annotation on chan type
syn match goSpaceError display "\(\<chan\)\@<=\s\+\(<-\)\@="
" value-ignoring receives in a few contexts
syn match goSpaceError display "\(\(^\|[={(,;]\)\s*<-\)\@<=\s\+"
endif
" Extra types commonly seen
if go_highlight_extra_types != 0
syn match goExtraType /\<bytes\.\(Buffer\)\>/
syn match goExtraType /\<io\.\(Reader\|Writer\|ReadWriter\|ReadWriteCloser\)\>/
syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/
syn match goExtraType /\<unsafe\.Pointer\>/
endif
" Space-tab error
if go_highlight_space_tab_error != 0
syn match goSpaceError display " \+\t"me=e-1
endif
" Trailing white space error
if go_highlight_trailing_whitespace_error != 0
syn match goSpaceError display excludenl "\s\+$"
endif
hi def link goExtraType Type
hi def link goSpaceError Error
" Search backwards for a global declaration to start processing the syntax.
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
" There's a bug in the implementation of grouphere. For now, use the
" following as a more expensive/less precise workaround.
syn sync minlines=500
let b:current_syntax = 'go'
" vim: sw=2 sts=2 et
SCRIPT /home/myitcv/.vim/plugged/ultisnips/autoload/UltiSnips.vim
Sourced 1 time
Total time: 0.021624
Self time: 0.021624
count total (s) self (s)
1 0.000006 if exists("b:did_autoload_ultisnips") || !exists("g:_uspy")
finish
1 0.000000 endif
1 0.000002 let b:did_autoload_ultisnips = 1
" Also import vim as we expect it to be imported in many places.
1 0.006132 exec g:_uspy "import vim"
1 0.015352 exec g:_uspy "from UltiSnips import UltiSnips_Manager"
1 0.000005 function! s:compensate_for_pum()
""" The CursorMovedI event is not triggered while the popup-menu is visible,
""" and it's by this event that UltiSnips updates its vim-state. The fix is
""" to explicitly check for the presence of the popup menu, and update
""" the vim-state accordingly.
if pumvisible()
exec g:_uspy "UltiSnips_Manager._cursor_moved()"
endif
endfunction
1 0.000002 function! UltiSnips#Edit(bang, ...)
if a:0 == 1 && a:1 != ''
let type = a:1
else
let type = ""
endif
exec g:_uspy "vim.command(\"let file = '%s'\" % UltiSnips_Manager._file_to_edit(vim.eval(\"type\"), vim.eval('a:bang')))"
if !len(file)
return
endif
let mode = 'e'
if exists('g:UltiSnipsEditSplit')
if g:UltiSnipsEditSplit == 'vertical'
let mode = 'vs'
elseif g:UltiSnipsEditSplit == 'horizontal'
let mode = 'sp'
elseif g:UltiSnipsEditSplit == 'tabdo'
let mode = 'tabedit'
elseif g:UltiSnipsEditSplit == 'context'
let mode = 'vs'
if winwidth(0) <= 2 * (&tw ? &tw : 80)
let mode = 'sp'
endif
endif
endif
exe ':'.mode.' '.escape(file, ' ')
endfunction
1 0.000001 function! UltiSnips#AddFiletypes(filetypes)
exec g:_uspy "UltiSnips_Manager.add_buffer_filetypes('" . a:filetypes . "')"
return ""
endfunction
1 0.000002 function! UltiSnips#FileTypeComplete(arglead, cmdline, cursorpos)
let ret = {}
let items = map(
\ split(globpath(&runtimepath, 'syntax/*.vim'), '\n'),
\ 'fnamemodify(v:val, ":t:r")'
\ )
call insert(items, 'all')
for item in items
if !has_key(ret, item) && item =~ '^'.a:arglead
let ret[item] = 1
endif
endfor
return sort(keys(ret))
endfunction
1 0.000001 function! UltiSnips#ExpandSnippet()
exec g:_uspy "UltiSnips_Manager.expand()"
return ""
endfunction
1 0.000001 function! UltiSnips#ExpandSnippetOrJump()
call s:compensate_for_pum()
exec g:_uspy "UltiSnips_Manager.expand_or_jump()"
return ""
endfunction
1 0.000001 function! UltiSnips#ListSnippets()
exec g:_uspy "UltiSnips_Manager.list_snippets()"
return ""
endfunction
1 0.000001 function! UltiSnips#SnippetsInCurrentScope(...)
let g:current_ulti_dict = {}
let all = get(a:, 1, 0)
if all
let g:current_ulti_dict_info = {}
endif
exec g:_uspy "UltiSnips_Manager.snippets_in_current_scope(" . all . ")"
return g:current_ulti_dict
endfunction
1 0.000002 function! UltiSnips#SaveLastVisualSelection() range
exec g:_uspy "UltiSnips_Manager._save_last_visual_selection()"
return ""
endfunction
1 0.000001 function! UltiSnips#JumpBackwards()
call s:compensate_for_pum()
exec g:_uspy "UltiSnips_Manager.jump_backwards()"
return ""
endfunction
1 0.000001 function! UltiSnips#JumpForwards()
call s:compensate_for_pum()
exec g:_uspy "UltiSnips_Manager.jump_forwards()"
return ""
endfunction
1 0.000002 function! UltiSnips#AddSnippetWithPriority(trigger, value, description, options, filetype, priority)
exec g:_uspy "trigger = vim.eval(\"a:trigger\")"
exec g:_uspy "value = vim.eval(\"a:value\")"
exec g:_uspy "description = vim.eval(\"a:description\")"
exec g:_uspy "options = vim.eval(\"a:options\")"
exec g:_uspy "filetype = vim.eval(\"a:filetype\")"
exec g:_uspy "priority = vim.eval(\"a:priority\")"
exec g:_uspy "UltiSnips_Manager.add_snippet(trigger, value, description, options, filetype, priority)"
return ""
endfunction
1 0.000001 function! UltiSnips#Anon(value, ...)
" Takes the same arguments as SnippetManager.expand_anon:
" (value, trigger="", description="", options="")
exec g:_uspy "args = vim.eval(\"a:000\")"
exec g:_uspy "value = vim.eval(\"a:value\")"
exec g:_uspy "UltiSnips_Manager.expand_anon(value, *args)"
return ""
endfunction
1 0.000001 function! UltiSnips#CursorMoved()
exec g:_uspy "UltiSnips_Manager._cursor_moved()"
endf
1 0.000001 function! UltiSnips#LeavingBuffer()
exec g:_uspy "UltiSnips_Manager._leaving_buffer()"
endf
1 0.000001 function! UltiSnips#LeavingInsertMode()
exec g:_uspy "UltiSnips_Manager._leaving_insert_mode()"
endfunction
1 0.000001 function! UltiSnips#TrackChange()
exec g:_uspy "UltiSnips_Manager._track_change()"
endfunction
1 0.000001 function! UltiSnips#RefreshSnippets()
exec g:_uspy "UltiSnips_Manager._refresh_snippets()"
endfunction
" }}}
SCRIPT /home/myitcv/.vim/plugged/vim-go/autoload/go/complete.vim
Sourced 1 time
Total time: 0.000307
Self time: 0.000307
count total (s) self (s)
1 0.000018 function! s:gocodeCommand(cmd, args) abort
let l:gocode_bin = "gocode"
let l:gomod = go#util#gomod()
if filereadable(l:gomod)
" Save the file when in module mode so that go list can read the
" imports. If the user doesn't have autowrite or autorwriteall enabled,
" they'll need to write the file manually to get reliable results.
" See https://github.com/fatih/vim-go/pull/1988#issuecomment-428576989.
"
" TODO(bc): don't save the file when in module mode once
" golang.org/x/tools/go/packages has support for an overlay and it's used
" by gocode.
call go#cmd#autowrite()
let l:gocode_bin = "gocode-gomod"
endif
let bin_path = go#path#CheckBinPath(l:gocode_bin)
if empty(bin_path)
return []
endif
let socket_type = go#config#GocodeSocketType()
let cmd = [bin_path]
let cmd = extend(cmd, ['-sock', socket_type])
let cmd = extend(cmd, ['-f', 'vim'])
if go#config#GocodeProposeBuiltins()
let cmd = extend(cmd, ['-builtin'])
endif
if go#config#GocodeProposeSource()
let cmd = extend(cmd, ['-source'])
else
let cmd = extend(cmd, ['-fallback-to-source'])
endif
if go#config#GocodeUnimportedPackages()
let cmd = extend(cmd, ['-unimported-packages'])
endif
let cmd = extend(cmd, [a:cmd])
let cmd = extend(cmd, a:args)
return cmd
endfunction
1 0.000004 function! s:sync_gocode(cmd, args, input) abort
" We might hit cache problems, as gocode doesn't handle different GOPATHs
" well. See: https://github.com/nsf/gocode/issues/239
let old_goroot = $GOROOT
let $GOROOT = go#util#env("goroot")
try
let cmd = s:gocodeCommand(a:cmd, a:args)
" gocode can sometimes be slow, so redraw now to avoid waiting for gocode
" to return before redrawing automatically.
redraw
let [l:result, l:err] = go#util#Exec(cmd, a:input)
finally
let $GOROOT = old_goroot
endtry
if l:err != 0
return "[0, []]"
endif
if &encoding != 'utf-8'
let l:result = iconv(l:result, 'utf-8', &encoding)
endif
return l:result
endfunction
1 0.000003 function! s:gocodeAutocomplete() abort
" use the offset as is, because the cursor position is the position for
" which autocomplete candidates are needed.
return s:sync_gocode('autocomplete',
\ [expand('%:p'), go#util#OffsetCursor()],
\ go#util#GetLines())
endfunction
" go#complete#GoInfo returns the description of the identifier under the
" cursor.
1 0.000002 function! go#complete#GetInfo() abort
return s:sync_info(0)
endfunction
1 0.000003 function! go#complete#Info(showstatus) abort
if go#util#has_job(1)
return s:async_info(1, a:showstatus)
else
return s:sync_info(1)
endif
endfunction
1 0.000003 function! s:async_info(echo, showstatus)
let state = {'echo': a:echo}
function! s:complete(job, exit_status, messages) abort dict
if a:exit_status != 0
return
endif
if &encoding != 'utf-8'
let i = 0
while i < len(a:messages)
let a:messages[i] = iconv(a:messages[i], 'utf-8', &encoding)
let i += 1
endwhile
endif
let result = s:info_filter(self.echo, join(a:messages, "\n"))
call s:info_complete(self.echo, result)
endfunction
" explicitly bind complete to state so that within it, self will
" always refer to state. See :help Partial for more information.
let state.complete = function('s:complete', [], state)
" add 1 to the offset, so that the position at the cursor will be included
" in gocode's search
let offset = go#util#OffsetCursor()+1
" We might hit cache problems, as gocode doesn't handle different GOPATHs
" well. See: https://github.com/nsf/gocode/issues/239
let env = {
\ "GOROOT": go#util#env("goroot")
\ }
let opts = {
\ 'bang': 1,
\ 'complete': state.complete,
\ 'for': '_',
\ }
if a:showstatus
let opts.statustype = 'gocode'
endif
let opts = go#job#Options(l:opts)
let cmd = s:gocodeCommand('autocomplete',
\ [expand('%:p'), offset])
" TODO(bc): Don't write the buffer to a file; pass the buffer directly to
" gocode's stdin. It shouldn't be necessary to use {in_io: 'file', in_name:
" s:gocodeFile()}, but unfortunately {in_io: 'buffer', in_buf: bufnr('%')}
" doesn't work.
call extend(opts, {
\ 'env': env,
\ 'in_io': 'file',
\ 'in_name': s:gocodeFile(),
\ })
call go#job#Start(cmd, opts)
endfunction
1 0.000003 function! s:gocodeFile()
let file = tempname()
call writefile(go#util#GetLines(), file)
return file
endfunction
1 0.000002 function! s:sync_info(echo)
" add 1 to the offset, so that the position at the cursor will be included
" in gocode's search
let offset = go#util#OffsetCursor()+1
let result = s:sync_gocode('autocomplete',
\ [expand('%:p'), offset],
\ go#util#GetLines())
let result = s:info_filter(a:echo, result)
return s:info_complete(a:echo, result)
endfunction
1 0.000003 function! s:info_filter(echo, result) abort
if empty(a:result)
return ""
endif
let l:result = eval(a:result)
if len(l:result) != 2
return ""
endif
let l:candidates = l:result[1]
if len(l:candidates) == 1
" When gocode panics in vim mode, it returns
" [0, [{'word': 'PANIC', 'abbr': 'PANIC PANIC PANIC', 'info': 'PANIC PANIC PANIC'}]]
if a:echo && l:candidates[0].info ==# "PANIC PANIC PANIC"
return ""
endif
return l:candidates[0].info
endif
let filtered = []
let wordMatch = '\<' . expand("<cword>") . '\>'
" escape single quotes in wordMatch before passing it to filter
let wordMatch = substitute(wordMatch, "'", "''", "g")
let filtered = filter(l:candidates, "v:val.info =~ '".wordMatch."'")
if len(l:filtered) != 1
return ""
endif
return l:filtered[0].info
endfunction
1 0.000003 function! s:info_complete(echo, result) abort
if a:echo && !empty(a:result)
echo "vim-go: " | echohl Function | echon a:result | echohl None
endif
return a:result
endfunction
1 0.000003 function! s:trim_bracket(val) abort
let a:val.word = substitute(a:val.word, '[(){}\[\]]\+$', '', '')
return a:val
endfunction
1 0.000008 let s:completions = ""
1 0.000004 function! go#complete#Complete(findstart, base) abort
"findstart = 1 when we need to get the text length
if a:findstart == 1
execute "silent let s:completions = " . s:gocodeAutocomplete()
return col('.') - s:completions[0] - 1
"findstart = 0 when we need to return the list of completions
else
let s = getline(".")[col('.') - 1]
if s =~ '[(){}\{\}]'
return map(copy(s:completions[1]), 's:trim_bracket(v:val)')
endif
return s:completions[1]
endif
endfunction
1 0.000003 function! go#complete#ToggleAutoTypeInfo() abort
if go#config#AutoTypeInfo()
call go#config#SetAutoTypeInfo(0)
call go#util#EchoProgress("auto type info disabled")
return
end
call go#config#SetAutoTypeInfo(1)
call go#util#EchoProgress("auto type info enabled")
endfunction
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/autoload/go/util.vim
Sourced 1 time
Total time: 0.000467
Self time: 0.000467
count total (s) self (s)
" PathSep returns the appropriate OS specific path separator.
1 0.000004 function! go#util#PathSep() abort
if go#util#IsWin()
return '\'
endif
return '/'
endfunction
" PathListSep returns the appropriate OS specific path list separator.
1 0.000002 function! go#util#PathListSep() abort
if go#util#IsWin()
return ";"
endif
return ":"
endfunction
" LineEnding returns the correct line ending, based on the current fileformat
1 0.000002 function! go#util#LineEnding() abort
if &fileformat == 'dos'
return "\r\n"
elseif &fileformat == 'mac'
return "\r"
endif
return "\n"
endfunction
" Join joins any number of path elements into a single path, adding a
" Separator if necessary and returns the result
1 0.000002 function! go#util#Join(...) abort
return join(a:000, go#util#PathSep())
endfunction
" IsWin returns 1 if current OS is Windows or 0 otherwise
1 0.000002 function! go#util#IsWin() abort
let win = ['win16', 'win32', 'win64', 'win95']
for w in win
if (has(w))
return 1
endif
endfor
return 0
endfunction
" IsMac returns 1 if current OS is macOS or 0 otherwise.
1 0.000002 function! go#util#IsMac() abort
return has('mac') ||
\ has('macunix') ||
\ has('gui_macvim') ||
\ go#util#Exec(['uname'])[0] =~? '^darwin'
endfunction
" Checks if using:
" 1) Windows system,
" 2) And has cygpath executable,
" 3) And uses *sh* as 'shell'
1 0.000003 function! go#util#IsUsingCygwinShell()
return go#util#IsWin() && executable('cygpath') && &shell =~ '.*sh.*'
endfunction
" Check if Vim jobs API is supported.
"
" The (optional) first parameter can be added to indicate the 'cwd' or 'env'
" parameters will be used, which wasn't added until a later version.
1 0.000002 function! go#util#has_job(...) abort
if has('nvim')
return 1
endif
" cwd and env parameters to job_start was added in this version.
if a:0 > 0 && a:1 is 1
return has('job') && has("patch-8.0.0902")
endif
" job was introduced in 7.4.xxx however there are multiple bug fixes and one
" of the latest is 8.0.0087 which is required for a stable async API.
return has('job') && has("patch-8.0.0087")
endfunction
1 0.000005 let s:env_cache = {}
" env returns the go environment variable for the given key. Where key can be
" GOARCH, GOOS, GOROOT, etc... It caches the result and returns the cached
" version.
1 0.000002 function! go#util#env(key) abort
let l:key = tolower(a:key)
if has_key(s:env_cache, l:key)
return s:env_cache[l:key]
endif
if executable('go')
let l:var = call('go#util#'.l:key, [])
if go#util#ShellError() != 0
call go#util#EchoError(printf("'go env %s' failed", toupper(l:key)))
return ''
endif
else
let l:var = eval("$".toupper(a:key))
endif
let s:env_cache[l:key] = l:var
return l:var
endfunction
" goarch returns 'go env GOARCH'. This is an internal function and shouldn't
" be used. Instead use 'go#util#env("goarch")'
1 0.000002 function! go#util#goarch() abort
return substitute(s:exec(['go', 'env', 'GOARCH'])[0], '\n', '', 'g')
endfunction
" goos returns 'go env GOOS'. This is an internal function and shouldn't
" be used. Instead use 'go#util#env("goos")'
1 0.000002 function! go#util#goos() abort
return substitute(s:exec(['go', 'env', 'GOOS'])[0], '\n', '', 'g')
endfunction
" goroot returns 'go env GOROOT'. This is an internal function and shouldn't
" be used. Instead use 'go#util#env("goroot")'
1 0.000002 function! go#util#goroot() abort
return substitute(s:exec(['go', 'env', 'GOROOT'])[0], '\n', '', 'g')
endfunction
" gopath returns 'go env GOPATH'. This is an internal function and shouldn't
" be used. Instead use 'go#util#env("gopath")'
1 0.000002 function! go#util#gopath() abort
return substitute(s:exec(['go', 'env', 'GOPATH'])[0], '\n', '', 'g')
endfunction
" gomod returns 'go env GOMOD'. gomod changes depending on the folder. Don't
" use go#util#env as it caches the value.
1 0.000002 function! go#util#gomod() abort
return substitute(s:exec(['go', 'env', 'GOMOD'])[0], '\n', '', 'g')
endfunction
1 0.000002 function! go#util#osarch() abort
return go#util#env("goos") . '_' . go#util#env("goarch")
endfunction
" Run a shell command.
"
" It will temporary set the shell to /bin/sh for Unix-like systems if possible,
" so that we always use a standard POSIX-compatible Bourne shell (and not e.g.
" csh, fish, etc.) See #988 and #1276.
1 0.000004 function! s:system(cmd, ...) abort
" Preserve original shell, shellredir and shellcmdflag values
let l:shell = &shell
let l:shellredir = &shellredir
let l:shellcmdflag = &shellcmdflag
if !go#util#IsWin() && executable('/bin/sh')
set shell=/bin/sh shellredir=>%s\ 2>&1 shellcmdflag=-c
endif
try
return call('system', [a:cmd] + a:000)
finally
" Restore original values
let &shell = l:shell
let &shellredir = l:shellredir
let &shellcmdflag = l:shellcmdflag
endtry
endfunction
" System runs a shell command "str". Every arguments after "str" is passed to
" stdin.
1 0.000002 function! go#util#System(str, ...) abort
return call('s:system', [a:str] + a:000)
endfunction
" Exec runs a shell command "cmd", which must be a list, one argument per item.
" Every list entry will be automatically shell-escaped
" Every other argument is passed to stdin.
1 0.000002 function! go#util#Exec(cmd, ...) abort
if len(a:cmd) == 0
call go#util#EchoError("go#util#Exec() called with empty a:cmd")
return ['', 1]
endif
let l:bin = a:cmd[0]
" Lookup the full path, respecting settings such as 'go_bin_path'. On errors,
" CheckBinPath will show a warning for us.
let l:bin = go#path#CheckBinPath(l:bin)
if empty(l:bin)
return ['', 1]
endif
" Finally execute the command using the full, resolved path. Do not pass the
" unmodified command as the correct program might not exist in $PATH.
return call('s:exec', [[l:bin] + a:cmd[1:]] + a:000)
endfunction
1 0.000003 function! s:exec(cmd, ...) abort
let l:bin = a:cmd[0]
let l:cmd = go#util#Shelljoin([l:bin] + a:cmd[1:])
if go#util#HasDebug('shell-commands')
call go#util#EchoInfo('shell command: ' . l:cmd)
endif
let l:out = call('s:system', [l:cmd] + a:000)
return [l:out, go#util#ShellError()]
endfunction
1 0.000002 function! go#util#ShellError() abort
return v:shell_error
endfunction
" StripPath strips the path's last character if it's a path separator.
" example: '/foo/bar/' -> '/foo/bar'
1 0.000002 function! go#util#StripPathSep(path) abort
let last_char = strlen(a:path) - 1
if a:path[last_char] == go#util#PathSep()
return strpart(a:path, 0, last_char)
endif
return a:path
endfunction
" StripTrailingSlash strips the trailing slash from the given path list.
" example: ['/foo/bar/'] -> ['/foo/bar']
1 0.000003 function! go#util#StripTrailingSlash(paths) abort
return map(copy(a:paths), 'go#util#StripPathSep(v:val)')
endfunction
" Shelljoin returns a shell-safe string representation of arglist. The
" {special} argument of shellescape() may optionally be passed.
1 0.000003 function! go#util#Shelljoin(arglist, ...) abort
try
let ssl_save = &shellslash
set noshellslash
if a:0
return join(map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')'), ' ')
endif
return join(map(copy(a:arglist), 'shellescape(v:val)'), ' ')
finally
let &shellslash = ssl_save
endtry
endfunction
1 0.000003 fu! go#util#Shellescape(arg)
try
let ssl_save = &shellslash
set noshellslash
return shellescape(a:arg)
finally
let &shellslash = ssl_save
endtry
endf
" Shelllist returns a shell-safe representation of the items in the given
" arglist. The {special} argument of shellescape() may optionally be passed.
1 0.000002 function! go#util#Shelllist(arglist, ...) abort
try
let ssl_save = &shellslash
set noshellslash
if a:0
return map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')')
endif
return map(copy(a:arglist), 'shellescape(v:val)')
finally
let &shellslash = ssl_save
endtry
endfunction
" Returns the byte offset for line and column
1 0.000002 function! go#util#Offset(line, col) abort
if &encoding != 'utf-8'
let sep = go#util#LineEnding()
let buf = a:line == 1 ? '' : (join(getline(1, a:line-1), sep) . sep)
let buf .= a:col == 1 ? '' : getline('.')[:a:col-2]
return len(iconv(buf, &encoding, 'utf-8'))
endif
return line2byte(a:line) + (a:col-2)
endfunction
"
" Returns the byte offset for the cursor
1 0.000002 function! go#util#OffsetCursor() abort
return go#util#Offset(line('.'), col('.'))
endfunction
" Windo is like the built-in :windo, only it returns to the window the command
" was issued from
1 0.000002 function! go#util#Windo(command) abort
let s:currentWindow = winnr()
try
execute "windo " . a:command
finally
execute s:currentWindow. "wincmd w"
unlet s:currentWindow
endtry
endfunction
" snippetcase converts the given word to given preferred snippet setting type
" case.
1 0.000002 function! go#util#snippetcase(word) abort
let l:snippet_case = go#config#AddtagsTransform()
if l:snippet_case == "snakecase"
return go#util#snakecase(a:word)
elseif l:snippet_case == "camelcase"
return go#util#camelcase(a:word)
else
return a:word " do nothing
endif
endfunction
" snakecase converts a string to snake case. i.e: FooBar -> foo_bar
" Copied from tpope/vim-abolish
1 0.000003 function! go#util#snakecase(word) abort
let word = substitute(a:word, '::', '/', 'g')
let word = substitute(word, '\(\u\+\)\(\u\l\)', '\1_\2', 'g')
let word = substitute(word, '\(\l\|\d\)\(\u\)', '\1_\2', 'g')
let word = substitute(word, '[.-]', '_', 'g')
let word = tolower(word)
return word
endfunction
" camelcase converts a string to camel case. e.g. FooBar or foo_bar will become
" fooBar.
" Copied from tpope/vim-abolish.
1 0.000002 function! go#util#camelcase(word) abort
let word = substitute(a:word, '-', '_', 'g')
if word !~# '_' && word =~# '\l'
return substitute(word, '^.', '\l&', '')
else
return substitute(word, '\C\(_\)\=\(.\)', '\=submatch(1)==""?tolower(submatch(2)) : toupper(submatch(2))','g')
endif
endfunction
" pascalcase converts a string to 'PascalCase'. e.g. fooBar or foo_bar will
" become FooBar.
1 0.000003 function! go#util#pascalcase(word) abort
let word = go#util#camelcase(a:word)
return toupper(word[0]) . word[1:]
endfunction
" Echo a message to the screen and highlight it with the group in a:hi.
"
" The message can be a list or string; every line with be :echomsg'd separately.
1 0.000002 function! s:echo(msg, hi)
let l:msg = []
if type(a:msg) != type([])
let l:msg = split(a:msg, "\n")
else
let l:msg = a:msg
endif
" Tabs display as ^I or <09>, so manually expand them.
let l:msg = map(l:msg, 'substitute(v:val, "\t", " ", "")')
exe 'echohl ' . a:hi
for line in l:msg
echom "vim-go: " . line
endfor
echohl None
endfunction
1 0.000002 function! go#util#EchoSuccess(msg)
call s:echo(a:msg, 'Function')
endfunction
1 0.000002 function! go#util#EchoError(msg)
call s:echo(a:msg, 'ErrorMsg')
endfunction
1 0.000002 function! go#util#EchoWarning(msg)
call s:echo(a:msg, 'WarningMsg')
endfunction
1 0.000002 function! go#util#EchoProgress(msg)
redraw
call s:echo(a:msg, 'Identifier')
endfunction
1 0.000002 function! go#util#EchoInfo(msg)
call s:echo(a:msg, 'Debug')
endfunction
" Get all lines in the buffer as a a list.
1 0.000001 function! go#util#GetLines()
let buf = getline(1, '$')
if &encoding != 'utf-8'
let buf = map(buf, 'iconv(v:val, &encoding, "utf-8")')
endif
if &l:fileformat == 'dos'
" XXX: line2byte() depend on 'fileformat' option.
" so if fileformat is 'dos', 'buf' must include '\r'.
let buf = map(buf, 'v:val."\r"')
endif
return buf
endfunction
" Convert the current buffer to the "archive" format of
" golang.org/x/tools/go/buildutil:
" https://godoc.org/golang.org/x/tools/go/buildutil#ParseOverlayArchive
"
" > The archive consists of a series of files. Each file consists of a name, a
" > decimal file size and the file contents, separated by newlinews. No newline
" > follows after the file contents.
1 0.000001 function! go#util#archive()
let l:buffer = join(go#util#GetLines(), "\n")
return expand("%:p:gs!\\!/!") . "\n" . strlen(l:buffer) . "\n" . l:buffer
endfunction
" Make a named temporary directory which starts with "prefix".
"
" Unfortunately Vim's tempname() is not portable enough across various systems;
" see: https://github.com/mattn/vim-go/pull/3#discussion_r138084911
1 0.000002 function! go#util#tempdir(prefix) abort
" See :help tempfile
if go#util#IsWin()
let l:dirs = [$TMP, $TEMP, 'c:\tmp', 'c:\temp']
else
let l:dirs = [$TMPDIR, '/tmp', './', $HOME]
endif
let l:dir = ''
for l:d in dirs
if !empty(l:d) && filewritable(l:d) == 2
let l:dir = l:d
break
endif
endfor
if l:dir == ''
call go#util#EchoError('Unable to find directory to store temporary directory in')
return
endif
" Not great randomness, but "good enough" for our purpose here.
let l:rnd = sha256(printf('%s%s', localtime(), fnamemodify(bufname(''), ":p")))
let l:tmp = printf("%s/%s%s", l:dir, a:prefix, l:rnd)
call mkdir(l:tmp, 'p', 0700)
return l:tmp
endfunction
" Report if the user enabled a debug flag in g:go_debug.
1 0.000002 function! go#util#HasDebug(flag)
return index(go#config#Debug(), a:flag) >= 0
endfunction
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/autoload/go/cmd.vim
Sourced 1 time
Total time: 0.000167
Self time: 0.000167
count total (s) self (s)
1 0.000005 function! go#cmd#autowrite() abort
if &autowrite == 1 || &autowriteall == 1
silent! wall
else
for l:nr in range(0, bufnr('$'))
if buflisted(l:nr) && getbufvar(l:nr, '&modified')
" Sleep one second to make sure people see the message. Otherwise it is
" often immediacy overwritten by the async messages (which also don't
" invoke the "hit ENTER" prompt).
call go#util#EchoWarning('[No write since last change]')
sleep 1
return
endif
endfor
endif
endfunction
" Build builds the source code without producing any output binary. We live in
" an editor so the best is to build it to catch errors and fix them. By
" default it tries to call simply 'go build', but it first tries to get all
" dependent files for the current folder and passes it to go build.
1 0.000002 function! go#cmd#Build(bang, ...) abort
" Create our command arguments. go build discards any results when it
" compiles multiple packages. So we pass the `errors` package just as an
" placeholder with the current folder (indicated with '.'). We also pass -i
" that tries to install the dependencies, this has the side effect that it
" caches the build results, so every other build is faster.
let l:args =
\ ['build', '-tags', go#config#BuildTags()] +
\ map(copy(a:000), "expand(v:val)") +
\ [".", "errors"]
" Vim and Neovim async.
if go#util#has_job()
call s:cmd_job({
\ 'cmd': ['go'] + args,
\ 'bang': a:bang,
\ 'for': 'GoBuild',
\ 'statustype': 'build'
\})
" Vim 7.4 without async
else
let default_makeprg = &makeprg
let &makeprg = "go " . join(go#util#Shelllist(args), ' ')
let l:listtype = go#list#Type("GoBuild")
" execute make inside the source folder so we can parse the errors
" correctly
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
let dir = getcwd()
try
execute cd . fnameescape(expand("%:p:h"))
if l:listtype == "locationlist"
silent! exe 'lmake!'
else
silent! exe 'make!'
endif
redraw!
finally
execute cd . fnameescape(dir)
endtry
let errors = go#list#Get(l:listtype)
call go#list#Window(l:listtype, len(errors))
if !empty(errors) && !a:bang
call go#list#JumpToFirst(l:listtype)
else
call go#util#EchoSuccess("[build] SUCCESS")
endif
let &makeprg = default_makeprg
endif
endfunction
" BuildTags sets or shows the current build tags used for tools
1 0.000002 function! go#cmd#BuildTags(bang, ...) abort
if a:0
let v = a:1
if v == '""' || v == "''"
let v = ""
endif
call go#config#SetBuildTags(v)
let tags = go#config#BuildTags()
if empty(tags)
call go#util#EchoSuccess("build tags are cleared")
else
call go#util#EchoSuccess("build tags are changed to: " . tags)
endif
return
endif
let tags = go#config#BuildTags()
if empty(tags)
call go#util#EchoSuccess("build tags are not set")
else
call go#util#EchoSuccess("current build tags: " . tags)
endif
endfunction
" Run runs the current file (and their dependencies if any) in a new terminal.
1 0.000002 function! go#cmd#RunTerm(bang, mode, files) abort
let cmd = "go run "
let tags = go#config#BuildTags()
if len(tags) > 0
let cmd .= "-tags " . go#util#Shellescape(tags) . " "
endif
if empty(a:files)
let cmd .= go#util#Shelljoin(go#tool#Files())
else
let cmd .= go#util#Shelljoin(map(copy(a:files), "expand(v:val)"), 1)
endif
call go#term#newmode(a:bang, cmd, a:mode)
endfunction
" Run runs the current file (and their dependencies if any) and outputs it.
" This is intended to test small programs and play with them. It's not
" suitable for long running apps, because vim is blocking by default and
" calling long running apps will block the whole UI.
1 0.000001 function! go#cmd#Run(bang, ...) abort
if has('nvim')
call go#cmd#RunTerm(a:bang, '', a:000)
return
endif
if go#util#has_job()
" NOTE(arslan): 'term': 'open' case is not implement for +jobs. This means
" executions waiting for stdin will not work. That's why we don't do
" anything. Once this is implemented we're going to make :GoRun async
endif
let cmd = "go run "
let tags = go#config#BuildTags()
if len(tags) > 0
let cmd .= "-tags " . go#util#Shellescape(tags) . " "
endif
if go#util#IsWin()
if a:0 == 0
exec '!' . cmd . go#util#Shelljoin(go#tool#Files(), 1)
else
exec '!' . cmd . go#util#Shelljoin(map(copy(a:000), "expand(v:val)"), 1)
endif
if v:shell_error
redraws! | echon "vim-go: [run] " | echohl ErrorMsg | echon "FAILED"| echohl None
else
redraws! | echon "vim-go: [run] " | echohl Function | echon "SUCCESS"| echohl None
endif
return
endif
" :make expands '%' and '#' wildcards, so they must also be escaped
let default_makeprg = &makeprg
if a:0 == 0
let &makeprg = cmd . go#util#Shelljoin(go#tool#Files(), 1)
else
let &makeprg = cmd . go#util#Shelljoin(map(copy(a:000), "expand(v:val)"), 1)
endif
let l:listtype = go#list#Type("GoRun")
if l:listtype == "locationlist"
exe 'lmake!'
else
exe 'make!'
endif
let items = go#list#Get(l:listtype)
let errors = go#tool#FilterValids(items)
call go#list#Populate(l:listtype, errors, &makeprg)
call go#list#Window(l:listtype, len(errors))
if !empty(errors) && !a:bang
call go#list#JumpToFirst(l:listtype)
endif
let &makeprg = default_makeprg
endfunction
" Install installs the package by simple calling 'go install'. If any argument
" is given(which are passed directly to 'go install') it tries to install
" those packages. Errors are populated in the location window.
1 0.000002 function! go#cmd#Install(bang, ...) abort
" use vim's job functionality to call it asynchronously
if go#util#has_job()
" expand all wildcards(i.e: '%' to the current file name)
let goargs = map(copy(a:000), "expand(v:val)")
call s:cmd_job({
\ 'cmd': ['go', 'install', '-tags', go#config#BuildTags()] + goargs,
\ 'bang': a:bang,
\ 'for': 'GoInstall',
\ 'statustype': 'install'
\})
return
endif
let default_makeprg = &makeprg
" :make expands '%' and '#' wildcards, so they must also be escaped
let goargs = go#util#Shelljoin(map(copy(a:000), "expand(v:val)"), 1)
let &makeprg = "go install " . goargs
let l:listtype = go#list#Type("GoInstall")
" execute make inside the source folder so we can parse the errors
" correctly
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
let dir = getcwd()
try
execute cd . fnameescape(expand("%:p:h"))
if l:listtype == "locationlist"
silent! exe 'lmake!'
else
silent! exe 'make!'
endif
redraw!
finally
execute cd . fnameescape(dir)
endtry
let errors = go#list#Get(l:listtype)
call go#list#Window(l:listtype, len(errors))
if !empty(errors) && !a:bang
call go#list#JumpToFirst(l:listtype)
else
call go#util#EchoSuccess("installed to ". go#path#Default())
endif
let &makeprg = default_makeprg
endfunction
" Generate runs 'go generate' in similar fashion to go#cmd#Build()
1 0.000001 function! go#cmd#Generate(bang, ...) abort
let default_makeprg = &makeprg
" :make expands '%' and '#' wildcards, so they must also be escaped
let goargs = go#util#Shelljoin(map(copy(a:000), "expand(v:val)"), 1)
if go#util#ShellError() != 0
let &makeprg = "go generate " . goargs
else
let gofiles = go#util#Shelljoin(go#tool#Files(), 1)
let &makeprg = "go generate " . goargs . ' ' . gofiles
endif
let l:listtype = go#list#Type("GoGenerate")
echon "vim-go: " | echohl Identifier | echon "generating ..."| echohl None
if l:listtype == "locationlist"
silent! exe 'lmake!'
else
silent! exe 'make!'
endif
redraw!
let errors = go#list#Get(l:listtype)
call go#list#Window(l:listtype, len(errors))
if !empty(errors)
if !a:bang
call go#list#JumpToFirst(l:listtype)
endif
else
redraws! | echon "vim-go: " | echohl Function | echon "[generate] SUCCESS"| echohl None
endif
let &makeprg = default_makeprg
endfunction
" ---------------------
" | Vim job callbacks |
" ---------------------
1 0.000002 function! s:cmd_job(args) abort
" autowrite is not enabled for jobs
call go#cmd#autowrite()
call go#job#Spawn(a:args.cmd, a:args)
endfunction
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/autoload/go/fmt.vim
Sourced 1 time
Total time: 0.000118
Self time: 0.000118
count total (s) self (s)
" Copyright 2011 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" fmt.vim: Vim command to format Go files with gofmt (and gofmt compatible
" toorls, such as goimports).
" we have those problems :
" http://stackoverflow.com/questions/12741977/prevent-vim-from-updating-its-undo-tree
" http://stackoverflow.com/questions/18532692/golang-formatter-and-vim-how-to-destroy-history-record?rq=1
"
" The below function is an improved version that aims to fix all problems.
" it doesn't undo changes and break undo history. If you are here reading
" this and have VimL experience, please look at the function for
" improvements, patches are welcome :)
1 0.000003 function! go#fmt#Format(withGoimport) abort
if go#config#FmtExperimental()
" Using winsaveview to save/restore cursor state has the problem of
" closing folds on save:
" https://github.com/fatih/vim-go/issues/502
" One fix is to use mkview instead. Unfortunately, this sometimes causes
" other bad side effects:
" https://github.com/fatih/vim-go/issues/728
" and still closes all folds if foldlevel>0:
" https://github.com/fatih/vim-go/issues/732
let l:curw = {}
try
mkview!
catch
let l:curw = winsaveview()
endtry
" save our undo file to be restored after we are done. This is needed to
" prevent an additional undo jump due to BufWritePre auto command and also
" restore 'redo' history because it's getting being destroyed every
" BufWritePre
let tmpundofile = tempname()
exe 'wundo! ' . tmpundofile
else
" Save cursor position and many other things.
let l:curw = winsaveview()
endif
" Write current unsaved buffer to a temp file
let l:tmpname = tempname() . '.go'
call writefile(go#util#GetLines(), l:tmpname)
if go#util#IsWin()
let l:tmpname = tr(l:tmpname, '\', '/')
endif
let bin_name = go#config#FmtCommand()
if a:withGoimport == 1
let bin_name = "goimports"
endif
let current_col = col('.')
let [l:out, l:err] = go#fmt#run(bin_name, l:tmpname, expand('%'))
let diff_offset = len(readfile(l:tmpname)) - line('$')
if l:err == 0
call go#fmt#update_file(l:tmpname, expand('%'))
elseif !go#config#FmtFailSilently()
let errors = s:parse_errors(expand('%'), out)
call s:show_errors(errors)
endif
" We didn't use the temp file, so clean up
call delete(l:tmpname)
if go#config#FmtExperimental()
" restore our undo history
silent! exe 'rundo ' . tmpundofile
call delete(tmpundofile)
" Restore our cursor/windows positions, folds, etc.
if empty(l:curw)
silent! loadview
else
call winrestview(l:curw)
endif
else
" Restore our cursor/windows positions.
call winrestview(l:curw)
endif
" be smart and jump to the line the new statement was added/removed
call cursor(line('.') + diff_offset, current_col)
" Syntax highlighting breaks less often.
syntax sync fromstart
endfunction
" update_file updates the target file with the given formatted source
1 0.000002 function! go#fmt#update_file(source, target)
" remove undo point caused via BufWritePre
try | silent undojoin | catch | endtry
let old_fileformat = &fileformat
if exists("*getfperm")
" save file permissions
let original_fperm = getfperm(a:target)
endif
call rename(a:source, a:target)
" restore file permissions
if exists("*setfperm") && original_fperm != ''
call setfperm(a:target , original_fperm)
endif
" reload buffer to reflect latest changes
silent edit!
let &fileformat = old_fileformat
let &syntax = &syntax
let l:listtype = go#list#Type("GoFmt")
" the title information was introduced with 7.4-2200
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
if has('patch-7.4.2200')
" clean up previous list
if l:listtype == "quickfix"
let l:list_title = getqflist({'title': 1})
else
let l:list_title = getloclist(0, {'title': 1})
endif
else
" can't check the title, so assume that the list was for go fmt.
let l:list_title = {'title': 'Format'}
endif
if has_key(l:list_title, "title") && l:list_title['title'] == "Format"
call go#list#Clean(l:listtype)
endif
endfunction
" run runs the gofmt/goimport command for the given source file and returns
" the output of the executed command. Target is the real file to be formatted.
1 0.000001 function! go#fmt#run(bin_name, source, target)
let l:cmd = s:fmt_cmd(a:bin_name, a:source, a:target)
if empty(l:cmd)
return
endif
return go#util#Exec(l:cmd)
endfunction
" fmt_cmd returns the command to run as a list.
1 0.000002 function! s:fmt_cmd(bin_name, source, target)
let l:cmd = [a:bin_name, '-w']
" add the options for binary (if any). go_fmt_options was by default of type
" string, however to allow customization it's now a dictionary of binary
" name mapping to options.
let opts = go#config#FmtOptions()
if type(opts) == type({})
let opts = has_key(opts, a:bin_name) ? opts[a:bin_name] : ""
endif
call extend(cmd, split(opts, " "))
if a:bin_name is# 'goimports'
call extend(cmd, ["-srcdir", a:target])
endif
call add(cmd, a:source)
return cmd
endfunction
" parse_errors parses the given errors and returns a list of parsed errors
1 0.000002 function! s:parse_errors(filename, content) abort
let splitted = split(a:content, '\n')
" list of errors to be put into location list
let errors = []
for line in splitted
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)')
if !empty(tokens)
call add(errors,{
\"filename": a:filename,
\"lnum": tokens[2],
\"col": tokens[3],
\"text": tokens[4],
\ })
endif
endfor
return errors
endfunction
" show_errors opens a location list and shows the given errors. If the given
" errors is empty, it closes the the location list
1 0.000001 function! s:show_errors(errors) abort
let l:listtype = go#list#Type("GoFmt")
if !empty(a:errors)
call go#list#Populate(l:listtype, a:errors, 'Format')
echohl Error | echomsg "Gofmt returned error" | echohl None
endif
" this closes the window if there are no errors or it opens
" it if there is any
call go#list#Window(l:listtype, len(a:errors))
endfunction
1 0.000001 function! go#fmt#ToggleFmtAutoSave() abort
if go#config#FmtAutosave()
call go#config#SetFmtAutosave(0)
call go#util#EchoProgress("auto fmt disabled")
return
end
call go#config#SetFmtAutosave(1)
call go#util#EchoProgress("auto fmt enabled")
endfunction
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/autoload/go/path.vim
Sourced 1 time
Total time: 0.000109
Self time: 0.000109
count total (s) self (s)
" initial_go_path is used to store the initial GOPATH that was set when Vim
" was started. It's used with :GoPathClear to restore the GOPATH when the user
" changed it explicitly via :GoPath. Initially it's empty. It's being set when
" :GoPath is used
1 0.000003 let s:initial_go_path = ""
" GoPath sets or echos the current GOPATH. If no arguments are passed it
" echoes the current GOPATH, if an argument is passed it replaces the current
" GOPATH with it. If two double quotes are passed (the empty string in go),
" it'll clear the GOPATH and will restore to the initial GOPATH.
1 0.000002 function! go#path#GoPath(...) abort
" no argument, show GOPATH
if len(a:000) == 0
echo go#path#Default()
return
endif
" we have an argument, replace GOPATH
" clears the current manually set GOPATH and restores it to the
" initial GOPATH, which was set when Vim was started.
if len(a:000) == 1 && a:1 == '""'
if !empty(s:initial_go_path)
let $GOPATH = s:initial_go_path
let s:initial_go_path = ""
endif
echon "vim-go: " | echohl Function | echon "GOPATH restored to ". $GOPATH | echohl None
return
endif
echon "vim-go: " | echohl Function | echon "GOPATH changed to ". a:1 | echohl None
let s:initial_go_path = $GOPATH
let $GOPATH = a:1
endfunction
" Default returns the default GOPATH. If GOPATH is not set, it uses the
" default GOPATH set starting with Go 1.8. This GOPATH can be retrieved via
" 'go env GOPATH'
1 0.000002 function! go#path#Default() abort
if $GOPATH == ""
" use default GOPATH via go env
return go#util#env("gopath")
endif
return $GOPATH
endfunction
" s:HasPath checks whether the given path exists in GOPATH environment variable
" or not
1 0.000002 function! s:HasPath(path) abort
let go_paths = split(go#path#Default(), go#util#PathListSep())
let last_char = strlen(a:path) - 1
" check cases of '/foo/bar/' and '/foo/bar'
if a:path[last_char] == go#util#PathSep()
let withSep = a:path
let noSep = strpart(a:path, 0, last_char)
else
let withSep = a:path . go#util#PathSep()
let noSep = a:path
endif
let hasA = index(go_paths, withSep) != -1
let hasB = index(go_paths, noSep) != -1
return hasA || hasB
endfunction
" Detect returns the current GOPATH. If a package manager is used, such as
" Godeps, GB, it will modify the GOPATH so those directories take precedence
" over the current GOPATH. It also detects diretories whose are outside
" GOPATH.
1 0.000001 function! go#path#Detect() abort
let gopath = go#path#Default()
let current_dir = fnameescape(expand('%:p:h'))
" TODO(arslan): this should be changed so folders or files should be
" fetched from a customizable list. The user should define any new package
" management tool by it's own.
" src folders outside $GOPATH
let src_roots = finddir("src", current_dir .";", -1)
" for cases like GOPATH/src/foo/src/bar, pick up GOPATH/src instead of
" GOPATH/src/foo/src
let src_root = ""
if len(src_roots) > 0
let src_root = src_roots[-1]
endif
if !empty(src_root)
let src_path = fnamemodify(src_root, ':p:h:h') . go#util#PathSep()
" gb vendor plugin
" (https://github.com/constabulary/gb/tree/master/cmd/gb-vendor)
let gb_vendor_root = src_path . "vendor" . go#util#PathSep()
if isdirectory(gb_vendor_root) && !s:HasPath(gb_vendor_root)
let gopath = gb_vendor_root . go#util#PathListSep() . gopath
endif
if !s:HasPath(src_path)
let gopath = src_path . go#util#PathListSep() . gopath
endif
endif
" Godeps
let godeps_root = finddir("Godeps", current_dir .";")
if !empty(godeps_root)
let godeps_path = join([fnamemodify(godeps_root, ':p:h:h'), "Godeps", "_workspace" ], go#util#PathSep())
if !s:HasPath(godeps_path)
let gopath = godeps_path . go#util#PathListSep() . gopath
endif
endif
" Fix up the case where initial $GOPATH is empty,
" and we end up with a trailing :
let gopath = substitute(gopath, ":$", "", "")
return gopath
endfunction
" BinPath returns the binary path of installed go tools.
1 0.000003 function! go#path#BinPath() abort
let bin_path = go#config#BinPath()
if bin_path != ""
return bin_path
endif
" check if our global custom path is set, if not check if $GOBIN is set so
" we can use it, otherwise use default GOPATH
if $GOBIN != ""
let bin_path = $GOBIN
else
let go_paths = split(go#path#Default(), go#util#PathListSep())
if len(go_paths) == 0
return "" "nothing found
endif
let bin_path = expand(go_paths[0] . "/bin/")
endif
return bin_path
endfunction
" CheckBinPath checks whether the given binary exists or not and returns the
" path of the binary, respecting the go_bin_path and go_search_bin_path_first
" settings. It returns an empty string if the binary doesn't exist.
1 0.000001 function! go#path#CheckBinPath(binpath) abort
" remove whitespaces if user applied something like 'goimports '
let binpath = substitute(a:binpath, '^\s*\(.\{-}\)\s*$', '\1', '')
" save original path
let old_path = $PATH
" check if we have an appropriate bin_path
let go_bin_path = go#path#BinPath()
if !empty(go_bin_path)
" append our GOBIN and GOPATH paths and be sure they can be found there...
" let us search in our GOBIN and GOPATH paths
" respect the ordering specified by go_search_bin_path_first
if go#config#SearchBinPathFirst()
let $PATH = go_bin_path . go#util#PathListSep() . $PATH
else
let $PATH = $PATH . go#util#PathListSep() . go_bin_path
endif
endif
" if it's in PATH just return it
if executable(binpath)
if exists('*exepath')
let binpath = exepath(binpath)
endif
let $PATH = old_path
if go#util#IsUsingCygwinShell() == 1
return s:CygwinPath(binpath)
endif
return binpath
endif
" just get the basename
let basename = fnamemodify(binpath, ":t")
if !executable(basename)
call go#util#EchoError(printf("could not find '%s'. Run :GoInstallBinaries to fix it", basename))
" restore back!
let $PATH = old_path
return ""
endif
let $PATH = old_path
if go#util#IsUsingCygwinShell() == 1
return s:CygwinPath(a:binpath)
endif
return go_bin_path . go#util#PathSep() . basename
endfunction
1 0.000001 function! s:CygwinPath(path)
return substitute(a:path, '\\', '/', "g")
endfunction
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/autoload/go/list.vim
Sourced 1 time
Total time: 0.000110
Self time: 0.000110
count total (s) self (s)
" Window opens the list with the given height up to 10 lines maximum.
" Otherwise g:go_loclist_height is used.
"
" If no or zero height is given it closes the window by default.
" To prevent this, set g:go_list_autoclose = 0
1 0.000003 function! go#list#Window(listtype, ...) abort
" we don't use lwindow to close the location list as we need also the
" ability to resize the window. So, we are going to use lopen and lclose
" for a better user experience. If the number of errors in a current
" location list increases/decreases, cwindow will not resize when a new
" updated height is passed. lopen in the other hand resizes the screen.
if !a:0 || a:1 == 0
call go#list#Close(a:listtype)
return
endif
let height = go#config#ListHeight()
if height == 0
" prevent creating a large location height for a large set of numbers
if a:1 > 10
let height = 10
else
let height = a:1
endif
endif
if a:listtype == "locationlist"
exe 'lopen ' . height
else
exe 'copen ' . height
endif
endfunction
" Get returns the current items from the list
1 0.000001 function! go#list#Get(listtype) abort
if a:listtype == "locationlist"
return getloclist(0)
else
return getqflist()
endif
endfunction
" Populate populate the list with the given items
1 0.000002 function! go#list#Populate(listtype, items, title) abort
if a:listtype == "locationlist"
call setloclist(0, a:items, 'r')
" The last argument ({what}) is introduced with 7.4.2200:
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
if has("patch-7.4.2200") | call setloclist(0, [], 'a', {'title': a:title}) | endif
else
call setqflist(a:items, 'r')
if has("patch-7.4.2200") | call setqflist([], 'a', {'title': a:title}) | endif
endif
endfunction
" Parse parses the given items based on the specified errorformat and
" populates the list.
1 0.000002 function! go#list#ParseFormat(listtype, errformat, items, title) abort
" backup users errorformat, will be restored once we are finished
let old_errorformat = &errorformat
" parse and populate the location list
let &errorformat = a:errformat
try
call go#list#Parse(a:listtype, a:items, a:title)
finally
"restore back
let &errorformat = old_errorformat
endtry
endfunction
" Parse parses the given items based on the global errorformat and
" populates the list.
1 0.000002 function! go#list#Parse(listtype, items, title) abort
if a:listtype == "locationlist"
lgetexpr a:items
if has("patch-7.4.2200") | call setloclist(0, [], 'a', {'title': a:title}) | endif
else
cgetexpr a:items
if has("patch-7.4.2200") | call setqflist([], 'a', {'title': a:title}) | endif
endif
endfunction
" JumpToFirst jumps to the first item in the location list
1 0.000001 function! go#list#JumpToFirst(listtype) abort
if a:listtype == "locationlist"
ll 1
else
cc 1
endif
endfunction
" Clean cleans and closes the location list
1 0.000001 function! go#list#Clean(listtype) abort
if a:listtype == "locationlist"
lex []
else
cex []
endif
call go#list#Close(a:listtype)
endfunction
" Close closes the location list
1 0.000001 function! go#list#Close(listtype) abort
let autoclose_window = go#config#ListAutoclose()
if !autoclose_window
return
endif
if a:listtype == "locationlist"
lclose
else
cclose
endif
endfunction
1 0.000002 function! s:listtype(listtype) abort
let listtype = go#config#ListType()
if empty(listtype)
return a:listtype
endif
return listtype
endfunction
" s:default_list_type_commands is the defaults that will be used for each of
" the supported commands (see documentation for g:go_list_type_commands). When
" defining a default, quickfix should be used if the command operates on
" multiple files, while locationlist should be used if the command operates on a
" single file or buffer. Keys that begin with an underscore are not supported
" in g:go_list_type_commands.
1 0.000017 let s:default_list_type_commands = {
\ "GoBuild": "quickfix",
\ "GoErrCheck": "quickfix",
\ "GoFmt": "locationlist",
\ "GoGenerate": "quickfix",
\ "GoInstall": "quickfix",
\ "GoLint": "quickfix",
\ "GoMetaLinter": "quickfix",
\ "GoMetaLinterAutoSave": "locationlist",
\ "GoModFmt": "locationlist",
\ "GoModifyTags": "locationlist",
\ "GoRename": "quickfix",
\ "GoRun": "quickfix",
\ "GoTest": "quickfix",
\ "GoVet": "quickfix",
\ "_guru": "locationlist",
\ "_term": "locationlist",
\ "_job": "locationlist",
\ }
1 0.000002 function! go#list#Type(for) abort
let l:listtype = s:listtype(get(s:default_list_type_commands, a:for))
if l:listtype == "0"
call go#util#EchoError(printf(
\ "unknown list type command value found ('%s'). Please open a bug report in the vim-go repo.",
\ a:for))
let l:listtype = "quickfix"
endif
return get(go#config#ListTypeCommands(), a:for, l:listtype)
endfunction
" vim: sw=2 ts=2 et
FUNCTION go#config#HighlightExtraTypes()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 371
Called 2 times
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
2 0.000004 return get(g:, 'go_highlight_extra_types', 0)
FUNCTION <SNR>12_SynSet()
Defined: ~/usr/vim/share/vim/vim81/syntax/synload.vim line 33
Called 2 times
Total time: 0.004084
Self time: 0.000927
count total (s) self (s)
" clear syntax for :set syntax=OFF and any syntax name that doesn't exist
2 0.000017 syn clear
2 0.000006 if exists("b:current_syntax")
unlet b:current_syntax
2 0.000002 endif
2 0.000006 let s = expand("<amatch>")
2 0.000004 if s == "ON"
" :set syntax=ON
if &filetype == ""
echohl ErrorMsg
echo "filetype unknown"
echohl None
endif
let s = &filetype
2 0.000002 elseif s == "OFF"
let s = ""
2 0.000001 endif
2 0.000002 if s != ""
" Load the syntax file(s). When there are several, separated by dots,
" load each in sequence.
4 0.000019 for name in split(s, '\.')
2 0.003996 0.000839 exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim"
4 0.000003 endfor
2 0.000001 endif
FUNCTION go#config#AutoSameids()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 213
Called 1 time
Total time: 0.000003
Self time: 0.000003
count total (s) self (s)
1 0.000002 return get(g:, 'go_auto_sameids', 0)
FUNCTION go#config#ListTypeCommands()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 5
Called 1 time
Total time: 0.000002
Self time: 0.000002
count total (s) self (s)
1 0.000002 return get(g:, 'go_list_type_commands', {})
FUNCTION go#config#HighlightVariableAssignments()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 423
Called 2 times
Total time: 0.000006
Self time: 0.000006
count total (s) self (s)
2 0.000006 return get(g:, 'go_highlight_variable_assignments', 0)
FUNCTION go#config#HighlightBuildConstraints()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 407
Called 4 times
Total time: 0.000010
Self time: 0.000010
count total (s) self (s)
4 0.000009 return get(g:, 'go_highlight_build_constraints', 0)
FUNCTION airline#check_mode()
Defined: ~/.vim/plugged/vim-airline/autoload/airline.vim line 163
Called 23 times
Total time: 0.065521
Self time: 0.003149
count total (s) self (s)
23 0.000085 if !has_key(s:contexts, a:winnr)
return ''
23 0.000020 endif
23 0.000076 let context = s:contexts[a:winnr]
23 0.000092 if get(w:, 'airline_active', 1)
23 0.000081 let l:m = mode(1)
23 0.000046 if l:m ==# "i"
8 0.000015 let l:mode = ['insert']
15 0.000048 elseif l:m[0] ==# "i"
2 0.000006 let l:mode = ['insert']
13 0.000021 elseif l:m ==# "Rv"
let l:mode =['replace']
13 0.000023 elseif l:m[0] ==# "R"
let l:mode = ['replace']
13 0.000144 elseif l:m[0] =~# '\v(v|V||s|S|)'
let l:mode = ['visual']
13 0.000019 elseif l:m ==# "t"
let l:mode = ['terminal']
13 0.000024 elseif l:m[0] ==# "c"
let l:mode = ['commandline']
13 0.000019 elseif l:m ==# "no" " does not work, most likely, Vim does not refresh the statusline in OP mode
let l:mode = ['normal']
13 0.000035 elseif l:m[0:1] ==# 'ni'
let l:mode = ['normal']
let l:m = 'ni'
13 0.000011 else
13 0.000034 let l:mode = ['normal']
23 0.000021 endif
23 0.000111 if index(['Rv', 'no', 'ni', 'ix', 'ic'], l:m) == -1
21 0.000053 let l:m = l:m[0]
23 0.000018 endif
23 0.000134 let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m)
else
let l:mode = ['inactive']
let w:airline_current_mode = get(g:airline_mode_map, '__')
23 0.000017 endif
23 0.000089 if g:airline_detect_modified && &modified
13 0.000049 call add(l:mode, 'modified')
23 0.000033 endif
23 0.000043 if g:airline_detect_paste && &paste
call add(l:mode, 'paste')
23 0.000016 endif
23 0.000108 if g:airline_detect_crypt && exists("+key") && !empty(&key)
call add(l:mode, 'crypt')
23 0.000012 endif
23 0.000054 if g:airline_detect_spell && &spell
call add(l:mode, 'spell')
23 0.000013 endif
23 0.000047 if &readonly || ! &modifiable
call add(l:mode, 'readonly')
23 0.000014 endif
23 0.000122 let mode_string = join(l:mode)
23 0.000095 if get(w:, 'airline_lastmode', '') != mode_string
4 0.001282 0.000058 call airline#highlighter#highlight_modified_inactive(context.bufnr)
4 0.061000 0.000055 call airline#highlighter#highlight(l:mode, context.bufnr)
4 0.000250 0.000047 call airline#util#doautocmd('AirlineModeChanged')
4 0.000011 let w:airline_lastmode = mode_string
23 0.000010 endif
23 0.000030 return ''
FUNCTION <SNR>88_CheckDefined()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 124
Called 262 times
Total time: 0.004643
Self time: 0.004643
count total (s) self (s)
" Checks, whether the definition of the colors is valid and is not empty or NONE
" e.g. if the colors would expand to this:
" hi airline_c ctermfg=NONE ctermbg=NONE
" that means to clear that highlighting group, therefore, fallback to Normal
" highlighting group for the cterm values
" This only works, if the Normal highlighting group is actually defined, so
" return early, if it has been cleared
262 0.000609 if !exists("g:airline#highlighter#normal_fg_hi")
let g:airline#highlighter#normal_fg_hi = synIDattr(synIDtrans(hlID('Normal')), 'fg', 'cterm')
262 0.000118 endif
262 0.000590 if empty(g:airline#highlighter#normal_fg_hi) || g:airline#highlighter#normal_fg_hi < 0
return a:colors
262 0.000077 endif
442 0.000581 for val in a:colors
442 0.000677 if !empty(val) && val !=# 'NONE'
262 0.000231 return a:colors
180 0.000077 endif
180 0.000080 endfor
" this adds the bold attribute to the term argument of the :hi command,
" but at least this makes sure, the group will be defined
let fg = g:airline#highlighter#normal_fg_hi
let bg = synIDattr(synIDtrans(hlID('Normal')), 'bg', 'cterm')
if bg < 0
" in case there is no background color defined for Normal
let bg = a:colors[3]
endif
return a:colors[0:1] + [fg, bg] + [a:colors[4]]
FUNCTION airline#util#append()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 34
Called 161 times
Total time: 0.001689
Self time: 0.001689
count total (s) self (s)
161 0.000367 if a:minwidth > 0 && winwidth(0) < a:minwidth
return ''
161 0.000104 endif
161 0.000509 let prefix = s:spc == "\ua0" ? s:spc : s:spc.s:spc
161 0.000472 return empty(a:text) ? '' : prefix.g:airline_left_alt_sep.s:spc.a:text
FUNCTION <SNR>100_fmt_cmd()
Defined: ~/.vim/plugged/vim-go/autoload/go/fmt.vim line 149
Called 1 time
Total time: 0.000043
Self time: 0.000039
count total (s) self (s)
1 0.000004 let l:cmd = [a:bin_name, '-w']
" add the options for binary (if any). go_fmt_options was by default of type
" string, however to allow customization it's now a dictionary of binary
" name mapping to options.
1 0.000017 0.000013 let opts = go#config#FmtOptions()
1 0.000003 if type(opts) == type({})
1 0.000003 let opts = has_key(opts, a:bin_name) ? opts[a:bin_name] : ""
1 0.000000 endif
1 0.000006 call extend(cmd, split(opts, " "))
1 0.000001 if a:bin_name is# 'goimports'
1 0.000003 call extend(cmd, ["-srcdir", a:target])
1 0.000000 endif
1 0.000002 call add(cmd, a:source)
1 0.000001 return cmd
FUNCTION airline#extensions#branch#update_untracked_config()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 163
Called 22 times
Total time: 0.000333
Self time: 0.000333
count total (s) self (s)
22 0.000117 if !has_key(s:vcs_config[a:vcs].untracked, a:file)
1 0.000001 return
21 0.000092 elseif s:vcs_config[a:vcs].untracked[a:file] != b:buffer_vcs_config[a:vcs].untracked
let b:buffer_vcs_config[a:vcs].untracked = s:vcs_config[a:vcs].untracked[a:file]
unlet! b:airline_head
21 0.000011 endif
FUNCTION airline#themes#get_highlight()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/themes.vim line 31
Called 84 times
Total time: 0.007423
Self time: 0.000700
count total (s) self (s)
84 0.007402 0.000679 return call('airline#highlighter#get_highlight', [a:group] + a:000)
FUNCTION go#cmd#autowrite()
Defined: ~/.vim/plugged/vim-go/autoload/go/cmd.vim line 1
Called 1 time
Total time: 0.229293
Self time: 0.001518
count total (s) self (s)
1 0.000003 if &autowrite == 1 || &autowriteall == 1
1 0.229274 0.001499 silent! wall
else
for l:nr in range(0, bufnr('$'))
if buflisted(l:nr) && getbufvar(l:nr, '&modified')
" Sleep one second to make sure people see the message. Otherwise it is
" often immediacy overwritten by the async messages (which also don't
" invoke the "hit ENTER" prompt).
call go#util#EchoWarning('[No write since last change]')
sleep 1
return
endif
endfor
1 0.000000 endif
FUNCTION <SNR>42_echo_go_info()
Defined: ~/.vim/plugged/vim-go/plugin/go.vim line 211
Called 1 time
Total time: 0.000019
Self time: 0.000019
count total (s) self (s)
1 0.000005 if !get(g:, "go_echo_go_info", 1)
return
1 0.000002 endif
1 0.000009 if !exists('v:completed_item') || empty(v:completed_item)
1 0.000001 return
endif
let item = v:completed_item
if !has_key(item, "info")
return
endif
if empty(item.info)
return
endif
redraws! | echo "vim-go: " | echohl Function | echon item.info | echohl None
FUNCTION go#config#HighlightTypes()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 403
Called 2 times
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
2 0.000003 return get(g:, 'go_highlight_types', 0)
FUNCTION go#util#goroot()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 120
Called 1 time
Total time: 0.024050
Self time: 0.000030
count total (s) self (s)
1 0.024050 0.000030 return substitute(s:exec(['go', 'env', 'GOROOT'])[0], '\n', '', 'g')
FUNCTION <SNR>81_update_hg_branch()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 118
Called 23 times
Total time: 0.001797
Self time: 0.001699
count total (s) self (s)
23 0.000362 0.000264 if airline#util#has_lawrencium()
let cmd='LC_ALL=C hg qtop'
let stl=lawrencium#statusline()
let file=expand('%:p')
if !empty(stl) && get(b:, 'airline_do_mq_check', 1)
if g:airline#init#vim_async
noa call airline#async#get_mq_async(cmd, file)
elseif has("nvim")
noa call airline#async#nvim_get_mq_async(cmd, file)
else
" remove \n at the end of the command
let output=system(cmd)[0:-2]
noa call airline#async#mq_output(output, file)
endif
endif
" do not do mq check anymore
let b:airline_do_mq_check = 0
if exists("b:mq") && !empty(b:mq)
if stl is# 'default'
" Shorten default a bit
let stl='def'
endif
let stl.=' ['.b:mq.']'
endif
let s:vcs_config['mercurial'].branch = stl
23 0.000016 else
23 0.000062 let s:vcs_config['mercurial'].branch = ''
23 0.000016 endif
FUNCTION go#config#Debug()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 185
Called 4 times
Total time: 0.000016
Self time: 0.000016
count total (s) self (s)
4 0.000014 return get(g:, 'go_debug', [])
FUNCTION go#config#SearchBinPathFirst()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 359
Called 3 times
Total time: 0.000007
Self time: 0.000007
count total (s) self (s)
3 0.000007 return get(g:, 'go_search_bin_path_first', 1)
FUNCTION airline#parts#filetype()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 101
Called 23 times
Total time: 0.000134
Self time: 0.000134
count total (s) self (s)
23 0.000122 return winwidth(0) < 90 && strlen(&filetype) > 3 ? matchstr(&filetype, '...'). (&encoding is? 'utf-8' ? '…' : '>') : &filetype
FUNCTION go#config#HighlightFormatStrings()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 415
Called 2 times
Total time: 0.000007
Self time: 0.000007
count total (s) self (s)
2 0.000005 return get(g:, 'go_highlight_format_strings', 1)
FUNCTION airline#parts#iminsert()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 81
Called 23 times
Total time: 0.000169
Self time: 0.000169
count total (s) self (s)
23 0.000069 if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name')
return toupper(b:keymap_name)
23 0.000018 endif
23 0.000022 return ''
FUNCTION go#util#IsUsingCygwinShell()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 58
Called 3 times
Total time: 0.000084
Self time: 0.000019
count total (s) self (s)
3 0.000083 0.000018 return go#util#IsWin() && executable('cygpath') && &shell =~ '.*sh.*'
FUNCTION <SNR>83_ws_refresh()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/whitespace.vim line 162
Called 2 times
Total time: 0.000043
Self time: 0.000043
count total (s) self (s)
2 0.000010 if get(b:, 'airline_ws_changedtick', 0) == b:changedtick
return
2 0.000001 endif
2 0.000006 unlet! b:airline_whitespace_check
2 0.000006 if get(g:, 'airline_skip_empty_sections', 0)
exe ':AirlineRefresh'
2 0.000002 endif
2 0.000006 let b:airline_ws_changedtick = b:changedtick
FUNCTION go#util#HasDebug()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 436
Called 4 times
Total time: 0.000054
Self time: 0.000038
count total (s) self (s)
4 0.000054 0.000038 return index(go#config#Debug(), a:flag) >= 0
FUNCTION go#config#FoldEnable()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 435
Called 28 times
Total time: 0.000301
Self time: 0.000194
count total (s) self (s)
28 0.000030 if a:0 > 0
14 0.000037 return index(go#config#FoldEnable(), a:1) > -1
14 0.000007 endif
14 0.000045 return get(g:, 'go_fold_enable', ['block', 'import', 'varconst', 'package_comment'])
FUNCTION go#util#Shelljoin()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 229
Called 4 times
Total time: 0.000140
Self time: 0.000140
count total (s) self (s)
4 0.000004 try
4 0.000011 let ssl_save = &shellslash
4 0.000011 set noshellslash
4 0.000004 if a:0
return join(map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')'), ' ')
4 0.000002 endif
4 0.000068 return join(map(copy(a:arglist), 'shellescape(v:val)'), ' ')
4 0.000004 finally
4 0.000010 let &shellslash = ssl_save
4 0.000003 endtry
FUNCTION go#config#HighlightSpaceTabError()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 375
Called 2 times
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
2 0.000005 return get(g:, 'go_highlight_space_tab_error', 0)
FUNCTION go#fmt#Format()
Defined: ~/.vim/plugged/vim-go/autoload/go/fmt.vim line 16
Called 1 time
Total time: 0.227028
Self time: 0.001207
count total (s) self (s)
1 0.000013 0.000008 if go#config#FmtExperimental()
" Using winsaveview to save/restore cursor state has the problem of
" closing folds on save:
" https://github.com/fatih/vim-go/issues/502
" One fix is to use mkview instead. Unfortunately, this sometimes causes
" other bad side effects:
" https://github.com/fatih/vim-go/issues/728
" and still closes all folds if foldlevel>0:
" https://github.com/fatih/vim-go/issues/732
let l:curw = {}
try
mkview!
catch
let l:curw = winsaveview()
endtry
" save our undo file to be restored after we are done. This is needed to
" prevent an additional undo jump due to BufWritePre auto command and also
" restore 'redo' history because it's getting being destroyed every
" BufWritePre
let tmpundofile = tempname()
exe 'wundo! ' . tmpundofile
1 0.000001 else
" Save cursor position and many other things.
1 0.000003 let l:curw = winsaveview()
1 0.000001 endif
" Write current unsaved buffer to a temp file
1 0.000003 let l:tmpname = tempname() . '.go'
1 0.000971 0.000950 call writefile(go#util#GetLines(), l:tmpname)
1 0.000067 0.000030 if go#util#IsWin()
let l:tmpname = tr(l:tmpname, '\', '/')
1 0.000000 endif
1 0.000010 0.000006 let bin_name = go#config#FmtCommand()
1 0.000002 if a:withGoimport == 1
let bin_name = "goimports"
1 0.000000 endif
1 0.000003 let current_col = col('.')
1 0.215891 0.000015 let [l:out, l:err] = go#fmt#run(bin_name, l:tmpname, expand('%'))
1 0.000069 let diff_offset = len(readfile(l:tmpname)) - line('$')
1 0.000004 if l:err == 0
1 0.009919 0.000044 call go#fmt#update_file(l:tmpname, expand('%'))
elseif !go#config#FmtFailSilently()
let errors = s:parse_errors(expand('%'), out)
call s:show_errors(errors)
1 0.000001 endif
" We didn't use the temp file, so clean up
1 0.000010 call delete(l:tmpname)
1 0.000008 0.000005 if go#config#FmtExperimental()
" restore our undo history
silent! exe 'rundo ' . tmpundofile
call delete(tmpundofile)
" Restore our cursor/windows positions, folds, etc.
if empty(l:curw)
silent! loadview
else
call winrestview(l:curw)
endif
1 0.000000 else
" Restore our cursor/windows positions.
1 0.000006 call winrestview(l:curw)
1 0.000000 endif
" be smart and jump to the line the new statement was added/removed
1 0.000004 call cursor(line('.') + diff_offset, current_col)
" Syntax highlighting breaks less often.
1 0.000002 syntax sync fromstart
FUNCTION <SNR>97_gocodeAutocomplete()
Defined: ~/.vim/plugged/vim-go/autoload/go/complete.vim line 76
Called 1 time
Total time: 0.489186
Self time: 0.000271
count total (s) self (s)
" use the offset as is, because the cursor position is the position for
" which autocomplete candidates are needed.
1 0.489185 0.000270 return s:sync_gocode('autocomplete', [expand('%:p'), go#util#OffsetCursor()], go#util#GetLines())
FUNCTION go#fmt#update_file()
Defined: ~/.vim/plugged/vim-go/autoload/go/fmt.vim line 94
Called 1 time
Total time: 0.009875
Self time: 0.000746
count total (s) self (s)
" remove undo point caused via BufWritePre
1 0.000011 try | silent undojoin | catch | endtry
1 0.000005 let old_fileformat = &fileformat
1 0.000006 if exists("*getfperm")
" save file permissions
1 0.000010 let original_fperm = getfperm(a:target)
1 0.000001 endif
1 0.000090 call rename(a:source, a:target)
" restore file permissions
1 0.000009 if exists("*setfperm") && original_fperm != ''
1 0.000013 call setfperm(a:target , original_fperm)
1 0.000001 endif
" reload buffer to reflect latest changes
1 0.007397 0.000432 silent edit!
1 0.000008 let &fileformat = old_fileformat
1 0.001957 0.000005 let &syntax = &syntax
1 0.000332 0.000120 let l:listtype = go#list#Type("GoFmt")
" the title information was introduced with 7.4-2200
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
1 0.000004 if has('patch-7.4.2200')
" clean up previous list
1 0.000002 if l:listtype == "quickfix"
let l:list_title = getqflist({'title': 1})
1 0.000000 else
1 0.000004 let l:list_title = getloclist(0, {'title': 1})
1 0.000001 endif
else
" can't check the title, so assume that the list was for go fmt.
let l:list_title = {'title': 'Format'}
1 0.000001 endif
1 0.000004 if has_key(l:list_title, "title") && l:list_title['title'] == "Format"
call go#list#Clean(l:listtype)
1 0.000001 endif
FUNCTION <SNR>95_on_exit_untracked()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/async.vim line 69
Called 2 times
Total time: 0.000072
Self time: 0.000032
count total (s) self (s)
2 0.000060 0.000020 call s:untracked_output(self, self.buf)
2 0.000005 if has_key(s:untracked_jobs, self.file)
1 0.000003 call remove(s:untracked_jobs, self.file)
2 0.000001 endif
FUNCTION go#config#FmtCommand()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 317
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000003 return get(g:, "go_fmt_command", "gofmt")
FUNCTION airline#util#doautocmd()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 124
Called 4 times
Total time: 0.000203
Self time: 0.000065
count total (s) self (s)
4 0.000201 0.000063 exe printf("silent doautocmd %s User %s", s:nomodeline, a:event)
FUNCTION go#util#env()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 86
Called 1 time
Total time: 0.024177
Self time: 0.000125
count total (s) self (s)
1 0.000003 let l:key = tolower(a:key)
1 0.000003 if has_key(s:env_cache, l:key)
return s:env_cache[l:key]
1 0.000000 endif
1 0.000070 if executable('go')
1 0.024067 0.000017 let l:var = call('go#util#'.l:key, [])
1 0.000010 0.000008 if go#util#ShellError() != 0
call go#util#EchoError(printf("'go env %s' failed", toupper(l:key)))
return ''
1 0.000001 endif
else
let l:var = eval("$".toupper(a:key))
1 0.000001 endif
1 0.000005 let s:env_cache[l:key] = l:var
1 0.000002 return l:var
FUNCTION go#config#HighlightFunctions()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 387
Called 2 times
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
2 0.000004 return get(g:, 'go_highlight_functions', 0)
FUNCTION go#config#FmtOptions()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 321
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000004 return get(g:, "go_fmt_options", {})
FUNCTION <SNR>42_fmt_autosave()
Defined: ~/.vim/plugged/vim-go/plugin/go.vim line 246
Called 1 time
Total time: 0.227289
Self time: 0.000134
count total (s) self (s)
" Go code formatting on save
1 0.000003 if get(g:, "go_fmt_autosave", 1)
1 0.227283 0.000128 call go#fmt#Format(-1)
1 0.000002 endif
FUNCTION <SNR>98_system()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 146
Called 4 times
Total time: 0.456795
Self time: 0.000822
count total (s) self (s)
" Preserve original shell, shellredir and shellcmdflag values
4 0.000006 let l:shell = &shell
4 0.000007 let l:shellredir = &shellredir
4 0.000007 let l:shellcmdflag = &shellcmdflag
4 0.000176 0.000050 if !go#util#IsWin() && executable('/bin/sh')
4 0.000042 0.000036 set shell=/bin/sh shellredir=>%s\ 2>&1 shellcmdflag=-c
4 0.000003 endif
4 0.000003 try
4 0.456375 0.000550 return call('system', [a:cmd] + a:000)
4 0.000030 finally
" Restore original values
4 0.000085 0.000069 let &shell = l:shell
4 0.000016 let &shellredir = l:shellredir
4 0.000010 let &shellcmdflag = l:shellcmdflag
4 0.000013 endtry
FUNCTION go#util#gomod()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 132
Called 1 time
Total time: 0.023191
Self time: 0.000029
count total (s) self (s)
1 0.023190 0.000028 return substitute(s:exec(['go', 'env', 'GOMOD'])[0], '\n', '', 'g')
FUNCTION airline#extensions#keymap#status()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/keymap.vim line 10
Called 23 times
Total time: 0.000344
Self time: 0.000344
count total (s) self (s)
23 0.000177 if (get(g:, 'airline#extensions#keymap#enabled', 1) && has('keymap'))
23 0.000143 return printf('%s', (!empty(&keymap) ? (g:airline_symbols.keymap . ' '. &keymap) : ''))
else
return ''
endif
FUNCTION <SNR>95_on_stdout()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/async.vim line 61
Called 2 times
Total time: 0.000014
Self time: 0.000014
count total (s) self (s)
2 0.000012 let self.buf .= a:msg
FUNCTION go#path#CheckBinPath()
Defined: ~/.vim/plugged/vim-go/autoload/go/path.vim line 147
Called 3 times
Total time: 0.000819
Self time: 0.000291
count total (s) self (s)
" remove whitespaces if user applied something like 'goimports '
3 0.000053 let binpath = substitute(a:binpath, '^\s*\(.\{-}\)\s*$', '\1', '')
" save original path
3 0.000007 let old_path = $PATH
" check if we have an appropriate bin_path
3 0.000372 0.000024 let go_bin_path = go#path#BinPath()
3 0.000006 if !empty(go_bin_path)
" append our GOBIN and GOPATH paths and be sure they can be found there...
" let us search in our GOBIN and GOPATH paths
" respect the ordering specified by go_search_bin_path_first
3 0.000023 0.000016 if go#config#SearchBinPathFirst()
3 0.000129 0.000040 let $PATH = go_bin_path . go#util#PathListSep() . $PATH
else
let $PATH = $PATH . go#util#PathListSep() . go_bin_path
3 0.000000 endif
3 0.000002 endif
" if it's in PATH just return it
3 0.000053 if executable(binpath)
3 0.000007 if exists('*exepath')
3 0.000023 let binpath = exepath(binpath)
3 0.000002 endif
3 0.000009 let $PATH = old_path
3 0.000100 0.000016 if go#util#IsUsingCygwinShell() == 1
return s:CygwinPath(binpath)
3 0.000001 endif
3 0.000003 return binpath
endif
" just get the basename
let basename = fnamemodify(binpath, ":t")
if !executable(basename)
call go#util#EchoError(printf("could not find '%s'. Run :GoInstallBinaries to fix it", basename))
" restore back!
let $PATH = old_path
return ""
endif
let $PATH = old_path
if go#util#IsUsingCygwinShell() == 1
return s:CygwinPath(a:binpath)
endif
return go_bin_path . go#util#PathSep() . basename
FUNCTION go#config#HighlightFunctionCalls()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 395
Called 2 times
Total time: 0.000007
Self time: 0.000007
count total (s) self (s)
2 0.000005 return get(g:, 'go_highlight_function_calls', 0)
FUNCTION go#complete#Complete()
Defined: ~/.vim/plugged/vim-go/autoload/go/complete.vim line 226
Called 2 times
Total time: 0.489283
Self time: 0.000097
count total (s) self (s)
"findstart = 1 when we need to get the text length
2 0.000009 if a:findstart == 1
1 0.489230 0.000044 execute "silent let s:completions = " . s:gocodeAutocomplete()
1 0.000009 return col('.') - s:completions[0] - 1
"findstart = 0 when we need to return the list of completions
1 0.000001 else
1 0.000006 let s = getline(".")[col('.') - 1]
1 0.000009 if s =~ '[(){}\{\}]'
return map(copy(s:completions[1]), 's:trim_bracket(v:val)')
1 0.000001 endif
1 0.000002 return s:completions[1]
endif
FUNCTION go#util#Exec()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 175
Called 2 times
Total time: 0.411006
Self time: 0.000238
count total (s) self (s)
2 0.000004 if len(a:cmd) == 0
call go#util#EchoError("go#util#Exec() called with empty a:cmd")
return ['', 1]
2 0.000002 endif
2 0.000006 let l:bin = a:cmd[0]
" Lookup the full path, respecting settings such as 'go_bin_path'. On errors,
" CheckBinPath will show a warning for us.
2 0.000832 0.000159 let l:bin = go#path#CheckBinPath(l:bin)
2 0.000004 if empty(l:bin)
return ['', 1]
2 0.000000 endif
" Finally execute the command using the full, resolved path. Do not pass the
" unmodified command as the correct program might not exist in $PATH.
2 0.410144 0.000049 return call('s:exec', [[l:bin] + a:cmd[1:]] + a:000)
FUNCTION go#list#Type()
Defined: ~/.vim/plugged/vim-go/autoload/go/list.vim line 155
Called 1 time
Total time: 0.000044
Self time: 0.000024
count total (s) self (s)
1 0.000028 0.000010 let l:listtype = s:listtype(get(s:default_list_type_commands, a:for))
1 0.000001 if l:listtype == "0"
call go#util#EchoError(printf( "unknown list type command value found ('%s'). Please open a bug report in the vim-go repo.", a:for))
let l:listtype = "quickfix"
1 0.000000 endif
1 0.000010 0.000008 return get(go#config#ListTypeCommands(), a:for, l:listtype)
FUNCTION go#config#ListType()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 104
Called 1 time
Total time: 0.000003
Self time: 0.000003
count total (s) self (s)
1 0.000003 return get(g:, 'go_list_type', '')
FUNCTION airline#extensions#fugitiveline#bufname()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/fugitiveline.vim line 17
Called 23 times
Total time: 0.000782
Self time: 0.000782
count total (s) self (s)
23 0.000083 if !exists('b:fugitive_name')
let b:fugitive_name = ''
try
if bufname('%') =~? '^fugitive:' && exists('*FugitiveReal')
let b:fugitive_name = FugitiveReal(bufname('%'))
elseif exists('b:git_dir')
let buffer = fugitive#buffer()
if buffer.type('blob')
let b:fugitive_name = buffer.repo().translate(buffer.path('/'))
endif
endif
catch
endtry
23 0.000017 endif
23 0.000046 if empty(b:fugitive_name)
23 0.000200 return fnamemodify(bufname('%'), s:fmod)
else
return fnamemodify(b:fugitive_name, s:fmod)
endif
FUNCTION airline#util#wrap()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 27
Called 138 times
Total time: 0.000739
Self time: 0.000739
count total (s) self (s)
138 0.000315 if a:minwidth > 0 && winwidth(0) < a:minwidth
return ''
138 0.000075 endif
138 0.000152 return a:text
FUNCTION FugitiveGitDir()
Defined: ~/.vim/plugged/vim-fugitive/plugin/fugitive.vim line 11
Called 23 times
Total time: 0.000156
Self time: 0.000156
count total (s) self (s)
23 0.000048 if !a:0 || a:1 ==# -1
23 0.000087 return get(b:, 'git_dir', '')
elseif type(a:1) == type(0)
return getbufvar(a:1, 'git_dir')
elseif type(a:1) == type('')
return substitute(s:Slash(a:1), '/$', '', '')
else
return ''
endif
FUNCTION <SNR>42_auto_type_info()
Defined: ~/.vim/plugged/vim-go/plugin/go.vim line 232
Called 1 time
Total time: 0.000024
Self time: 0.000024
count total (s) self (s)
" GoInfo automatic update
1 0.000015 if get(g:, "go_auto_type_info", 0)
call go#tool#Info(0)
1 0.000002 endif
FUNCTION <SNR>73_hi()
Defined: ~/.vim/plugged/vim-go/syntax/go.vim line 369
Called 1 time
Total time: 0.000028
Self time: 0.000025
count total (s) self (s)
1 0.000004 hi def link goSameId Search
" :GoCoverage commands
1 0.000002 hi def goCoverageCovered ctermfg=green guifg=#A6E22E
1 0.000001 hi def goCoverageUncover ctermfg=red guifg=#F92672
" :GoDebug commands
1 0.000008 0.000005 if go#config#HighlightDebug()
1 0.000007 hi GoDebugBreakpoint term=standout ctermbg=117 ctermfg=0 guibg=#BAD4F5 guifg=Black
1 0.000004 hi GoDebugCurrent term=reverse ctermbg=12 ctermfg=7 guibg=DarkBlue guifg=White
1 0.000001 endif
FUNCTION <SNR>9_LoadFTPlugin()
Defined: ~/usr/vim/share/vim/vim81/ftplugin.vim line 14
Called 1 time
Total time: 0.004265
Self time: 0.001554
count total (s) self (s)
1 0.000008 if exists("b:undo_ftplugin")
1 0.000046 exe b:undo_ftplugin
1 0.000007 unlet! b:undo_ftplugin b:did_ftplugin
1 0.000001 endif
1 0.000006 let s = expand("<amatch>")
1 0.000003 if s != ""
1 0.000018 if &cpo =~# "S" && exists("b:did_ftplugin")
" In compatible mode options are reset to the global values, need to
" set the local values also when a plugin was already used.
unlet b:did_ftplugin
1 0.000001 endif
" When there is a dot it is used to separate filetype names. Thus for
" "aaa.bbb" load "aaa" and then "bbb".
2 0.000014 for name in split(s, '\.')
1 0.004147 0.001436 exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim'
2 0.000003 endfor
1 0.000001 endif
FUNCTION airline#extensions#whitespace#check()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/whitespace.vim line 50
Called 23 times
Total time: 0.002855
Self time: 0.002521
count total (s) self (s)
23 0.000096 let max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000)
23 0.000136 if &readonly || !&modifiable || !s:enabled || line('$') > max_lines || get(b:, 'airline_whitespace_disabled', 0)
return ''
23 0.000011 endif
23 0.000136 let skip_check_ft = extend(s:skip_check_ft, get(g:, 'airline#extensions#whitespace#skip_indent_check_ft', {}), 'force')
23 0.000069 if !exists('b:airline_whitespace_check')
2 0.000006 let b:airline_whitespace_check = ''
2 0.000012 let checks = get(b:, 'airline_whitespace_checks', get(g:, 'airline#extensions#whitespace#checks', s:default_checks))
2 0.000003 let trailing = 0
2 0.000003 let check = 'trailing'
2 0.000010 if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0
try
let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$')
let trailing = search(regexp, 'nw')
catch
echomsg 'airline#whitespace: error occurred evaluating '. regexp
echomsg v:exception
return ''
endtry
2 0.000002 endif
2 0.000003 let mixed = 0
2 0.000003 let check = 'indent'
2 0.000008 if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0
let mixed = s:check_mixed_indent()
2 0.000002 endif
2 0.000003 let mixed_file = ''
2 0.000003 let check = 'mixed-indent-file'
2 0.000007 if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0
let mixed_file = s:check_mixed_indent_file()
2 0.000001 endif
2 0.000003 let long = 0
2 0.000005 if index(checks, 'long') > -1 && &tw > 0
let long = search('\%>'.&tw.'v.\+', 'nw')
2 0.000001 endif
2 0.000008 if trailing != 0 || mixed != 0 || long != 0 || !empty(mixed_file)
let b:airline_whitespace_check = s:symbol
if strlen(s:symbol) > 0
let space = (g:airline_symbols.space)
else
let space = ''
endif
if s:show_message
if trailing != 0
let trailing_fmt = get(g:, 'airline#extensions#whitespace#trailing_format', '[%s]trailing')
let b:airline_whitespace_check .= space.printf(trailing_fmt, trailing)
endif
if mixed != 0
let mixed_indent_fmt = get(g:, 'airline#extensions#whitespace#mixed_indent_format', '[%s]mixed-indent')
let b:airline_whitespace_check .= space.printf(mixed_indent_fmt, mixed)
endif
if long != 0
let long_fmt = get(g:, 'airline#extensions#whitespace#long_format', '[%s]long')
let b:airline_whitespace_check .= space.printf(long_fmt, long)
endif
if !empty(mixed_file)
let mixed_indent_file_fmt = get(g:, 'airline#extensions#whitespace#mixed_indent_file_format', '[%s]mix-indent-file')
let b:airline_whitespace_check .= space.printf(mixed_indent_file_fmt, mixed_file)
endif
endif
2 0.000001 endif
23 0.000017 endif
23 0.000579 0.000245 return airline#util#shorten(b:airline_whitespace_check, 120, 9)
FUNCTION <SNR>97_gocodeCommand()
Defined: ~/.vim/plugged/vim-go/autoload/go/complete.vim line 1
Called 1 time
Total time: 0.253298
Self time: 0.000270
count total (s) self (s)
1 0.000002 let l:gocode_bin = "gocode"
1 0.023212 0.000021 let l:gomod = go#util#gomod()
1 0.000015 if filereadable(l:gomod)
" Save the file when in module mode so that go list can read the
" imports. If the user doesn't have autowrite or autorwriteall enabled,
" they'll need to write the file manually to get reliable results.
" See https://github.com/fatih/vim-go/pull/1988#issuecomment-428576989.
"
" TODO(bc): don't save the file when in module mode once
" golang.org/x/tools/go/packages has support for an overlay and it's used
" by gocode.
1 0.229712 0.000163 call go#cmd#autowrite()
1 0.000003 let l:gocode_bin = "gocode-gomod"
1 0.000001 endif
1 0.000285 0.000006 let bin_path = go#path#CheckBinPath(l:gocode_bin)
1 0.000002 if empty(bin_path)
return []
1 0.000000 endif
1 0.000008 0.000005 let socket_type = go#config#GocodeSocketType()
1 0.000002 let cmd = [bin_path]
1 0.000002 let cmd = extend(cmd, ['-sock', socket_type])
1 0.000001 let cmd = extend(cmd, ['-f', 'vim'])
1 0.000007 0.000005 if go#config#GocodeProposeBuiltins()
1 0.000001 let cmd = extend(cmd, ['-builtin'])
1 0.000000 endif
1 0.000011 0.000009 if go#config#GocodeProposeSource()
1 0.000001 let cmd = extend(cmd, ['-source'])
else
let cmd = extend(cmd, ['-fallback-to-source'])
1 0.000000 endif
1 0.000006 0.000004 if go#config#GocodeUnimportedPackages()
let cmd = extend(cmd, ['-unimported-packages'])
1 0.000000 endif
1 0.000003 let cmd = extend(cmd, [a:cmd])
1 0.000003 let cmd = extend(cmd, a:args)
1 0.000002 return cmd
FUNCTION go#util#PathListSep()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 10
Called 6 times
Total time: 0.000193
Self time: 0.000042
count total (s) self (s)
6 0.000176 0.000025 if go#util#IsWin()
return ";"
6 0.000002 endif
6 0.000002 return ":"
FUNCTION <SNR>102_listtype()
Defined: ~/.vim/plugged/vim-go/autoload/go/list.vim line 120
Called 1 time
Total time: 0.000018
Self time: 0.000015
count total (s) self (s)
1 0.000015 0.000012 let listtype = go#config#ListType()
1 0.000002 if empty(listtype)
1 0.000001 return a:listtype
endif
return listtype
FUNCTION <SNR>88_Get()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 156
Called 378 times
Total time: 0.001679
Self time: 0.001679
count total (s) self (s)
378 0.000665 let res=get(a:dict, a:key, '')
378 0.000281 if res is ''
142 0.000096 return ''
236 0.000102 else
236 0.000272 return a:prefix. res
endif
FUNCTION <SNR>81_update_branch()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 153
Called 23 times
Total time: 0.007169
Self time: 0.001556
count total (s) self (s)
69 0.000220 for vcs in keys(s:vcs_config)
46 0.006276 0.000663 call {s:vcs_config[vcs].update_branch}()
46 0.000184 if b:buffer_vcs_config[vcs].branch != s:vcs_config[vcs].branch
let b:buffer_vcs_config[vcs].branch = s:vcs_config[vcs].branch
unlet! b:airline_head
46 0.000030 endif
69 0.000067 endfor
FUNCTION go#config#GocodeProposeBuiltins()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 147
Called 1 time
Total time: 0.000002
Self time: 0.000002
count total (s) self (s)
1 0.000002 return get(g:, 'go_gocode_propose_builtins', 1)
FUNCTION go#config#HighlightGenerateTags()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 419
Called 2 times
Total time: 0.000008
Self time: 0.000008
count total (s) self (s)
2 0.000006 return get(g:, 'go_highlight_generate_tags', 0)
FUNCTION go#util#Offset()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 269
Called 1 time
Total time: 0.000025
Self time: 0.000025
count total (s) self (s)
1 0.000004 if &encoding != 'utf-8'
let sep = go#util#LineEnding()
let buf = a:line == 1 ? '' : (join(getline(1, a:line-1), sep) . sep)
let buf .= a:col == 1 ? '' : getline('.')[:a:col-2]
return len(iconv(buf, &encoding, 'utf-8'))
1 0.000002 endif
1 0.000008 return line2byte(a:line) + (a:col-2)
FUNCTION go#config#HighlightVariableDeclarations()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 427
Called 2 times
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
2 0.000004 return get(g:, 'go_highlight_variable_declarations', 0)
FUNCTION FugitiveHead()
Defined: ~/.vim/plugged/vim-fugitive/plugin/fugitive.vim line 79
Called 23 times
Total time: 0.002839
Self time: 0.000565
count total (s) self (s)
23 0.000381 0.000225 let dir = FugitiveGitDir(a:0 > 1 ? a:2 : -1)
23 0.000043 if empty(dir)
return ''
23 0.000013 endif
23 0.002340 0.000222 return fugitive#Head(a:0 ? a:1 : 0, dir)
FUNCTION airline#highlighter#highlight()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 219
Called 4 times
Total time: 0.060945
Self time: 0.007763
count total (s) self (s)
4 0.000009 let bufnr = a:0 ? a:1 : ''
4 0.000010 let p = g:airline#themes#{g:airline_theme}#palette
" draw the base mode, followed by any overrides
4 0.000039 let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val')
4 0.000010 let suffix = a:modes[0] == 'inactive' ? '_inactive' : ''
11 0.000013 for mode in mapped
7 0.000035 if exists('g:airline#themes#{g:airline_theme}#palette[mode]')
7 0.000018 let dict = g:airline#themes#{g:airline_theme}#palette[mode]
79 0.000164 for kvp in items(dict)
72 0.000130 let mode_colors = kvp[1]
72 0.000095 let name = kvp[0]
72 0.000144 if name is# 'airline_c' && !empty(bufnr) && suffix is# '_inactive'
let name = 'airline_c'.bufnr
72 0.000037 endif
72 0.013108 0.000545 call airline#highlighter#exec(name.suffix, mode_colors)
216 0.000289 for accent in keys(s:accents)
144 0.000269 if !has_key(p.accents, accent)
continue
144 0.000053 endif
144 0.000315 let colors = copy(mode_colors)
144 0.000294 if p.accents[accent][0] != ''
72 0.000136 let colors[0] = p.accents[accent][0]
144 0.000065 endif
144 0.000178 if p.accents[accent][2] != ''
72 0.000122 let colors[2] = p.accents[accent][2]
144 0.000056 endif
144 0.000188 if len(colors) >= 5
144 0.000342 let colors[4] = get(p.accents[accent], 4, '')
else
call add(colors, get(p.accents[accent], 4, ''))
144 0.000060 endif
144 0.026037 0.001207 call airline#highlighter#exec(name.suffix.'_'.accent, colors)
216 0.000138 endfor
79 0.000038 endfor
" TODO: optimize this
49 0.000090 for sep in items(s:separators)
42 0.016231 0.000442 call <sid>exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix)
49 0.000023 endfor
7 0.000004 endif
11 0.000007 endfor
FUNCTION airline#parts#ffenc()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 105
Called 23 times
Total time: 0.000959
Self time: 0.000959
count total (s) self (s)
23 0.000081 let expected = get(g:, 'airline#parts#ffenc#skip_expected_string', '')
23 0.000049 let bomb = &l:bomb ? '[BOM]' : ''
23 0.000336 let ff = strlen(&ff) ? '['.&ff.']' : ''
23 0.000180 if expected is# &fenc.bomb.ff
return ''
23 0.000018 else
23 0.000232 return &fenc.bomb.ff
endif
FUNCTION <SNR>81_update_git_branch()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 83
Called 23 times
Total time: 0.003816
Self time: 0.000804
count total (s) self (s)
23 0.000407 0.000234 if !airline#util#has_fugitive()
let s:vcs_config['git'].branch = ''
return
23 0.000011 endif
23 0.003130 0.000291 let s:vcs_config['git'].branch = exists("*FugitiveHead") ? FugitiveHead(s:sha1size) : fugitive#head(s:sha1size)
23 0.000094 if s:vcs_config['git'].branch is# 'master' && winwidth(0) < 81
" Shorten default a bit
let s:vcs_config['git'].branch='mas'
23 0.000016 endif
FUNCTION airline#util#ignore_buf()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 101
Called 23 times
Total time: 0.000589
Self time: 0.000589
count total (s) self (s)
23 0.000147 let pat = '\c\v'. get(g:, 'airline#ignore_bufadd_pat', ''). get(g:, 'airline#extensions#tabline#ignore_bufadd_pat', 'gundo|undotree|vimfiler|tagbar|nerd_tree|startify|!')
23 0.000414 return match(a:name, pat) > -1
FUNCTION <SNR>42_auto_sameids()
Defined: ~/.vim/plugged/vim-go/plugin/go.vim line 239
Called 1 time
Total time: 0.000009
Self time: 0.000009
count total (s) self (s)
" GoSameId automatic update
1 0.000005 if get(g:, "go_auto_sameids", 0)
call go#guru#SameIds(0)
1 0.000001 endif
FUNCTION <SNR>81_reset_untracked_cache()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 282
Called 1 time
Total time: 0.000144
Self time: 0.000098
count total (s) self (s)
" shellcmdpost - whether function was called as a result of ShellCmdPost hook
1 0.000002 if !g:airline#init#vim_async && !has('nvim')
if a:shellcmdpost
" Clear cache only if there was no error or the script uses an
" asynchronous interface. Otherwise, cache clearing would overwrite
" v:shell_error with a system() call inside get_*_untracked.
if v:shell_error
return
endif
endif
1 0.000001 endif
1 0.000021 let file = expand("%:p")
3 0.000006 for vcs in keys(s:vcs_config)
" Dump the value of the cache for the current file. Partially mitigates the
" issue of cache invalidation happening before a call to
" s:update_untracked()
2 0.000096 0.000050 call airline#extensions#branch#update_untracked_config(file, vcs)
2 0.000004 let s:vcs_config[vcs].untracked = {}
3 0.000002 endfor
FUNCTION airline#parts#paste()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 63
Called 23 times
Total time: 0.000077
Self time: 0.000077
count total (s) self (s)
23 0.000069 return g:airline_detect_paste && &paste ? g:airline_symbols.paste : ''
FUNCTION go#config#HighlightTrailingWhitespaceError()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 379
Called 2 times
Total time: 0.000006
Self time: 0.000006
count total (s) self (s)
2 0.000006 return get(g:, 'go_highlight_trailing_whitespace_error', 0)
FUNCTION go#util#GetLines()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 378
Called 2 times
Total time: 0.000044
Self time: 0.000044
count total (s) self (s)
2 0.000022 let buf = getline(1, '$')
2 0.000005 if &encoding != 'utf-8'
let buf = map(buf, 'iconv(v:val, &encoding, "utf-8")')
2 0.000001 endif
2 0.000003 if &l:fileformat == 'dos'
" XXX: line2byte() depend on 'fileformat' option.
" so if fileformat is 'dos', 'buf' must include '\r'.
let buf = map(buf, 'v:val."\r"')
2 0.000002 endif
2 0.000002 return buf
FUNCTION airline#parts#readonly()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 88
Called 23 times
Total time: 0.001085
Self time: 0.000496
count total (s) self (s)
" only consider regular buffers (e.g. ones that represent actual files,
" but not special ones like e.g. NERDTree)
23 0.000871 0.000282 if !empty(&buftype) || airline#util#ignore_buf(bufname('%'))
return ''
23 0.000012 endif
23 0.000054 if &readonly && !filereadable(bufname('%'))
return '[noperm]'
23 0.000017 else
23 0.000038 return &readonly ? g:airline_symbols.readonly : ''
endif
FUNCTION fugitive#Head()
Defined: ~/.vim/plugged/vim-fugitive/autoload/fugitive.vim line 293
Called 23 times
Total time: 0.002118
Self time: 0.002118
count total (s) self (s)
23 0.000155 let dir = a:0 > 1 ? a:2 : get(b:, 'git_dir', '')
23 0.000703 if empty(dir) || !filereadable(dir . '/HEAD')
return ''
23 0.000017 endif
23 0.000595 let head = readfile(dir . '/HEAD')[0]
23 0.000179 if head =~# '^ref: '
23 0.000393 return substitute(head, '\C^ref: \%(refs/\%(heads/\|remotes/\|tags/\)\=\)\=', '', '')
elseif head =~# '^\x\{40\}$'
let len = a:0 ? a:1 : 0
return len < 0 ? head : len ? head[0:len-1] : ''
else
return ''
endif
FUNCTION UltiSnips#TrackChange()
Defined: ~/.vim/plugged/ultisnips/autoload/UltiSnips.vim line 146
Called 7 times
Total time: 0.018340
Self time: 0.018340
count total (s) self (s)
7 0.018328 exec g:_uspy "UltiSnips_Manager._track_change()"
FUNCTION <SNR>33_on_window_changed()
Defined: ~/.vim/plugged/vim-airline/plugin/airline.vim line 39
Called 2 times
Total time: 0.000153
Self time: 0.000153
count total (s) self (s)
2 0.000021 let s:active_winnr = winnr()
2 0.000010 if pumvisible() && (!&previewwindow || g:airline_exclude_preview)
return
2 0.000002 endif
" Handle each window only once, since we might come here several times for
" different autocommands.
2 0.000039 let l:key = [bufnr('%'), s:active_winnr, winnr('$'), tabpagenr(), &ft]
2 0.000057 if get(g:, 'airline_last_window_changed', []) == l:key && &stl is# '%!airline#statusline('.s:active_winnr.')' && &ft !~? 'gitcommit'
" fugitive is special, it changes names and filetypes several times,
" make sure the caching does not get into its way
2 0.000002 return
endif
let g:airline_last_window_changed = l:key
call s:init()
call airline#update_statusline()
FUNCTION <SNR>88_exec_separator()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 165
Called 42 times
Total time: 0.015789
Self time: 0.001563
count total (s) self (s)
42 0.000083 if pumvisible()
return
42 0.000012 endif
42 0.000096 let group = a:from.'_to_'.a:to.a:suffix
42 0.004122 0.000330 let l:from = airline#themes#get_highlight(a:from.a:suffix)
42 0.003900 0.000269 let l:to = airline#themes#get_highlight(a:to.a:suffix)
42 0.000038 if a:inverse
14 0.000047 let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ]
28 0.000007 else
28 0.000105 let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ]
42 0.000018 endif
42 0.000104 let a:dict[group] = colors
42 0.007108 0.000305 call airline#highlighter#exec(group, colors)
FUNCTION airline#highlighter#exec()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 92
Called 262 times
Total time: 0.045279
Self time: 0.015354
count total (s) self (s)
262 0.000341 if pumvisible()
return
262 0.000113 endif
262 0.000299 let colors = a:colors
262 0.000240 if s:is_win32term
let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, ''))
let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, ''))
262 0.000133 endif
262 0.024152 0.002026 let old_hi = airline#highlighter#get_highlight(a:group)
262 0.000363 if len(colors) == 4
51 0.000097 call add(colors, '')
262 0.000095 endif
262 0.000268 if g:airline_gui_mode ==# 'gui'
let new_hi = [colors[0], colors[1], '', '', colors[4]]
262 0.000118 else
262 0.001384 let new_hi = ['', '', printf("%s", colors[2]), printf("%s", colors[3]), colors[4]]
262 0.000110 endif
262 0.006231 0.001588 let colors = s:CheckDefined(colors)
262 0.002934 0.001457 if old_hi != new_hi || !s:hl_group_exists(a:group)
54 0.003176 0.001497 let cmd = printf('hi %s %s %s %s %s %s %s %s', a:group, s:Get(colors, 0, 'guifg='), s:Get(colors, 1, 'guibg='), s:Get(colors, 2, 'ctermfg='), s:Get(colors, 3, 'ctermbg='), s:Get(colors, 4, 'gui='), s:Get(colors, 4, 'cterm='), s:Get(colors, 4, 'term='))
54 0.000460 exe cmd
54 0.000116 if has_key(s:hl_groups, a:group)
54 0.000104 let s:hl_groups[a:group] = colors
54 0.000027 endif
262 0.000103 endif
FUNCTION GoIndent()
Defined: ~/.vim/plugged/vim-go/indent/go.vim line 27
Called 1 time
Total time: 0.000321
Self time: 0.000321
count total (s) self (s)
1 0.000058 let prevlnum = prevnonblank(a:lnum-1)
1 0.000003 if prevlnum == 0
" top of file
return 0
1 0.000001 endif
" grab the previous and current line, stripping comments.
1 0.000018 let prevl = substitute(getline(prevlnum), '//.*$', '', '')
1 0.000005 let thisl = substitute(getline(a:lnum), '//.*$', '', '')
1 0.000002 let previ = indent(prevlnum)
1 0.000002 let ind = previ
3 0.000159 for synid in synstack(a:lnum, 1)
2 0.000007 if synIDattr(synid, 'name') == 'goRawString'
if prevl =~ '\%(\%(:\?=\)\|(\|,\)\s*`[^`]*$'
" previous line started a multi-line raw string
return 0
endif
" return -1 to keep the current indent.
return -1
2 0.000001 endif
3 0.000003 endfor
1 0.000007 if prevl =~ '[({]\s*$'
" previous line opened a block
let ind += shiftwidth()
1 0.000001 endif
1 0.000006 if prevl =~# '^\s*\(case .*\|default\):$'
" previous line is part of a switch statement
let ind += shiftwidth()
1 0.000000 endif
" TODO: handle if the previous line is a label.
1 0.000004 if thisl =~ '^\s*[)}]'
" this line closed a block
let ind -= shiftwidth()
1 0.000001 endif
" Colons are tricky.
" We want to outdent if it's part of a switch ("case foo:" or "default:").
" We ignore trying to deal with jump labels because (a) they're rare, and
" (b) they're hard to disambiguate from a composite literal key.
1 0.000005 if thisl =~# '^\s*\(case .*\|default\):$'
let ind -= shiftwidth()
1 0.000000 endif
1 0.000001 return ind
FUNCTION go#config#HighlightArrayWhitespaceError()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 363
Called 2 times
Total time: 0.000008
Self time: 0.000008
count total (s) self (s)
2 0.000007 return get(g:, 'go_highlight_array_whitespace_error', 0)
FUNCTION go#util#ShellError()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 206
Called 5 times
Total time: 0.000017
Self time: 0.000017
count total (s) self (s)
5 0.000012 return v:shell_error
FUNCTION go#path#Default()
Defined: ~/.vim/plugged/vim-go/autoload/go/path.vim line 39
Called 3 times
Total time: 0.000015
Self time: 0.000015
count total (s) self (s)
3 0.000003 if $GOPATH == ""
" use default GOPATH via go env
return go#util#env("gopath")
3 0.000003 endif
3 0.000003 return $GOPATH
FUNCTION go#fmt#run()
Defined: ~/.vim/plugged/vim-go/autoload/go/fmt.vim line 140
Called 1 time
Total time: 0.215876
Self time: 0.000021
count total (s) self (s)
1 0.000050 0.000007 let l:cmd = s:fmt_cmd(a:bin_name, a:source, a:target)
1 0.000002 if empty(l:cmd)
return
1 0.000000 endif
1 0.215823 0.000011 return go#util#Exec(l:cmd)
FUNCTION airline#async#vim_vcs_untracked()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/async.vim line 126
Called 6 times
Total time: 0.001042
Self time: 0.001042
count total (s) self (s)
6 0.000011 if g:airline#init#is_windows && &shell =~ 'cmd'
let cmd = a:config['cmd'] . shellescape(a:file)
6 0.000004 else
6 0.000041 let cmd = ['sh', '-c', a:config['cmd'] . shellescape(a:file)]
6 0.000003 endif
6 0.000031 let options = {'cfg': a:config, 'buf': '', 'file': a:file}
6 0.000013 if has_key(s:untracked_jobs, a:file)
5 0.000048 if job_status(get(s:untracked_jobs, a:file)) == 'run'
4 0.000004 return
1 0.000002 elseif has_key(s:untracked_jobs, a:file)
1 0.000003 call remove(s:untracked_jobs, a:file)
1 0.000000 endif
2 0.000001 endif
2 0.000790 let id = job_start(cmd, { 'err_io': 'out', 'out_cb': function('s:on_stdout', options), 'close_cb': function('s:on_exit_untracked', options)})
2 0.000034 let s:untracked_jobs[a:file] = id
FUNCTION go#config#AutoTypeInfo()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 297
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000004 return get(g:, "go_auto_type_info", 0)
FUNCTION airline#parts#spell()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 67
Called 23 times
Total time: 0.000701
Self time: 0.000701
count total (s) self (s)
23 0.000335 let spelllang = g:airline_detect_spelllang ? printf(" [%s]", toupper(substitute(&spelllang, ',', '/', 'g'))) : ''
23 0.000053 if g:airline_detect_spell && &spell
if winwidth(0) >= 90
return g:airline_symbols.spell . spelllang
elseif winwidth(0) >= 70
return g:airline_symbols.spell
else
return split(g:airline_symbols.spell, '\zs')[0]
endif
23 0.000016 endif
23 0.000025 return ''
FUNCTION <SNR>53_Highlight_Matching_Pair()
Defined: ~/usr/vim/share/vim/vim81/plugin/matchparen.vim line 39
Called 17 times
Total time: 0.002314
Self time: 0.002314
count total (s) self (s)
" Remove any previous match.
17 0.000134 if exists('w:paren_hl_on') && w:paren_hl_on
silent! call matchdelete(3)
let w:paren_hl_on = 0
17 0.000020 endif
" Avoid that we remove the popup menu.
" Return when there are no colors (looks like the cursor jumps).
17 0.000124 if pumvisible() || (&t_Co < 8 && !has("gui_running"))
return
17 0.000012 endif
" Get the character under the cursor and check if it's in 'matchpairs'.
17 0.000070 let c_lnum = line('.')
17 0.000093 let c_col = col('.')
17 0.000025 let before = 0
17 0.000088 let text = getline(c_lnum)
17 0.000394 let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)')
17 0.000087 if empty(matches)
let [c_before, c] = ['', '']
17 0.000019 else
17 0.000104 let [c_before, c] = matches[1:2]
17 0.000015 endif
17 0.000326 let plist = split(&matchpairs, '.\zs[:,]')
17 0.000074 let i = index(plist, c)
17 0.000025 if i < 0
" not found, in Insert mode try character before the cursor
17 0.000088 if c_col > 1 && (mode() == 'i' || mode() == 'R')
8 0.000021 let before = strlen(c_before)
8 0.000014 let c = c_before
8 0.000019 let i = index(plist, c)
17 0.000012 endif
17 0.000021 if i < 0
" not found, nothing to do
17 0.000025 return
endif
endif
" Figure out the arguments for searchpairpos().
if i % 2 == 0
let s_flags = 'nW'
let c2 = plist[i + 1]
else
let s_flags = 'nbW'
let c2 = c
let c = plist[i - 1]
endif
if c == '['
let c = '\['
let c2 = '\]'
endif
" Find the match. When it was just before the cursor move it there for a
" moment.
if before > 0
let has_getcurpos = exists("*getcurpos")
if has_getcurpos
" getcurpos() is more efficient but doesn't exist before 7.4.313.
let save_cursor = getcurpos()
else
let save_cursor = winsaveview()
endif
call cursor(c_lnum, c_col - before)
endif
if !has("syntax") || !exists("g:syntax_on")
let s_skip = "0"
else
" Build an expression that detects whether the current cursor position is
" in certain syntax types (string, comment, etc.), for use as
" searchpairpos()'s skip argument.
" We match "escape" for special items, such as lispEscapeSpecial.
let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))'
" If executing the expression determines that the cursor is currently in
" one of the syntax types, then we want searchpairpos() to find the pair
" within those syntax types (i.e., not skip). Otherwise, the cursor is
" outside of the syntax types and s_skip should keep its value so we skip
" any matching pair inside the syntax types.
" Catch if this throws E363: pattern uses more memory than 'maxmempattern'.
try
execute 'if ' . s_skip . ' | let s_skip = "0" | endif'
catch /^Vim\%((\a\+)\)\=:E363/
" We won't find anything, so skip searching, should keep Vim responsive.
return
endtry
endif
" Limit the search to lines visible in the window.
let stoplinebottom = line('w$')
let stoplinetop = line('w0')
if i % 2 == 0
let stopline = stoplinebottom
else
let stopline = stoplinetop
endif
" Limit the search time to 300 msec to avoid a hang on very long lines.
" This fails when a timeout is not supported.
if mode() == 'i' || mode() == 'R'
let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout
else
let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout
endif
try
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout)
catch /E118/
" Can't use the timeout, restrict the stopline a bit more to avoid taking
" a long time on closed folds and long lines.
" The "viewable" variables give a range in which we can scroll while
" keeping the cursor at the same position.
" adjustedScrolloff accounts for very large numbers of scrolloff.
let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2])
let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2])
let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2])
" one of these stoplines will be adjusted below, but the current values are
" minimal boundaries within the current window
if i % 2 == 0
if has("byte_offset") && has("syntax_items") && &smc > 0
let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
let stopline = min([bottom_viewable, byte2line(stopbyte)])
else
let stopline = min([bottom_viewable, c_lnum + 100])
endif
let stoplinebottom = stopline
else
if has("byte_offset") && has("syntax_items") && &smc > 0
let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
let stopline = max([top_viewable, byte2line(stopbyte)])
else
let stopline = max([top_viewable, c_lnum - 100])
endif
let stoplinetop = stopline
endif
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
endtry
if before > 0
if has_getcurpos
call setpos('.', save_cursor)
else
call winrestview(save_cursor)
endif
endif
" If a match is found setup match highlighting.
if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom
if exists('*matchaddpos')
call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3)
else
exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
endif
let w:paren_hl_on = 1
endif
FUNCTION go#config#GocodeProposeSource()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 151
Called 1 time
Total time: 0.000002
Self time: 0.000002
count total (s) self (s)
1 0.000002 return get(g:, 'go_gocode_propose_source', 1)
FUNCTION <SNR>95_untracked_output()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/async.vim line 11
Called 2 times
Total time: 0.000040
Self time: 0.000040
count total (s) self (s)
2 0.000012 if a:buf =~? ('^'. a:dict.cfg['untracked_mark'])
let a:dict.cfg.untracked[a:dict.file] = get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists)
2 0.000004 else
2 0.000016 let a:dict.cfg.untracked[a:dict.file] = ''
2 0.000002 endif
FUNCTION <SNR>98_exec()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 195
Called 4 times
Total time: 0.457277
Self time: 0.000273
count total (s) self (s)
4 0.000013 let l:bin = a:cmd[0]
4 0.000174 0.000034 let l:cmd = go#util#Shelljoin([l:bin] + a:cmd[1:])
4 0.000082 0.000028 if go#util#HasDebug('shell-commands')
call go#util#EchoInfo('shell command: ' . l:cmd)
4 0.000003 endif
4 0.456871 0.000076 let l:out = call('s:system', [l:cmd] + a:000)
4 0.000112 0.000097 return [l:out, go#util#ShellError()]
FUNCTION airline#parts#crypt()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 59
Called 23 times
Total time: 0.000154
Self time: 0.000154
count total (s) self (s)
23 0.000141 return g:airline_detect_crypt && exists("+key") && !empty(&key) ? g:airline_symbols.crypt : ''
FUNCTION airline#extensions#branch#head()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 210
Called 23 times
Total time: 0.011909
Self time: 0.000832
count total (s) self (s)
23 0.000095 if !exists('b:buffer_vcs_config')
call s:init_buffer()
23 0.000016 endif
23 0.007362 0.000193 call s:update_branch()
23 0.004153 0.000245 call s:update_untracked()
23 0.000097 if exists('b:airline_head') && !empty(b:airline_head)
23 0.000038 return b:airline_head
endif
let b:airline_head = ''
let vcs_priority = get(g:, "airline#extensions#branch#vcs_priority", ["git", "mercurial"])
let heads = []
for vcs in vcs_priority
if !empty(b:buffer_vcs_config[vcs].branch)
let heads += [vcs]
endif
endfor
for vcs in heads
if !empty(b:airline_head)
let b:airline_head .= ' | '
endif
if len(heads) > 1
let b:airline_head .= s:vcs_config[vcs].exe .':'
endif
let b:airline_head .= s:format_name({s:vcs_config[vcs].display_branch}())
let b:airline_head .= b:buffer_vcs_config[vcs].untracked
endfor
if empty(heads)
if airline#util#has_vcscommand()
noa call VCSCommandEnableBufferSetup()
if exists('b:VCSCommandBufferInfo')
let b:airline_head = s:format_name(get(b:VCSCommandBufferInfo, 0, ''))
endif
endif
endif
if empty(heads)
if airline#util#has_custom_scm()
try
let Fn = function(g:airline#extensions#branch#custom_head)
let b:airline_head = Fn()
endtry
endif
endif
if exists("g:airline#extensions#branch#displayed_head_limit")
let w:displayed_head_limit = g:airline#extensions#branch#displayed_head_limit
if len(b:airline_head) > w:displayed_head_limit - 1
let b:airline_head = b:airline_head[0:(w:displayed_head_limit - 1)].(&encoding ==? 'utf-8' ? '…' : '.')
endif
endif
let minwidth = empty(get(b:, 'airline_hunks', '')) ? 14 : 7
let b:airline_head = airline#util#shorten(b:airline_head, 120, minwidth)
return b:airline_head
FUNCTION airline#parts#mode()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 55
Called 23 times
Total time: 0.000795
Self time: 0.000343
count total (s) self (s)
23 0.000787 0.000335 return airline#util#shorten(get(w:, 'airline_current_mode', ''), 79, 1)
FUNCTION <SNR>88_get_syn()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 25
Called 692 times
Total time: 0.012133
Self time: 0.012133
count total (s) self (s)
692 0.001265 if !exists("g:airline_gui_mode")
let g:airline_gui_mode = airline#init#gui_mode()
692 0.000326 endif
692 0.000556 let color = ''
692 0.001013 if hlexists(a:group)
668 0.002164 let color = synIDattr(synIDtrans(hlID(a:group)), a:what, g:airline_gui_mode)
692 0.000316 endif
692 0.001020 if empty(color) || color == -1
" should always exists
24 0.000130 let color = synIDattr(synIDtrans(hlID('Normal')), a:what, g:airline_gui_mode)
" however, just in case
24 0.000028 if empty(color) || color == -1
12 0.000009 let color = 'NONE'
24 0.000009 endif
692 0.000256 endif
692 0.000538 return color
FUNCTION go#config#HighlightFunctionArguments()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 391
Called 2 times
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
2 0.000004 return get(g:, 'go_highlight_function_arguments', 0)
FUNCTION airline#util#has_fugitive()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 108
Called 23 times
Total time: 0.000173
Self time: 0.000173
count total (s) self (s)
23 0.000157 return exists('*fugitive#head') || exists('*FugitiveHead')
FUNCTION <SNR>45_Leave()
Defined: ~/.vim/plugged/vim-ragtag/plugin/ragtag.vim line 242
Called 1 time
Total time: 0.000064
Self time: 0.000016
count total (s) self (s)
1 0.000064 0.000016 call s:disableescape()
FUNCTION airline#statusline()
Defined: ~/.vim/plugged/vim-airline/autoload/airline.vim line 154
Called 23 times
Total time: 0.000446
Self time: 0.000446
count total (s) self (s)
23 0.000202 if has_key(s:contexts, a:winnr)
23 0.000206 return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line
endif
" in rare circumstances this happens...see #276
return ''
FUNCTION go#config#HighlightStringSpellcheck()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 411
Called 2 times
Total time: 0.000007
Self time: 0.000007
count total (s) self (s)
2 0.000007 return get(g:, 'go_highlight_string_spellcheck', 1)
FUNCTION <SNR>88_hl_group_exists()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 83
Called 208 times
Total time: 0.001477
Self time: 0.001477
count total (s) self (s)
208 0.000370 if !hlexists(a:group)
return 0
208 0.000544 elseif empty(synIDattr(hlID(a:group), 'fg'))
return 0
208 0.000075 endif
208 0.000142 return 1
FUNCTION go#path#BinPath()
Defined: ~/.vim/plugged/vim-go/autoload/go/path.vim line 123
Called 3 times
Total time: 0.000348
Self time: 0.000217
count total (s) self (s)
3 0.000029 0.000017 let bin_path = go#config#BinPath()
3 0.000003 if bin_path != ""
return bin_path
3 0.000003 endif
" check if our global custom path is set, if not check if $GOBIN is set so
" we can use it, otherwise use default GOPATH
3 0.000005 if $GOBIN != ""
let bin_path = $GOBIN
3 0.000002 else
3 0.000159 0.000040 let go_paths = split(go#path#Default(), go#util#PathListSep())
3 0.000005 if len(go_paths) == 0
return "" "nothing found
3 0.000003 endif
3 0.000121 let bin_path = expand(go_paths[0] . "/bin/")
3 0.000000 endif
3 0.000003 return bin_path
FUNCTION go#util#OffsetCursor()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 280
Called 1 time
Total time: 0.000036
Self time: 0.000011
count total (s) self (s)
1 0.000036 0.000011 return go#util#Offset(line('.'), col('.'))
FUNCTION <SNR>97_sync_gocode()
Defined: ~/.vim/plugged/vim-go/autoload/go/complete.vim line 48
Called 1 time
Total time: 0.488355
Self time: 0.015686
count total (s) self (s)
" We might hit cache problems, as gocode doesn't handle different GOPATHs
" well. See: https://github.com/nsf/gocode/issues/239
1 0.000004 let old_goroot = $GOROOT
1 0.024198 0.000021 let $GOROOT = go#util#env("goroot")
1 0.000001 try
1 0.253314 0.000016 let cmd = s:gocodeCommand(a:cmd, a:args)
" gocode can sometimes be slow, so redraw now to avoid waiting for gocode
" to return before redrawing automatically.
1 0.015594 redraw
1 0.195211 0.000017 let [l:result, l:err] = go#util#Exec(cmd, a:input)
1 0.000001 finally
1 0.000007 let $GOROOT = old_goroot
1 0.000001 endtry
1 0.000002 if l:err != 0
return "[0, []]"
1 0.000000 endif
1 0.000002 if &encoding != 'utf-8'
let l:result = iconv(l:result, 'utf-8', &encoding)
1 0.000001 endif
1 0.000002 return l:result
FUNCTION go#config#GocodeUnimportedPackages()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 138
Called 1 time
Total time: 0.000002
Self time: 0.000002
count total (s) self (s)
1 0.000002 return get(g:, 'go_gocode_unimported_packages', 0)
FUNCTION <SNR>88_get_array()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 44
Called 346 times
Total time: 0.002065
Self time: 0.002065
count total (s) self (s)
346 0.000832 let opts=empty(a:opts) ? '' : join(a:opts, ',')
346 0.001128 return g:airline_gui_mode ==# 'gui' ? [ a:fg, a:bg, '', '', opts ] : [ '', '', a:fg, a:bg, opts ]
FUNCTION go#config#GocodeSocketType()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 143
Called 1 time
Total time: 0.000003
Self time: 0.000003
count total (s) self (s)
1 0.000002 return get(g:, 'go_gocode_socket_type', s:sock_type)
FUNCTION airline#util#has_lawrencium()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 112
Called 23 times
Total time: 0.000098
Self time: 0.000098
count total (s) self (s)
23 0.000085 return exists('*lawrencium#statusline')
FUNCTION airline#highlighter#get_highlight()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 55
Called 346 times
Total time: 0.028849
Self time: 0.014651
count total (s) self (s)
346 0.003146 let reverse = get(g:, 'airline_gui_mode', '') ==# 'gui' ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui') : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm')|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term')
346 0.000840 if get(g:, 'airline_highlighting_cache', 0) && has_key(s:hl_groups, a:group)
let res = s:hl_groups[a:group]
return reverse ? [ res[1], res[0], res[3], res[2], res[4] ] : res
346 0.000179 else
346 0.008420 0.001984 let fg = s:get_syn(a:group, 'fg')
346 0.007327 0.001630 let bg = s:get_syn(a:group, 'bg')
346 0.000928 let bold = synIDattr(synIDtrans(hlID(a:group)), 'bold')
346 0.000336 let opts = a:000
346 0.000269 if bold
66 0.000070 let opts = ['bold']
346 0.000127 endif
346 0.004299 0.002234 let res = reverse ? s:get_array(bg, fg, opts) : s:get_array(fg, bg, opts)
346 0.000165 endif
346 0.000888 let s:hl_groups[a:group] = res
346 0.000239 return res
FUNCTION airline#util#shorten()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 13
Called 46 times
Total time: 0.000786
Self time: 0.000786
count total (s) self (s)
46 0.000235 if winwidth(0) < a:winwidth && len(split(a:text, '\zs')) > a:minwidth
if get(a:000, 0, 0)
" shorten from tail
return '…'.matchstr(a:text, '.\{'.a:minwidth.'}$')
else
" shorten from beginning of string
return matchstr(a:text, '^.\{'.a:minwidth.'}').'…'
endif
46 0.000033 else
46 0.000064 return a:text
endif
FUNCTION <SNR>42_metalinter_autosave()
Defined: ~/.vim/plugged/vim-go/plugin/go.vim line 267
Called 1 time
Total time: 0.000007
Self time: 0.000007
count total (s) self (s)
" run gometalinter on save
1 0.000003 if get(g:, "go_metalinter_autosave", 0)
call go#lint#Gometa(1)
1 0.000001 endif
FUNCTION airline#highlighter#highlight_modified_inactive()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 205
Called 4 times
Total time: 0.001224
Self time: 0.000141
count total (s) self (s)
4 0.000015 if getbufvar(a:bufnr, '&modified')
3 0.000034 let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c') ? g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c : []
1 0.000000 else
1 0.000007 let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c') ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c : []
4 0.000002 endif
4 0.000007 if !empty(colors)
4 0.001136 0.000053 call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors)
4 0.000002 endif
FUNCTION go#config#HighlightOperators()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 383
Called 2 times
Total time: 0.000006
Self time: 0.000006
count total (s) self (s)
2 0.000005 return get(g:, 'go_highlight_operators', 0)
FUNCTION airline#extensions#branch#get_head()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 273
Called 23 times
Total time: 0.012596
Self time: 0.000687
count total (s) self (s)
23 0.012197 0.000288 let head = airline#extensions#branch#head()
23 0.000088 let empty_message = get(g:, 'airline#extensions#branch#empty_message', '')
23 0.000093 let symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch)
23 0.000172 return empty(head) ? empty_message : printf('%s%s', empty(symbol) ? '' : symbol.(g:airline_symbols.space), head)
FUNCTION go#config#FmtExperimental()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 329
Called 2 times
Total time: 0.000008
Self time: 0.000008
count total (s) self (s)
2 0.000007 return get(g:, "go_fmt_experimental", 0 )
FUNCTION go#config#BinPath()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 355
Called 3 times
Total time: 0.000012
Self time: 0.000012
count total (s) self (s)
3 0.000011 return get(g:, "go_bin_path", "")
FUNCTION go#config#HighlightChanWhitespaceError()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 367
Called 2 times
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
2 0.000005 return get(g:, 'go_highlight_chan_whitespace_error', 0)
FUNCTION go#config#HighlightDebug()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 431
Called 2 times
Total time: 0.000007
Self time: 0.000007
count total (s) self (s)
2 0.000006 return get(g:, 'go_highlight_debug', 1)
FUNCTION <SNR>10_LoadIndent()
Defined: ~/usr/vim/share/vim/vim81/indent.vim line 13
Called 1 time
Total time: 0.000331
Self time: 0.000245
count total (s) self (s)
1 0.000003 if exists("b:undo_indent")
exe b:undo_indent
unlet! b:undo_indent b:did_indent
1 0.000001 endif
1 0.000004 let s = expand("<amatch>")
1 0.000002 if s != ""
1 0.000002 if exists("b:did_indent")
1 0.000002 unlet b:did_indent
1 0.000000 endif
" When there is a dot it is used to separate filetype names. Thus for
" "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim".
2 0.000009 for name in split(s, '\.')
1 0.000298 0.000212 exe 'runtime! indent/' . name . '.vim'
2 0.000002 endfor
1 0.000001 endif
FUNCTION go#config#HighlightFields()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 399
Called 2 times
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
2 0.000004 return get(g:, 'go_highlight_fields', 0)
FUNCTION StripTrailingWhite()
Defined: ~/.vimrc line 198
Called 1 time
Total time: 0.000176
Self time: 0.000176
count total (s) self (s)
1 0.000006 let l:winview = winsaveview()
1 0.000003 let _s=@/
1 0.000151 silent! %s/\s\+$//
1 0.000003 let @/=_s
1 0.000004 call histdel("/", -1)
1 0.000008 call winrestview(l:winview)
FUNCTION airline#util#prepend()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 48
Called 46 times
Total time: 0.000311
Self time: 0.000311
count total (s) self (s)
46 0.000094 if a:minwidth > 0 && winwidth(0) < a:minwidth
return ''
46 0.000022 endif
46 0.000121 return empty(a:text) ? '' : a:text.s:spc.g:airline_right_alt_sep.s:spc
FUNCTION <SNR>45_disableescape()
Defined: ~/.vim/plugged/vim-ragtag/plugin/ragtag.vim line 513
Called 1 time
Total time: 0.000048
Self time: 0.000048
count total (s) self (s)
1 0.000006 if exists("b:ragtag_escape_mode")
if b:ragtag_escape_mode == "xml"
silent! iunmap <buffer> <BS>
silent! iunmap <buffer> <Lt>
silent! iunmap <buffer> >
silent! iunmap <buffer> &
silent! iunmap <buffer> "
elseif b:ragtag_escape_mode == "url"
silent! iunmap <buffer> <BS>
silent! iunmap <buffer> <Tab>
silent! iunmap <buffer> <CR>
silent! iunmap <buffer> <Space>
silent! iunmap <buffer> <Bar>
let i = 33
while i < 127
if nr2char(i) =~# '[|A-Za-z0-9_.~-]'
else
exe "silent! iunmap <buffer> ".nr2char(i)
endif
let i = i + 1
endwhile
endif
unlet b:ragtag_escape_mode
1 0.000001 endif
FUNCTION go#util#IsWin()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 35
Called 14 times
Total time: 0.000379
Self time: 0.000379
count total (s) self (s)
14 0.000029 let win = ['win16', 'win32', 'win64', 'win95']
70 0.000065 for w in win
56 0.000138 if (has(w))
return 1
56 0.000024 endif
70 0.000031 endfor
14 0.000013 return 0
FUNCTION <SNR>81_update_untracked()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 172
Called 23 times
Total time: 0.003908
Self time: 0.002579
count total (s) self (s)
23 0.000281 let file = expand("%:p")
23 0.000112 if empty(file) || isdirectory(file)
return
23 0.000015 endif
23 0.000056 let needs_update = 1
69 0.000129 for vcs in keys(s:vcs_config)
46 0.000252 if file =~ s:vcs_config[vcs].exclude
" Skip check for files that live in the exclude directory
let needs_update = 0
46 0.000027 endif
46 0.000131 if has_key(s:vcs_config[vcs].untracked, file)
20 0.000028 let needs_update = 0
20 0.000682 0.000395 call airline#extensions#branch#update_untracked_config(file, vcs)
46 0.000028 endif
69 0.000058 endfor
23 0.000032 if !needs_update
20 0.000016 return
3 0.000001 endif
9 0.000043 for vcs in keys(s:vcs_config)
6 0.000020 let config = s:vcs_config[vcs]
6 0.000008 if g:airline#init#vim_async
" Note that asynchronous update updates s:vcs_config only, and only
" s:update_untracked updates b:buffer_vcs_config. If s:vcs_config is
" invalidated again before s:update_untracked is called, then we lose the
" result of the previous call, i.e. the head string is not updated. It
" doesn't happen often in practice, so we let it be.
6 0.001350 0.000308 noa call airline#async#vim_vcs_untracked(config, file)
else
" nvim async or vim without job-feature
noa call airline#async#nvim_vcs_untracked(config, file, vcs)
6 0.000002 endif
9 0.000029 endfor
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
2 0.489283 0.000097 go#complete#Complete()
1 0.489186 0.000271 <SNR>97_gocodeAutocomplete()
1 0.488355 0.015686 <SNR>97_sync_gocode()
4 0.457277 0.000273 <SNR>98_exec()
4 0.456795 0.000822 <SNR>98_system()
2 0.411006 0.000238 go#util#Exec()
1 0.253298 0.000270 <SNR>97_gocodeCommand()
1 0.229293 0.001518 go#cmd#autowrite()
1 0.227289 0.000134 <SNR>42_fmt_autosave()
1 0.227028 0.001207 go#fmt#Format()
1 0.215876 0.000021 go#fmt#run()
23 0.065521 0.003149 airline#check_mode()
4 0.060945 0.007763 airline#highlighter#highlight()
262 0.045279 0.015354 airline#highlighter#exec()
346 0.028849 0.014651 airline#highlighter#get_highlight()
1 0.024177 0.000125 go#util#env()
1 0.024050 0.000030 go#util#goroot()
1 0.023191 0.000029 go#util#gomod()
7 0.018340 UltiSnips#TrackChange()
42 0.015789 0.001563 <SNR>88_exec_separator()
FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
7 0.018340 UltiSnips#TrackChange()
1 0.488355 0.015686 <SNR>97_sync_gocode()
262 0.045279 0.015354 airline#highlighter#exec()
346 0.028849 0.014651 airline#highlighter#get_highlight()
692 0.012133 <SNR>88_get_syn()
4 0.060945 0.007763 airline#highlighter#highlight()
262 0.004643 <SNR>88_CheckDefined()
23 0.065521 0.003149 airline#check_mode()
23 0.003908 0.002579 <SNR>81_update_untracked()
23 0.002855 0.002521 airline#extensions#whitespace#check()
17 0.002314 <SNR>53_Highlight_Matching_Pair()
23 0.002118 fugitive#Head()
346 0.002065 <SNR>88_get_array()
23 0.001797 0.001699 <SNR>81_update_hg_branch()
161 0.001689 airline#util#append()
378 0.001679 <SNR>88_Get()
42 0.015789 0.001563 <SNR>88_exec_separator()
23 0.007169 0.001556 <SNR>81_update_branch()
1 0.004265 0.001554 <SNR>9_LoadFTPlugin()
1 0.229293 0.001518 go#cmd#autowrite()
SCRIPT /home/myitcv/.vim/plugged/ultisnips/autoload/UltiSnips.vim
Sourced 1 time
Total time: 0.021486
Self time: 0.021486
count total (s) self (s)
1 0.000006 if exists("b:did_autoload_ultisnips") || !exists("g:_uspy")
finish
1 0.000001 endif
1 0.000002 let b:did_autoload_ultisnips = 1
" Also import vim as we expect it to be imported in many places.
1 0.006207 exec g:_uspy "import vim"
1 0.015145 exec g:_uspy "from UltiSnips import UltiSnips_Manager"
1 0.000005 function! s:compensate_for_pum()
""" The CursorMovedI event is not triggered while the popup-menu is visible,
""" and it's by this event that UltiSnips updates its vim-state. The fix is
""" to explicitly check for the presence of the popup menu, and update
""" the vim-state accordingly.
if pumvisible()
exec g:_uspy "UltiSnips_Manager._cursor_moved()"
endif
endfunction
1 0.000002 function! UltiSnips#Edit(bang, ...)
if a:0 == 1 && a:1 != ''
let type = a:1
else
let type = ""
endif
exec g:_uspy "vim.command(\"let file = '%s'\" % UltiSnips_Manager._file_to_edit(vim.eval(\"type\"), vim.eval('a:bang')))"
if !len(file)
return
endif
let mode = 'e'
if exists('g:UltiSnipsEditSplit')
if g:UltiSnipsEditSplit == 'vertical'
let mode = 'vs'
elseif g:UltiSnipsEditSplit == 'horizontal'
let mode = 'sp'
elseif g:UltiSnipsEditSplit == 'tabdo'
let mode = 'tabedit'
elseif g:UltiSnipsEditSplit == 'context'
let mode = 'vs'
if winwidth(0) <= 2 * (&tw ? &tw : 80)
let mode = 'sp'
endif
endif
endif
exe ':'.mode.' '.escape(file, ' ')
endfunction
1 0.000002 function! UltiSnips#AddFiletypes(filetypes)
exec g:_uspy "UltiSnips_Manager.add_buffer_filetypes('" . a:filetypes . "')"
return ""
endfunction
1 0.000001 function! UltiSnips#FileTypeComplete(arglead, cmdline, cursorpos)
let ret = {}
let items = map(
\ split(globpath(&runtimepath, 'syntax/*.vim'), '\n'),
\ 'fnamemodify(v:val, ":t:r")'
\ )
call insert(items, 'all')
for item in items
if !has_key(ret, item) && item =~ '^'.a:arglead
let ret[item] = 1
endif
endfor
return sort(keys(ret))
endfunction
1 0.000001 function! UltiSnips#ExpandSnippet()
exec g:_uspy "UltiSnips_Manager.expand()"
return ""
endfunction
1 0.000001 function! UltiSnips#ExpandSnippetOrJump()
call s:compensate_for_pum()
exec g:_uspy "UltiSnips_Manager.expand_or_jump()"
return ""
endfunction
1 0.000001 function! UltiSnips#ListSnippets()
exec g:_uspy "UltiSnips_Manager.list_snippets()"
return ""
endfunction
1 0.000001 function! UltiSnips#SnippetsInCurrentScope(...)
let g:current_ulti_dict = {}
let all = get(a:, 1, 0)
if all
let g:current_ulti_dict_info = {}
endif
exec g:_uspy "UltiSnips_Manager.snippets_in_current_scope(" . all . ")"
return g:current_ulti_dict
endfunction
1 0.000001 function! UltiSnips#SaveLastVisualSelection() range
exec g:_uspy "UltiSnips_Manager._save_last_visual_selection()"
return ""
endfunction
1 0.000001 function! UltiSnips#JumpBackwards()
call s:compensate_for_pum()
exec g:_uspy "UltiSnips_Manager.jump_backwards()"
return ""
endfunction
1 0.000001 function! UltiSnips#JumpForwards()
call s:compensate_for_pum()
exec g:_uspy "UltiSnips_Manager.jump_forwards()"
return ""
endfunction
1 0.000002 function! UltiSnips#AddSnippetWithPriority(trigger, value, description, options, filetype, priority)
exec g:_uspy "trigger = vim.eval(\"a:trigger\")"
exec g:_uspy "value = vim.eval(\"a:value\")"
exec g:_uspy "description = vim.eval(\"a:description\")"
exec g:_uspy "options = vim.eval(\"a:options\")"
exec g:_uspy "filetype = vim.eval(\"a:filetype\")"
exec g:_uspy "priority = vim.eval(\"a:priority\")"
exec g:_uspy "UltiSnips_Manager.add_snippet(trigger, value, description, options, filetype, priority)"
return ""
endfunction
1 0.000002 function! UltiSnips#Anon(value, ...)
" Takes the same arguments as SnippetManager.expand_anon:
" (value, trigger="", description="", options="")
exec g:_uspy "args = vim.eval(\"a:000\")"
exec g:_uspy "value = vim.eval(\"a:value\")"
exec g:_uspy "UltiSnips_Manager.expand_anon(value, *args)"
return ""
endfunction
1 0.000001 function! UltiSnips#CursorMoved()
exec g:_uspy "UltiSnips_Manager._cursor_moved()"
endf
1 0.000001 function! UltiSnips#LeavingBuffer()
exec g:_uspy "UltiSnips_Manager._leaving_buffer()"
endf
1 0.000001 function! UltiSnips#LeavingInsertMode()
exec g:_uspy "UltiSnips_Manager._leaving_insert_mode()"
endfunction
1 0.000001 function! UltiSnips#TrackChange()
exec g:_uspy "UltiSnips_Manager._track_change()"
endfunction
1 0.000001 function! UltiSnips#RefreshSnippets()
exec g:_uspy "UltiSnips_Manager._refresh_snippets()"
endfunction
" }}}
SCRIPT /home/myitcv/.vim/plugged/vim-go/autoload/go/complete.vim
Sourced 1 time
Total time: 0.000311
Self time: 0.000311
count total (s) self (s)
1 0.000018 function! s:gocodeCommand(cmd, args) abort
let l:gocode_bin = "gocode"
let l:gomod = go#util#gomod()
if filereadable(l:gomod)
" Save the file when in module mode so that go list can read the
" imports. If the user doesn't have autowrite or autorwriteall enabled,
" they'll need to write the file manually to get reliable results.
" See https://github.com/fatih/vim-go/pull/1988#issuecomment-428576989.
"
" TODO(bc): don't save the file when in module mode once
" golang.org/x/tools/go/packages has support for an overlay and it's used
" by gocode.
noa w
set modified
let l:gocode_bin = "gocode-gomod"
endif
let bin_path = go#path#CheckBinPath(l:gocode_bin)
if empty(bin_path)
return []
endif
let socket_type = go#config#GocodeSocketType()
let cmd = [bin_path]
let cmd = extend(cmd, ['-sock', socket_type])
let cmd = extend(cmd, ['-f', 'vim'])
if go#config#GocodeProposeBuiltins()
let cmd = extend(cmd, ['-builtin'])
endif
if go#config#GocodeProposeSource()
let cmd = extend(cmd, ['-source'])
else
let cmd = extend(cmd, ['-fallback-to-source'])
endif
if go#config#GocodeUnimportedPackages()
let cmd = extend(cmd, ['-unimported-packages'])
endif
let cmd = extend(cmd, [a:cmd])
let cmd = extend(cmd, a:args)
return cmd
endfunction
1 0.000004 function! s:sync_gocode(cmd, args, input) abort
" We might hit cache problems, as gocode doesn't handle different GOPATHs
" well. See: https://github.com/nsf/gocode/issues/239
let old_goroot = $GOROOT
let $GOROOT = go#util#env("goroot")
try
let cmd = s:gocodeCommand(a:cmd, a:args)
" gocode can sometimes be slow, so redraw now to avoid waiting for gocode
" to return before redrawing automatically.
redraw
let [l:result, l:err] = go#util#Exec(cmd, a:input)
finally
let $GOROOT = old_goroot
endtry
if l:err != 0
return "[0, []]"
endif
if &encoding != 'utf-8'
let l:result = iconv(l:result, 'utf-8', &encoding)
endif
return l:result
endfunction
1 0.000003 function! s:gocodeAutocomplete() abort
" use the offset as is, because the cursor position is the position for
" which autocomplete candidates are needed.
return s:sync_gocode('autocomplete',
\ [expand('%:p'), go#util#OffsetCursor()],
\ go#util#GetLines())
endfunction
" go#complete#GoInfo returns the description of the identifier under the
" cursor.
1 0.000003 function! go#complete#GetInfo() abort
return s:sync_info(0)
endfunction
1 0.000003 function! go#complete#Info(showstatus) abort
if go#util#has_job(1)
return s:async_info(1, a:showstatus)
else
return s:sync_info(1)
endif
endfunction
1 0.000003 function! s:async_info(echo, showstatus)
let state = {'echo': a:echo}
function! s:complete(job, exit_status, messages) abort dict
if a:exit_status != 0
return
endif
if &encoding != 'utf-8'
let i = 0
while i < len(a:messages)
let a:messages[i] = iconv(a:messages[i], 'utf-8', &encoding)
let i += 1
endwhile
endif
let result = s:info_filter(self.echo, join(a:messages, "\n"))
call s:info_complete(self.echo, result)
endfunction
" explicitly bind complete to state so that within it, self will
" always refer to state. See :help Partial for more information.
let state.complete = function('s:complete', [], state)
" add 1 to the offset, so that the position at the cursor will be included
" in gocode's search
let offset = go#util#OffsetCursor()+1
" We might hit cache problems, as gocode doesn't handle different GOPATHs
" well. See: https://github.com/nsf/gocode/issues/239
let env = {
\ "GOROOT": go#util#env("goroot")
\ }
let opts = {
\ 'bang': 1,
\ 'complete': state.complete,
\ 'for': '_',
\ }
if a:showstatus
let opts.statustype = 'gocode'
endif
let opts = go#job#Options(l:opts)
let cmd = s:gocodeCommand('autocomplete',
\ [expand('%:p'), offset])
" TODO(bc): Don't write the buffer to a file; pass the buffer directly to
" gocode's stdin. It shouldn't be necessary to use {in_io: 'file', in_name:
" s:gocodeFile()}, but unfortunately {in_io: 'buffer', in_buf: bufnr('%')}
" doesn't work.
call extend(opts, {
\ 'env': env,
\ 'in_io': 'file',
\ 'in_name': s:gocodeFile(),
\ })
call go#job#Start(cmd, opts)
endfunction
1 0.000003 function! s:gocodeFile()
let file = tempname()
call writefile(go#util#GetLines(), file)
return file
endfunction
1 0.000003 function! s:sync_info(echo)
" add 1 to the offset, so that the position at the cursor will be included
" in gocode's search
let offset = go#util#OffsetCursor()+1
let result = s:sync_gocode('autocomplete',
\ [expand('%:p'), offset],
\ go#util#GetLines())
let result = s:info_filter(a:echo, result)
return s:info_complete(a:echo, result)
endfunction
1 0.000003 function! s:info_filter(echo, result) abort
if empty(a:result)
return ""
endif
let l:result = eval(a:result)
if len(l:result) != 2
return ""
endif
let l:candidates = l:result[1]
if len(l:candidates) == 1
" When gocode panics in vim mode, it returns
" [0, [{'word': 'PANIC', 'abbr': 'PANIC PANIC PANIC', 'info': 'PANIC PANIC PANIC'}]]
if a:echo && l:candidates[0].info ==# "PANIC PANIC PANIC"
return ""
endif
return l:candidates[0].info
endif
let filtered = []
let wordMatch = '\<' . expand("<cword>") . '\>'
" escape single quotes in wordMatch before passing it to filter
let wordMatch = substitute(wordMatch, "'", "''", "g")
let filtered = filter(l:candidates, "v:val.info =~ '".wordMatch."'")
if len(l:filtered) != 1
return ""
endif
return l:filtered[0].info
endfunction
1 0.000003 function! s:info_complete(echo, result) abort
if a:echo && !empty(a:result)
echo "vim-go: " | echohl Function | echon a:result | echohl None
endif
return a:result
endfunction
1 0.000003 function! s:trim_bracket(val) abort
let a:val.word = substitute(a:val.word, '[(){}\[\]]\+$', '', '')
return a:val
endfunction
1 0.000007 let s:completions = ""
1 0.000004 function! go#complete#Complete(findstart, base) abort
"findstart = 1 when we need to get the text length
if a:findstart == 1
execute "silent let s:completions = " . s:gocodeAutocomplete()
return col('.') - s:completions[0] - 1
"findstart = 0 when we need to return the list of completions
else
let s = getline(".")[col('.') - 1]
if s =~ '[(){}\{\}]'
return map(copy(s:completions[1]), 's:trim_bracket(v:val)')
endif
return s:completions[1]
endif
endfunction
1 0.000002 function! go#complete#ToggleAutoTypeInfo() abort
if go#config#AutoTypeInfo()
call go#config#SetAutoTypeInfo(0)
call go#util#EchoProgress("auto type info disabled")
return
end
call go#config#SetAutoTypeInfo(1)
call go#util#EchoProgress("auto type info enabled")
endfunction
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/autoload/go/util.vim
Sourced 1 time
Total time: 0.000489
Self time: 0.000489
count total (s) self (s)
" PathSep returns the appropriate OS specific path separator.
1 0.000004 function! go#util#PathSep() abort
if go#util#IsWin()
return '\'
endif
return '/'
endfunction
" PathListSep returns the appropriate OS specific path list separator.
1 0.000002 function! go#util#PathListSep() abort
if go#util#IsWin()
return ";"
endif
return ":"
endfunction
" LineEnding returns the correct line ending, based on the current fileformat
1 0.000002 function! go#util#LineEnding() abort
if &fileformat == 'dos'
return "\r\n"
elseif &fileformat == 'mac'
return "\r"
endif
return "\n"
endfunction
" Join joins any number of path elements into a single path, adding a
" Separator if necessary and returns the result
1 0.000001 function! go#util#Join(...) abort
return join(a:000, go#util#PathSep())
endfunction
" IsWin returns 1 if current OS is Windows or 0 otherwise
1 0.000002 function! go#util#IsWin() abort
let win = ['win16', 'win32', 'win64', 'win95']
for w in win
if (has(w))
return 1
endif
endfor
return 0
endfunction
" IsMac returns 1 if current OS is macOS or 0 otherwise.
1 0.000001 function! go#util#IsMac() abort
return has('mac') ||
\ has('macunix') ||
\ has('gui_macvim') ||
\ go#util#Exec(['uname'])[0] =~? '^darwin'
endfunction
" Checks if using:
" 1) Windows system,
" 2) And has cygpath executable,
" 3) And uses *sh* as 'shell'
1 0.000002 function! go#util#IsUsingCygwinShell()
return go#util#IsWin() && executable('cygpath') && &shell =~ '.*sh.*'
endfunction
" Check if Vim jobs API is supported.
"
" The (optional) first parameter can be added to indicate the 'cwd' or 'env'
" parameters will be used, which wasn't added until a later version.
1 0.000002 function! go#util#has_job(...) abort
if has('nvim')
return 1
endif
" cwd and env parameters to job_start was added in this version.
if a:0 > 0 && a:1 is 1
return has('job') && has("patch-8.0.0902")
endif
" job was introduced in 7.4.xxx however there are multiple bug fixes and one
" of the latest is 8.0.0087 which is required for a stable async API.
return has('job') && has("patch-8.0.0087")
endfunction
1 0.000005 let s:env_cache = {}
" env returns the go environment variable for the given key. Where key can be
" GOARCH, GOOS, GOROOT, etc... It caches the result and returns the cached
" version.
1 0.000002 function! go#util#env(key) abort
let l:key = tolower(a:key)
if has_key(s:env_cache, l:key)
return s:env_cache[l:key]
endif
if executable('go')
let l:var = call('go#util#'.l:key, [])
if go#util#ShellError() != 0
call go#util#EchoError(printf("'go env %s' failed", toupper(l:key)))
return ''
endif
else
let l:var = eval("$".toupper(a:key))
endif
let s:env_cache[l:key] = l:var
return l:var
endfunction
" goarch returns 'go env GOARCH'. This is an internal function and shouldn't
" be used. Instead use 'go#util#env("goarch")'
1 0.000002 function! go#util#goarch() abort
return substitute(s:exec(['go', 'env', 'GOARCH'])[0], '\n', '', 'g')
endfunction
" goos returns 'go env GOOS'. This is an internal function and shouldn't
" be used. Instead use 'go#util#env("goos")'
1 0.000002 function! go#util#goos() abort
return substitute(s:exec(['go', 'env', 'GOOS'])[0], '\n', '', 'g')
endfunction
" goroot returns 'go env GOROOT'. This is an internal function and shouldn't
" be used. Instead use 'go#util#env("goroot")'
1 0.000001 function! go#util#goroot() abort
return substitute(s:exec(['go', 'env', 'GOROOT'])[0], '\n', '', 'g')
endfunction
" gopath returns 'go env GOPATH'. This is an internal function and shouldn't
" be used. Instead use 'go#util#env("gopath")'
1 0.000002 function! go#util#gopath() abort
return substitute(s:exec(['go', 'env', 'GOPATH'])[0], '\n', '', 'g')
endfunction
" gomod returns 'go env GOMOD'. gomod changes depending on the folder. Don't
" use go#util#env as it caches the value.
1 0.000002 function! go#util#gomod() abort
return substitute(s:exec(['go', 'env', 'GOMOD'])[0], '\n', '', 'g')
endfunction
1 0.000001 function! go#util#osarch() abort
return go#util#env("goos") . '_' . go#util#env("goarch")
endfunction
" Run a shell command.
"
" It will temporary set the shell to /bin/sh for Unix-like systems if possible,
" so that we always use a standard POSIX-compatible Bourne shell (and not e.g.
" csh, fish, etc.) See #988 and #1276.
1 0.000004 function! s:system(cmd, ...) abort
" Preserve original shell, shellredir and shellcmdflag values
let l:shell = &shell
let l:shellredir = &shellredir
let l:shellcmdflag = &shellcmdflag
if !go#util#IsWin() && executable('/bin/sh')
set shell=/bin/sh shellredir=>%s\ 2>&1 shellcmdflag=-c
endif
try
return call('system', [a:cmd] + a:000)
finally
" Restore original values
let &shell = l:shell
let &shellredir = l:shellredir
let &shellcmdflag = l:shellcmdflag
endtry
endfunction
" System runs a shell command "str". Every arguments after "str" is passed to
" stdin.
1 0.000002 function! go#util#System(str, ...) abort
return call('s:system', [a:str] + a:000)
endfunction
" Exec runs a shell command "cmd", which must be a list, one argument per item.
" Every list entry will be automatically shell-escaped
" Every other argument is passed to stdin.
1 0.000003 function! go#util#Exec(cmd, ...) abort
if len(a:cmd) == 0
call go#util#EchoError("go#util#Exec() called with empty a:cmd")
return ['', 1]
endif
let l:bin = a:cmd[0]
" Lookup the full path, respecting settings such as 'go_bin_path'. On errors,
" CheckBinPath will show a warning for us.
let l:bin = go#path#CheckBinPath(l:bin)
if empty(l:bin)
return ['', 1]
endif
" Finally execute the command using the full, resolved path. Do not pass the
" unmodified command as the correct program might not exist in $PATH.
return call('s:exec', [[l:bin] + a:cmd[1:]] + a:000)
endfunction
1 0.000002 function! s:exec(cmd, ...) abort
let l:bin = a:cmd[0]
let l:cmd = go#util#Shelljoin([l:bin] + a:cmd[1:])
if go#util#HasDebug('shell-commands')
call go#util#EchoInfo('shell command: ' . l:cmd)
endif
let l:out = call('s:system', [l:cmd] + a:000)
return [l:out, go#util#ShellError()]
endfunction
1 0.000002 function! go#util#ShellError() abort
return v:shell_error
endfunction
" StripPath strips the path's last character if it's a path separator.
" example: '/foo/bar/' -> '/foo/bar'
1 0.000003 function! go#util#StripPathSep(path) abort
let last_char = strlen(a:path) - 1
if a:path[last_char] == go#util#PathSep()
return strpart(a:path, 0, last_char)
endif
return a:path
endfunction
" StripTrailingSlash strips the trailing slash from the given path list.
" example: ['/foo/bar/'] -> ['/foo/bar']
1 0.000003 function! go#util#StripTrailingSlash(paths) abort
return map(copy(a:paths), 'go#util#StripPathSep(v:val)')
endfunction
" Shelljoin returns a shell-safe string representation of arglist. The
" {special} argument of shellescape() may optionally be passed.
1 0.000002 function! go#util#Shelljoin(arglist, ...) abort
try
let ssl_save = &shellslash
set noshellslash
if a:0
return join(map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')'), ' ')
endif
return join(map(copy(a:arglist), 'shellescape(v:val)'), ' ')
finally
let &shellslash = ssl_save
endtry
endfunction
1 0.000002 fu! go#util#Shellescape(arg)
try
let ssl_save = &shellslash
set noshellslash
return shellescape(a:arg)
finally
let &shellslash = ssl_save
endtry
endf
" Shelllist returns a shell-safe representation of the items in the given
" arglist. The {special} argument of shellescape() may optionally be passed.
1 0.000002 function! go#util#Shelllist(arglist, ...) abort
try
let ssl_save = &shellslash
set noshellslash
if a:0
return map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')')
endif
return map(copy(a:arglist), 'shellescape(v:val)')
finally
let &shellslash = ssl_save
endtry
endfunction
" Returns the byte offset for line and column
1 0.000003 function! go#util#Offset(line, col) abort
if &encoding != 'utf-8'
let sep = go#util#LineEnding()
let buf = a:line == 1 ? '' : (join(getline(1, a:line-1), sep) . sep)
let buf .= a:col == 1 ? '' : getline('.')[:a:col-2]
return len(iconv(buf, &encoding, 'utf-8'))
endif
return line2byte(a:line) + (a:col-2)
endfunction
"
" Returns the byte offset for the cursor
1 0.000003 function! go#util#OffsetCursor() abort
return go#util#Offset(line('.'), col('.'))
endfunction
" Windo is like the built-in :windo, only it returns to the window the command
" was issued from
1 0.000002 function! go#util#Windo(command) abort
let s:currentWindow = winnr()
try
execute "windo " . a:command
finally
execute s:currentWindow. "wincmd w"
unlet s:currentWindow
endtry
endfunction
" snippetcase converts the given word to given preferred snippet setting type
" case.
1 0.000002 function! go#util#snippetcase(word) abort
let l:snippet_case = go#config#AddtagsTransform()
if l:snippet_case == "snakecase"
return go#util#snakecase(a:word)
elseif l:snippet_case == "camelcase"
return go#util#camelcase(a:word)
else
return a:word " do nothing
endif
endfunction
" snakecase converts a string to snake case. i.e: FooBar -> foo_bar
" Copied from tpope/vim-abolish
1 0.000002 function! go#util#snakecase(word) abort
let word = substitute(a:word, '::', '/', 'g')
let word = substitute(word, '\(\u\+\)\(\u\l\)', '\1_\2', 'g')
let word = substitute(word, '\(\l\|\d\)\(\u\)', '\1_\2', 'g')
let word = substitute(word, '[.-]', '_', 'g')
let word = tolower(word)
return word
endfunction
" camelcase converts a string to camel case. e.g. FooBar or foo_bar will become
" fooBar.
" Copied from tpope/vim-abolish.
1 0.000002 function! go#util#camelcase(word) abort
let word = substitute(a:word, '-', '_', 'g')
if word !~# '_' && word =~# '\l'
return substitute(word, '^.', '\l&', '')
else
return substitute(word, '\C\(_\)\=\(.\)', '\=submatch(1)==""?tolower(submatch(2)) : toupper(submatch(2))','g')
endif
endfunction
" pascalcase converts a string to 'PascalCase'. e.g. fooBar or foo_bar will
" become FooBar.
1 0.000003 function! go#util#pascalcase(word) abort
let word = go#util#camelcase(a:word)
return toupper(word[0]) . word[1:]
endfunction
" Echo a message to the screen and highlight it with the group in a:hi.
"
" The message can be a list or string; every line with be :echomsg'd separately.
1 0.000003 function! s:echo(msg, hi)
let l:msg = []
if type(a:msg) != type([])
let l:msg = split(a:msg, "\n")
else
let l:msg = a:msg
endif
" Tabs display as ^I or <09>, so manually expand them.
let l:msg = map(l:msg, 'substitute(v:val, "\t", " ", "")')
exe 'echohl ' . a:hi
for line in l:msg
echom "vim-go: " . line
endfor
echohl None
endfunction
1 0.000002 function! go#util#EchoSuccess(msg)
call s:echo(a:msg, 'Function')
endfunction
1 0.000002 function! go#util#EchoError(msg)
call s:echo(a:msg, 'ErrorMsg')
endfunction
1 0.000002 function! go#util#EchoWarning(msg)
call s:echo(a:msg, 'WarningMsg')
endfunction
1 0.000002 function! go#util#EchoProgress(msg)
redraw
call s:echo(a:msg, 'Identifier')
endfunction
1 0.000002 function! go#util#EchoInfo(msg)
call s:echo(a:msg, 'Debug')
endfunction
" Get all lines in the buffer as a a list.
1 0.000002 function! go#util#GetLines()
let buf = getline(1, '$')
if &encoding != 'utf-8'
let buf = map(buf, 'iconv(v:val, &encoding, "utf-8")')
endif
if &l:fileformat == 'dos'
" XXX: line2byte() depend on 'fileformat' option.
" so if fileformat is 'dos', 'buf' must include '\r'.
let buf = map(buf, 'v:val."\r"')
endif
return buf
endfunction
" Convert the current buffer to the "archive" format of
" golang.org/x/tools/go/buildutil:
" https://godoc.org/golang.org/x/tools/go/buildutil#ParseOverlayArchive
"
" > The archive consists of a series of files. Each file consists of a name, a
" > decimal file size and the file contents, separated by newlinews. No newline
" > follows after the file contents.
1 0.000002 function! go#util#archive()
let l:buffer = join(go#util#GetLines(), "\n")
return expand("%:p:gs!\\!/!") . "\n" . strlen(l:buffer) . "\n" . l:buffer
endfunction
" Make a named temporary directory which starts with "prefix".
"
" Unfortunately Vim's tempname() is not portable enough across various systems;
" see: https://github.com/mattn/vim-go/pull/3#discussion_r138084911
1 0.000002 function! go#util#tempdir(prefix) abort
" See :help tempfile
if go#util#IsWin()
let l:dirs = [$TMP, $TEMP, 'c:\tmp', 'c:\temp']
else
let l:dirs = [$TMPDIR, '/tmp', './', $HOME]
endif
let l:dir = ''
for l:d in dirs
if !empty(l:d) && filewritable(l:d) == 2
let l:dir = l:d
break
endif
endfor
if l:dir == ''
call go#util#EchoError('Unable to find directory to store temporary directory in')
return
endif
" Not great randomness, but "good enough" for our purpose here.
let l:rnd = sha256(printf('%s%s', localtime(), fnamemodify(bufname(''), ":p")))
let l:tmp = printf("%s/%s%s", l:dir, a:prefix, l:rnd)
call mkdir(l:tmp, 'p', 0700)
return l:tmp
endfunction
" Report if the user enabled a debug flag in g:go_debug.
1 0.000001 function! go#util#HasDebug(flag)
return index(go#config#Debug(), a:flag) >= 0
endfunction
" vim: sw=2 ts=2 et
SCRIPT /home/myitcv/.vim/plugged/vim-go/autoload/go/path.vim
Sourced 1 time
Total time: 0.000232
Self time: 0.000232
count total (s) self (s)
" initial_go_path is used to store the initial GOPATH that was set when Vim
" was started. It's used with :GoPathClear to restore the GOPATH when the user
" changed it explicitly via :GoPath. Initially it's empty. It's being set when
" :GoPath is used
1 0.000006 let s:initial_go_path = ""
" GoPath sets or echos the current GOPATH. If no arguments are passed it
" echoes the current GOPATH, if an argument is passed it replaces the current
" GOPATH with it. If two double quotes are passed (the empty string in go),
" it'll clear the GOPATH and will restore to the initial GOPATH.
1 0.000005 function! go#path#GoPath(...) abort
" no argument, show GOPATH
if len(a:000) == 0
echo go#path#Default()
return
endif
" we have an argument, replace GOPATH
" clears the current manually set GOPATH and restores it to the
" initial GOPATH, which was set when Vim was started.
if len(a:000) == 1 && a:1 == '""'
if !empty(s:initial_go_path)
let $GOPATH = s:initial_go_path
let s:initial_go_path = ""
endif
echon "vim-go: " | echohl Function | echon "GOPATH restored to ". $GOPATH | echohl None
return
endif
echon "vim-go: " | echohl Function | echon "GOPATH changed to ". a:1 | echohl None
let s:initial_go_path = $GOPATH
let $GOPATH = a:1
endfunction
" Default returns the default GOPATH. If GOPATH is not set, it uses the
" default GOPATH set starting with Go 1.8. This GOPATH can be retrieved via
" 'go env GOPATH'
1 0.000003 function! go#path#Default() abort
if $GOPATH == ""
" use default GOPATH via go env
return go#util#env("gopath")
endif
return $GOPATH
endfunction
" s:HasPath checks whether the given path exists in GOPATH environment variable
" or not
1 0.000004 function! s:HasPath(path) abort
let go_paths = split(go#path#Default(), go#util#PathListSep())
let last_char = strlen(a:path) - 1
" check cases of '/foo/bar/' and '/foo/bar'
if a:path[last_char] == go#util#PathSep()
let withSep = a:path
let noSep = strpart(a:path, 0, last_char)
else
let withSep = a:path . go#util#PathSep()
let noSep = a:path
endif
let hasA = index(go_paths, withSep) != -1
let hasB = index(go_paths, noSep) != -1
return hasA || hasB
endfunction
" Detect returns the current GOPATH. If a package manager is used, such as
" Godeps, GB, it will modify the GOPATH so those directories take precedence
" over the current GOPATH. It also detects diretories whose are outside
" GOPATH.
1 0.000002 function! go#path#Detect() abort
let gopath = go#path#Default()
let current_dir = fnameescape(expand('%:p:h'))
" TODO(arslan): this should be changed so folders or files should be
" fetched from a customizable list. The user should define any new package
" management tool by it's own.
" src folders outside $GOPATH
let src_roots = finddir("src", current_dir .";", -1)
" for cases like GOPATH/src/foo/src/bar, pick up GOPATH/src instead of
" GOPATH/src/foo/src
let src_root = ""
if len(src_roots) > 0
let src_root = src_roots[-1]
endif
if !empty(src_root)
let src_path = fnamemodify(src_root, ':p:h:h') . go#util#PathSep()
" gb vendor plugin
" (https://github.com/constabulary/gb/tree/master/cmd/gb-vendor)
let gb_vendor_root = src_path . "vendor" . go#util#PathSep()
if isdirectory(gb_vendor_root) && !s:HasPath(gb_vendor_root)
let gopath = gb_vendor_root . go#util#PathListSep() . gopath
endif
if !s:HasPath(src_path)
let gopath = src_path . go#util#PathListSep() . gopath
endif
endif
" Godeps
let godeps_root = finddir("Godeps", current_dir .";")
if !empty(godeps_root)
let godeps_path = join([fnamemodify(godeps_root, ':p:h:h'), "Godeps", "_workspace" ], go#util#PathSep())
if !s:HasPath(godeps_path)
let gopath = godeps_path . go#util#PathListSep() . gopath
endif
endif
" Fix up the case where initial $GOPATH is empty,
" and we end up with a trailing :
let gopath = substitute(gopath, ":$", "", "")
return gopath
endfunction
" BinPath returns the binary path of installed go tools.
1 0.000005 function! go#path#BinPath() abort
let bin_path = go#config#BinPath()
if bin_path != ""
return bin_path
endif
" check if our global custom path is set, if not check if $GOBIN is set so
" we can use it, otherwise use default GOPATH
if $GOBIN != ""
let bin_path = $GOBIN
else
let go_paths = split(go#path#Default(), go#util#PathListSep())
if len(go_paths) == 0
return "" "nothing found
endif
let bin_path = expand(go_paths[0] . "/bin/")
endif
return bin_path
endfunction
" CheckBinPath checks whether the given binary exists or not and returns the
" path of the binary, respecting the go_bin_path and go_search_bin_path_first
" settings. It returns an empty string if the binary doesn't exist.
1 0.000003 function! go#path#CheckBinPath(binpath) abort
" remove whitespaces if user applied something like 'goimports '
let binpath = substitute(a:binpath, '^\s*\(.\{-}\)\s*$', '\1', '')
" save original path
let old_path = $PATH
" check if we have an appropriate bin_path
let go_bin_path = go#path#BinPath()
if !empty(go_bin_path)
" append our GOBIN and GOPATH paths and be sure they can be found there...
" let us search in our GOBIN and GOPATH paths
" respect the ordering specified by go_search_bin_path_first
if go#config#SearchBinPathFirst()
let $PATH = go_bin_path . go#util#PathListSep() . $PATH
else
let $PATH = $PATH . go#util#PathListSep() . go_bin_path
endif
endif
" if it's in PATH just return it
if executable(binpath)
if exists('*exepath')
let binpath = exepath(binpath)
endif
let $PATH = old_path
if go#util#IsUsingCygwinShell() == 1
return s:CygwinPath(binpath)
endif
return binpath
endif
" just get the basename
let basename = fnamemodify(binpath, ":t")
if !executable(basename)
call go#util#EchoError(printf("could not find '%s'. Run :GoInstallBinaries to fix it", basename))
" restore back!
let $PATH = old_path
return ""
endif
let $PATH = old_path
if go#util#IsUsingCygwinShell() == 1
return s:CygwinPath(a:binpath)
endif
return go_bin_path . go#util#PathSep() . basename
endfunction
1 0.000003 function! s:CygwinPath(path)
return substitute(a:path, '\\', '/', "g")
endfunction
" vim: sw=2 ts=2 et
FUNCTION airline#check_mode()
Defined: ~/.vim/plugged/vim-airline/autoload/airline.vim line 163
Called 16 times
Total time: 0.034664
Self time: 0.002157
count total (s) self (s)
16 0.000065 if !has_key(s:contexts, a:winnr)
return ''
16 0.000017 endif
16 0.000057 let context = s:contexts[a:winnr]
16 0.000071 if get(w:, 'airline_active', 1)
16 0.000057 let l:m = mode(1)
16 0.000034 if l:m ==# "i"
7 0.000015 let l:mode = ['insert']
9 0.000028 elseif l:m[0] ==# "i"
1 0.000004 let l:mode = ['insert']
8 0.000010 elseif l:m ==# "Rv"
let l:mode =['replace']
8 0.000014 elseif l:m[0] ==# "R"
let l:mode = ['replace']
8 0.000089 elseif l:m[0] =~# '\v(v|V||s|S|)'
let l:mode = ['visual']
8 0.000011 elseif l:m ==# "t"
let l:mode = ['terminal']
8 0.000014 elseif l:m[0] ==# "c"
let l:mode = ['commandline']
8 0.000013 elseif l:m ==# "no" " does not work, most likely, Vim does not refresh the statusline in OP mode
let l:mode = ['normal']
8 0.000021 elseif l:m[0:1] ==# 'ni'
let l:mode = ['normal']
let l:m = 'ni'
8 0.000006 else
8 0.000022 let l:mode = ['normal']
16 0.000013 endif
16 0.000081 if index(['Rv', 'no', 'ni', 'ix', 'ic'], l:m) == -1
15 0.000036 let l:m = l:m[0]
16 0.000010 endif
16 0.000095 let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m)
else
let l:mode = ['inactive']
let w:airline_current_mode = get(g:airline_mode_map, '__')
16 0.000011 endif
16 0.000063 if g:airline_detect_modified && &modified
10 0.000039 call add(l:mode, 'modified')
16 0.000012 endif
16 0.000034 if g:airline_detect_paste && &paste
call add(l:mode, 'paste')
16 0.000005 endif
16 0.000078 if g:airline_detect_crypt && exists("+key") && !empty(&key)
call add(l:mode, 'crypt')
16 0.000007 endif
16 0.000037 if g:airline_detect_spell && &spell
call add(l:mode, 'spell')
16 0.000011 endif
16 0.000033 if &readonly || ! &modifiable
call add(l:mode, 'readonly')
16 0.000010 endif
16 0.000067 let mode_string = join(l:mode)
16 0.000063 if get(w:, 'airline_lastmode', '') != mode_string
2 0.000749 0.000034 call airline#highlighter#highlight_modified_inactive(context.bufnr)
2 0.031720 0.000026 call airline#highlighter#highlight(l:mode, context.bufnr)
2 0.000113 0.000015 call airline#util#doautocmd('AirlineModeChanged')
2 0.000006 let w:airline_lastmode = mode_string
16 0.000010 endif
16 0.000020 return ''
FUNCTION <SNR>88_CheckDefined()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 124
Called 122 times
Total time: 0.002264
Self time: 0.002264
count total (s) self (s)
" Checks, whether the definition of the colors is valid and is not empty or NONE
" e.g. if the colors would expand to this:
" hi airline_c ctermfg=NONE ctermbg=NONE
" that means to clear that highlighting group, therefore, fallback to Normal
" highlighting group for the cterm values
" This only works, if the Normal highlighting group is actually defined, so
" return early, if it has been cleared
122 0.000308 if !exists("g:airline#highlighter#normal_fg_hi")
let g:airline#highlighter#normal_fg_hi = synIDattr(synIDtrans(hlID('Normal')), 'fg', 'cterm')
122 0.000054 endif
122 0.000303 if empty(g:airline#highlighter#normal_fg_hi) || g:airline#highlighter#normal_fg_hi < 0
return a:colors
122 0.000053 endif
194 0.000261 for val in a:colors
194 0.000319 if !empty(val) && val !=# 'NONE'
122 0.000112 return a:colors
72 0.000027 endif
72 0.000032 endfor
" this adds the bold attribute to the term argument of the :hi command,
" but at least this makes sure, the group will be defined
let fg = g:airline#highlighter#normal_fg_hi
let bg = synIDattr(synIDtrans(hlID('Normal')), 'bg', 'cterm')
if bg < 0
" in case there is no background color defined for Normal
let bg = a:colors[3]
endif
return a:colors[0:1] + [fg, bg] + [a:colors[4]]
FUNCTION airline#util#append()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 34
Called 112 times
Total time: 0.001173
Self time: 0.001173
count total (s) self (s)
112 0.000247 if a:minwidth > 0 && winwidth(0) < a:minwidth
return ''
112 0.000068 endif
112 0.000370 let prefix = s:spc == "\ua0" ? s:spc : s:spc.s:spc
112 0.000311 return empty(a:text) ? '' : prefix.g:airline_left_alt_sep.s:spc.a:text
FUNCTION airline#extensions#branch#update_untracked_config()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 163
Called 16 times
Total time: 0.000249
Self time: 0.000249
count total (s) self (s)
16 0.000063 if !has_key(s:vcs_config[a:vcs].untracked, a:file)
return
16 0.000065 elseif s:vcs_config[a:vcs].untracked[a:file] != b:buffer_vcs_config[a:vcs].untracked
let b:buffer_vcs_config[a:vcs].untracked = s:vcs_config[a:vcs].untracked[a:file]
unlet! b:airline_head
16 0.000010 endif
FUNCTION airline#themes#get_highlight()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/themes.vim line 31
Called 48 times
Total time: 0.004210
Self time: 0.000382
count total (s) self (s)
48 0.004196 0.000368 return call('airline#highlighter#get_highlight', [a:group] + a:000)
FUNCTION <SNR>42_echo_go_info()
Defined: ~/.vim/plugged/vim-go/plugin/go.vim line 211
Called 1 time
Total time: 0.000020
Self time: 0.000020
count total (s) self (s)
1 0.000005 if !get(g:, "go_echo_go_info", 1)
return
1 0.000001 endif
1 0.000008 if !exists('v:completed_item') || empty(v:completed_item)
1 0.000001 return
endif
let item = v:completed_item
if !has_key(item, "info")
return
endif
if empty(item.info)
return
endif
redraws! | echo "vim-go: " | echohl Function | echon item.info | echohl None
FUNCTION go#util#goroot()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 120
Called 1 time
Total time: 0.023309
Self time: 0.000026
count total (s) self (s)
1 0.023309 0.000026 return substitute(s:exec(['go', 'env', 'GOROOT'])[0], '\n', '', 'g')
FUNCTION <SNR>81_update_hg_branch()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 118
Called 16 times
Total time: 0.001203
Self time: 0.001137
count total (s) self (s)
16 0.000218 0.000152 if airline#util#has_lawrencium()
let cmd='LC_ALL=C hg qtop'
let stl=lawrencium#statusline()
let file=expand('%:p')
if !empty(stl) && get(b:, 'airline_do_mq_check', 1)
if g:airline#init#vim_async
noa call airline#async#get_mq_async(cmd, file)
elseif has("nvim")
noa call airline#async#nvim_get_mq_async(cmd, file)
else
" remove \n at the end of the command
let output=system(cmd)[0:-2]
noa call airline#async#mq_output(output, file)
endif
endif
" do not do mq check anymore
let b:airline_do_mq_check = 0
if exists("b:mq") && !empty(b:mq)
if stl is# 'default'
" Shorten default a bit
let stl='def'
endif
let stl.=' ['.b:mq.']'
endif
let s:vcs_config['mercurial'].branch = stl
16 0.000009 else
16 0.000056 let s:vcs_config['mercurial'].branch = ''
16 0.000012 endif
FUNCTION go#config#Debug()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 185
Called 3 times
Total time: 0.000015
Self time: 0.000015
count total (s) self (s)
3 0.000013 return get(g:, 'go_debug', [])
FUNCTION go#config#SearchBinPathFirst()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 359
Called 2 times
Total time: 0.000009
Self time: 0.000009
count total (s) self (s)
2 0.000008 return get(g:, 'go_search_bin_path_first', 1)
FUNCTION airline#parts#filetype()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 101
Called 16 times
Total time: 0.000092
Self time: 0.000092
count total (s) self (s)
16 0.000079 return winwidth(0) < 90 && strlen(&filetype) > 3 ? matchstr(&filetype, '...'). (&encoding is? 'utf-8' ? '…' : '>') : &filetype
FUNCTION airline#parts#iminsert()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 81
Called 16 times
Total time: 0.000120
Self time: 0.000120
count total (s) self (s)
16 0.000048 if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name')
return toupper(b:keymap_name)
16 0.000013 endif
16 0.000015 return ''
FUNCTION go#util#IsUsingCygwinShell()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 58
Called 2 times
Total time: 0.000105
Self time: 0.000019
count total (s) self (s)
2 0.000103 0.000017 return go#util#IsWin() && executable('cygpath') && &shell =~ '.*sh.*'
FUNCTION go#util#HasDebug()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 436
Called 3 times
Total time: 0.000047
Self time: 0.000032
count total (s) self (s)
3 0.000045 0.000030 return index(go#config#Debug(), a:flag) >= 0
FUNCTION go#util#Shelljoin()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 229
Called 3 times
Total time: 0.000113
Self time: 0.000113
count total (s) self (s)
3 0.000003 try
3 0.000008 let ssl_save = &shellslash
3 0.000008 set noshellslash
3 0.000003 if a:0
return join(map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')'), ' ')
3 0.000001 endif
3 0.000055 return join(map(copy(a:arglist), 'shellescape(v:val)'), ' ')
3 0.000004 finally
3 0.000007 let &shellslash = ssl_save
3 0.000002 endtry
FUNCTION <SNR>97_gocodeAutocomplete()
Defined: ~/.vim/plugged/vim-go/autoload/go/complete.vim line 77
Called 1 time
Total time: 0.264103
Self time: 0.000278
count total (s) self (s)
" use the offset as is, because the cursor position is the position for
" which autocomplete candidates are needed.
1 0.264101 0.000276 return s:sync_gocode('autocomplete', [expand('%:p'), go#util#OffsetCursor()], go#util#GetLines())
FUNCTION airline#util#doautocmd()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 124
Called 2 times
Total time: 0.000098
Self time: 0.000032
count total (s) self (s)
2 0.000098 0.000032 exe printf("silent doautocmd %s User %s", s:nomodeline, a:event)
FUNCTION go#util#env()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 86
Called 1 time
Total time: 0.023428
Self time: 0.000118
count total (s) self (s)
1 0.000004 let l:key = tolower(a:key)
1 0.000003 if has_key(s:env_cache, l:key)
return s:env_cache[l:key]
1 0.000000 endif
1 0.000070 if executable('go')
1 0.023323 0.000014 let l:var = call('go#util#'.l:key, [])
1 0.000008 0.000007 if go#util#ShellError() != 0
call go#util#EchoError(printf("'go env %s' failed", toupper(l:key)))
return ''
1 0.000000 endif
else
let l:var = eval("$".toupper(a:key))
1 0.000001 endif
1 0.000005 let s:env_cache[l:key] = l:var
1 0.000002 return l:var
FUNCTION <SNR>98_system()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 146
Called 3 times
Total time: 0.248843
Self time: 0.000603
count total (s) self (s)
" Preserve original shell, shellredir and shellcmdflag values
3 0.000006 let l:shell = &shell
3 0.000005 let l:shellredir = &shellredir
3 0.000005 let l:shellcmdflag = &shellcmdflag
3 0.000142 0.000038 if !go#util#IsWin() && executable('/bin/sh')
3 0.000036 0.000029 set shell=/bin/sh shellredir=>%s\ 2>&1 shellcmdflag=-c
3 0.000002 endif
3 0.000002 try
3 0.248505 0.000409 return call('system', [a:cmd] + a:000)
3 0.000019 finally
" Restore original values
3 0.000076 0.000046 let &shell = l:shell
3 0.000011 0.000010 let &shellredir = l:shellredir
3 0.000009 0.000007 let &shellcmdflag = l:shellcmdflag
3 0.000008 endtry
FUNCTION go#util#gomod()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 132
Called 1 time
Total time: 0.023365
Self time: 0.000028
count total (s) self (s)
1 0.023363 0.000026 return substitute(s:exec(['go', 'env', 'GOMOD'])[0], '\n', '', 'g')
FUNCTION airline#extensions#keymap#status()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/keymap.vim line 10
Called 16 times
Total time: 0.000226
Self time: 0.000226
count total (s) self (s)
16 0.000122 if (get(g:, 'airline#extensions#keymap#enabled', 1) && has('keymap'))
16 0.000089 return printf('%s', (!empty(&keymap) ? (g:airline_symbols.keymap . ' '. &keymap) : ''))
else
return ''
endif
FUNCTION go#path#CheckBinPath()
Defined: ~/.vim/plugged/vim-go/autoload/go/path.vim line 147
Called 2 times
Total time: 0.001008
Self time: 0.000377
count total (s) self (s)
" remove whitespaces if user applied something like 'goimports '
2 0.000059 let binpath = substitute(a:binpath, '^\s*\(.\{-}\)\s*$', '\1', '')
" save original path
2 0.000010 let old_path = $PATH
" check if we have an appropriate bin_path
2 0.000440 0.000022 let go_bin_path = go#path#BinPath()
2 0.000006 if !empty(go_bin_path)
" append our GOBIN and GOPATH paths and be sure they can be found there...
" let us search in our GOBIN and GOPATH paths
" respect the ordering specified by go_search_bin_path_first
2 0.000038 0.000029 if go#config#SearchBinPathFirst()
2 0.000139 0.000040 let $PATH = go_bin_path . go#util#PathListSep() . $PATH
else
let $PATH = $PATH . go#util#PathListSep() . go_bin_path
2 0.000001 endif
2 0.000002 endif
" if it's in PATH just return it
2 0.000056 if executable(binpath)
2 0.000007 if exists('*exepath')
2 0.000024 let binpath = exepath(binpath)
2 0.000003 endif
2 0.000041 let $PATH = old_path
2 0.000146 0.000041 if go#util#IsUsingCygwinShell() == 1
return s:CygwinPath(binpath)
2 0.000001 endif
2 0.000003 return binpath
endif
" just get the basename
let basename = fnamemodify(binpath, ":t")
if !executable(basename)
call go#util#EchoError(printf("could not find '%s'. Run :GoInstallBinaries to fix it", basename))
" restore back!
let $PATH = old_path
return ""
endif
let $PATH = old_path
if go#util#IsUsingCygwinShell() == 1
return s:CygwinPath(a:binpath)
endif
return go_bin_path . go#util#PathSep() . basename
FUNCTION go#complete#Complete()
Defined: ~/.vim/plugged/vim-go/autoload/go/complete.vim line 227
Called 2 times
Total time: 0.264205
Self time: 0.000102
count total (s) self (s)
"findstart = 1 when we need to get the text length
2 0.000008 if a:findstart == 1
1 0.264147 0.000044 execute "silent let s:completions = " . s:gocodeAutocomplete()
1 0.000009 return col('.') - s:completions[0] - 1
"findstart = 0 when we need to return the list of completions
1 0.000001 else
1 0.000007 let s = getline(".")[col('.') - 1]
1 0.000010 if s =~ '[(){}\{\}]'
return map(copy(s:completions[1]), 's:trim_bracket(v:val)')
1 0.000001 endif
1 0.000003 return s:completions[1]
endif
FUNCTION go#util#Exec()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 175
Called 1 time
Total time: 0.202995
Self time: 0.000052
count total (s) self (s)
1 0.000004 if len(a:cmd) == 0
call go#util#EchoError("go#util#Exec() called with empty a:cmd")
return ['', 1]
1 0.000001 endif
1 0.000003 let l:bin = a:cmd[0]
" Lookup the full path, respecting settings such as 'go_bin_path'. On errors,
" CheckBinPath will show a warning for us.
1 0.000350 0.000008 let l:bin = go#path#CheckBinPath(l:bin)
1 0.000002 if empty(l:bin)
return ['', 1]
1 0.000001 endif
" Finally execute the command using the full, resolved path. Do not pass the
" unmodified command as the correct program might not exist in $PATH.
1 0.202624 0.000023 return call('s:exec', [[l:bin] + a:cmd[1:]] + a:000)
FUNCTION airline#extensions#fugitiveline#bufname()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/fugitiveline.vim line 17
Called 16 times
Total time: 0.000553
Self time: 0.000553
count total (s) self (s)
16 0.000052 if !exists('b:fugitive_name')
let b:fugitive_name = ''
try
if bufname('%') =~? '^fugitive:' && exists('*FugitiveReal')
let b:fugitive_name = FugitiveReal(bufname('%'))
elseif exists('b:git_dir')
let buffer = fugitive#buffer()
if buffer.type('blob')
let b:fugitive_name = buffer.repo().translate(buffer.path('/'))
endif
endif
catch
endtry
16 0.000020 endif
16 0.000030 if empty(b:fugitive_name)
16 0.000140 return fnamemodify(bufname('%'), s:fmod)
else
return fnamemodify(b:fugitive_name, s:fmod)
endif
FUNCTION airline#util#wrap()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 27
Called 96 times
Total time: 0.000517
Self time: 0.000517
count total (s) self (s)
96 0.000227 if a:minwidth > 0 && winwidth(0) < a:minwidth
return ''
96 0.000049 endif
96 0.000105 return a:text
FUNCTION FugitiveGitDir()
Defined: ~/.vim/plugged/vim-fugitive/plugin/fugitive.vim line 11
Called 16 times
Total time: 0.000104
Self time: 0.000104
count total (s) self (s)
16 0.000032 if !a:0 || a:1 ==# -1
16 0.000053 return get(b:, 'git_dir', '')
elseif type(a:1) == type(0)
return getbufvar(a:1, 'git_dir')
elseif type(a:1) == type('')
return substitute(s:Slash(a:1), '/$', '', '')
else
return ''
endif
FUNCTION airline#extensions#whitespace#check()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/whitespace.vim line 50
Called 16 times
Total time: 0.001754
Self time: 0.001534
count total (s) self (s)
16 0.000065 let max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000)
16 0.000086 if &readonly || !&modifiable || !s:enabled || line('$') > max_lines || get(b:, 'airline_whitespace_disabled', 0)
return ''
16 0.000008 endif
16 0.000091 let skip_check_ft = extend(s:skip_check_ft, get(g:, 'airline#extensions#whitespace#skip_indent_check_ft', {}), 'force')
16 0.000045 if !exists('b:airline_whitespace_check')
let b:airline_whitespace_check = ''
let checks = get(b:, 'airline_whitespace_checks', get(g:, 'airline#extensions#whitespace#checks', s:default_checks))
let trailing = 0
let check = 'trailing'
if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0
try
let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$')
let trailing = search(regexp, 'nw')
catch
echomsg 'airline#whitespace: error occurred evaluating '. regexp
echomsg v:exception
return ''
endtry
endif
let mixed = 0
let check = 'indent'
if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0
let mixed = s:check_mixed_indent()
endif
let mixed_file = ''
let check = 'mixed-indent-file'
if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0
let mixed_file = s:check_mixed_indent_file()
endif
let long = 0
if index(checks, 'long') > -1 && &tw > 0
let long = search('\%>'.&tw.'v.\+', 'nw')
endif
if trailing != 0 || mixed != 0 || long != 0 || !empty(mixed_file)
let b:airline_whitespace_check = s:symbol
if strlen(s:symbol) > 0
let space = (g:airline_symbols.space)
else
let space = ''
endif
if s:show_message
if trailing != 0
let trailing_fmt = get(g:, 'airline#extensions#whitespace#trailing_format', '[%s]trailing')
let b:airline_whitespace_check .= space.printf(trailing_fmt, trailing)
endif
if mixed != 0
let mixed_indent_fmt = get(g:, 'airline#extensions#whitespace#mixed_indent_format', '[%s]mixed-indent')
let b:airline_whitespace_check .= space.printf(mixed_indent_fmt, mixed)
endif
if long != 0
let long_fmt = get(g:, 'airline#extensions#whitespace#long_format', '[%s]long')
let b:airline_whitespace_check .= space.printf(long_fmt, long)
endif
if !empty(mixed_file)
let mixed_indent_file_fmt = get(g:, 'airline#extensions#whitespace#mixed_indent_file_format', '[%s]mix-indent-file')
let b:airline_whitespace_check .= space.printf(mixed_indent_file_fmt, mixed_file)
endif
endif
endif
16 0.000006 endif
16 0.000339 0.000119 return airline#util#shorten(b:airline_whitespace_check, 120, 9)
FUNCTION <SNR>97_gocodeCommand()
Defined: ~/.vim/plugged/vim-go/autoload/go/complete.vim line 1
Called 1 time
Total time: 0.034674
Self time: 0.010221
count total (s) self (s)
1 0.000003 let l:gocode_bin = "gocode"
1 0.023374 0.000009 let l:gomod = go#util#gomod()
1 0.000015 if filereadable(l:gomod)
" Save the file when in module mode so that go list can read the
" imports. If the user doesn't have autowrite or autorwriteall enabled,
" they'll need to write the file manually to get reliable results.
" See https://github.com/fatih/vim-go/pull/1988#issuecomment-428576989.
"
" TODO(bc): don't save the file when in module mode once
" golang.org/x/tools/go/packages has support for an overlay and it's used
" by gocode.
1 0.009717 noa w
1 0.000029 0.000022 set modified
1 0.000010 let l:gocode_bin = "gocode-gomod"
1 0.000002 endif
1 0.001373 0.000313 let bin_path = go#path#CheckBinPath(l:gocode_bin)
1 0.000003 if empty(bin_path)
return []
1 0.000001 endif
1 0.000023 0.000016 let socket_type = go#config#GocodeSocketType()
1 0.000002 let cmd = [bin_path]
1 0.000005 let cmd = extend(cmd, ['-sock', socket_type])
1 0.000004 let cmd = extend(cmd, ['-f', 'vim'])
1 0.000025 0.000020 if go#config#GocodeProposeBuiltins()
1 0.000005 let cmd = extend(cmd, ['-builtin'])
1 0.000001 endif
1 0.000013 0.000009 if go#config#GocodeProposeSource()
1 0.000004 let cmd = extend(cmd, ['-source'])
else
let cmd = extend(cmd, ['-fallback-to-source'])
1 0.000001 endif
1 0.000021 0.000016 if go#config#GocodeUnimportedPackages()
let cmd = extend(cmd, ['-unimported-packages'])
1 0.000001 endif
1 0.000005 let cmd = extend(cmd, [a:cmd])
1 0.000006 let cmd = extend(cmd, a:args)
1 0.000004 return cmd
FUNCTION go#util#PathListSep()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 10
Called 4 times
Total time: 0.000221
Self time: 0.000042
count total (s) self (s)
4 0.000204 0.000025 if go#util#IsWin()
return ";"
4 0.000003 endif
4 0.000004 return ":"
FUNCTION <SNR>88_Get()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 156
Called 308 times
Total time: 0.001469
Self time: 0.001469
count total (s) self (s)
308 0.000613 let res=get(a:dict, a:key, '')
308 0.000251 if res is ''
118 0.000070 return ''
190 0.000091 else
190 0.000226 return a:prefix. res
endif
FUNCTION <SNR>81_update_branch()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 153
Called 16 times
Total time: 0.004665
Self time: 0.001118
count total (s) self (s)
48 0.000150 for vcs in keys(s:vcs_config)
32 0.004050 0.000503 call {s:vcs_config[vcs].update_branch}()
32 0.000126 if b:buffer_vcs_config[vcs].branch != s:vcs_config[vcs].branch
let b:buffer_vcs_config[vcs].branch = s:vcs_config[vcs].branch
unlet! b:airline_head
32 0.000022 endif
48 0.000052 endfor
FUNCTION go#config#GocodeProposeBuiltins()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 147
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000005 return get(g:, 'go_gocode_propose_builtins', 1)
FUNCTION go#util#Offset()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 269
Called 1 time
Total time: 0.000025
Self time: 0.000025
count total (s) self (s)
1 0.000003 if &encoding != 'utf-8'
let sep = go#util#LineEnding()
let buf = a:line == 1 ? '' : (join(getline(1, a:line-1), sep) . sep)
let buf .= a:col == 1 ? '' : getline('.')[:a:col-2]
return len(iconv(buf, &encoding, 'utf-8'))
1 0.000001 endif
1 0.000007 return line2byte(a:line) + (a:col-2)
FUNCTION FugitiveHead()
Defined: ~/.vim/plugged/vim-fugitive/plugin/fugitive.vim line 79
Called 16 times
Total time: 0.001698
Self time: 0.000356
count total (s) self (s)
16 0.000274 0.000170 let dir = FugitiveGitDir(a:0 > 1 ? a:2 : -1)
16 0.000029 if empty(dir)
return ''
16 0.000010 endif
16 0.001355 0.000117 return fugitive#Head(a:0 ? a:1 : 0, dir)
FUNCTION airline#highlighter#highlight()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 219
Called 2 times
Total time: 0.031694
Self time: 0.003834
count total (s) self (s)
2 0.000004 let bufnr = a:0 ? a:1 : ''
2 0.000008 let p = g:airline#themes#{g:airline_theme}#palette
" draw the base mode, followed by any overrides
2 0.000026 let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val')
2 0.000005 let suffix = a:modes[0] == 'inactive' ? '_inactive' : ''
6 0.000010 for mode in mapped
4 0.000019 if exists('g:airline#themes#{g:airline_theme}#palette[mode]')
4 0.000011 let dict = g:airline#themes#{g:airline_theme}#palette[mode]
36 0.000068 for kvp in items(dict)
32 0.000060 let mode_colors = kvp[1]
32 0.000048 let name = kvp[0]
32 0.000073 if name is# 'airline_c' && !empty(bufnr) && suffix is# '_inactive'
let name = 'airline_c'.bufnr
32 0.000019 endif
32 0.006680 0.000267 call airline#highlighter#exec(name.suffix, mode_colors)
96 0.000161 for accent in keys(s:accents)
64 0.000129 if !has_key(p.accents, accent)
continue
64 0.000034 endif
64 0.000167 let colors = copy(mode_colors)
64 0.000166 if p.accents[accent][0] != ''
32 0.000076 let colors[0] = p.accents[accent][0]
64 0.000032 endif
64 0.000093 if p.accents[accent][2] != ''
32 0.000065 let colors[2] = p.accents[accent][2]
64 0.000031 endif
64 0.000082 if len(colors) >= 5
64 0.000167 let colors[4] = get(p.accents[accent], 4, '')
else
call add(colors, get(p.accents[accent], 4, ''))
64 0.000031 endif
64 0.013279 0.000570 call airline#highlighter#exec(name.suffix.'_'.accent, colors)
96 0.000064 endfor
36 0.000015 endfor
" TODO: optimize this
28 0.000042 for sep in items(s:separators)
24 0.008987 0.000249 call <sid>exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix)
28 0.000014 endfor
4 0.000004 endif
6 0.000002 endfor
FUNCTION airline#parts#ffenc()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 105
Called 16 times
Total time: 0.000550
Self time: 0.000550
count total (s) self (s)
16 0.000052 let expected = get(g:, 'airline#parts#ffenc#skip_expected_string', '')
16 0.000029 let bomb = &l:bomb ? '[BOM]' : ''
16 0.000215 let ff = strlen(&ff) ? '['.&ff.']' : ''
16 0.000115 if expected is# &fenc.bomb.ff
return ''
16 0.000008 else
16 0.000099 return &fenc.bomb.ff
endif
FUNCTION <SNR>81_update_git_branch()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 83
Called 16 times
Total time: 0.002344
Self time: 0.000566
count total (s) self (s)
16 0.000217 0.000137 if !airline#util#has_fugitive()
let s:vcs_config['git'].branch = ''
return
16 0.000009 endif
16 0.001896 0.000198 let s:vcs_config['git'].branch = exists("*FugitiveHead") ? FugitiveHead(s:sha1size) : fugitive#head(s:sha1size)
16 0.000061 if s:vcs_config['git'].branch is# 'master' && winwidth(0) < 81
" Shorten default a bit
let s:vcs_config['git'].branch='mas'
16 0.000054 endif
FUNCTION airline#util#ignore_buf()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 101
Called 16 times
Total time: 0.000376
Self time: 0.000376
count total (s) self (s)
16 0.000102 let pat = '\c\v'. get(g:, 'airline#ignore_bufadd_pat', ''). get(g:, 'airline#extensions#tabline#ignore_bufadd_pat', 'gundo|undotree|vimfiler|tagbar|nerd_tree|startify|!')
16 0.000258 return match(a:name, pat) > -1
FUNCTION airline#parts#paste()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 63
Called 16 times
Total time: 0.000087
Self time: 0.000087
count total (s) self (s)
16 0.000080 return g:airline_detect_paste && &paste ? g:airline_symbols.paste : ''
FUNCTION go#util#GetLines()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 378
Called 1 time
Total time: 0.000022
Self time: 0.000022
count total (s) self (s)
1 0.000012 let buf = getline(1, '$')
1 0.000002 if &encoding != 'utf-8'
let buf = map(buf, 'iconv(v:val, &encoding, "utf-8")')
1 0.000000 endif
1 0.000001 if &l:fileformat == 'dos'
" XXX: line2byte() depend on 'fileformat' option.
" so if fileformat is 'dos', 'buf' must include '\r'.
let buf = map(buf, 'v:val."\r"')
1 0.000001 endif
1 0.000001 return buf
FUNCTION airline#parts#readonly()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 88
Called 16 times
Total time: 0.000749
Self time: 0.000373
count total (s) self (s)
" only consider regular buffers (e.g. ones that represent actual files,
" but not special ones like e.g. NERDTree)
16 0.000611 0.000235 if !empty(&buftype) || airline#util#ignore_buf(bufname('%'))
return ''
16 0.000010 endif
16 0.000036 if &readonly && !filereadable(bufname('%'))
return '[noperm]'
16 0.000011 else
16 0.000025 return &readonly ? g:airline_symbols.readonly : ''
endif
FUNCTION fugitive#Head()
Defined: ~/.vim/plugged/vim-fugitive/autoload/fugitive.vim line 293
Called 16 times
Total time: 0.001238
Self time: 0.001238
count total (s) self (s)
16 0.000046 let dir = a:0 > 1 ? a:2 : get(b:, 'git_dir', '')
16 0.000464 if empty(dir) || !filereadable(dir . '/HEAD')
return ''
16 0.000011 endif
16 0.000294 let head = readfile(dir . '/HEAD')[0]
16 0.000126 if head =~# '^ref: '
16 0.000244 return substitute(head, '\C^ref: \%(refs/\%(heads/\|remotes/\|tags/\)\=\)\=', '', '')
elseif head =~# '^\x\{40\}$'
let len = a:0 ? a:1 : 0
return len < 0 ? head : len ? head[0:len-1] : ''
else
return ''
endif
FUNCTION UltiSnips#TrackChange()
Defined: ~/.vim/plugged/ultisnips/autoload/UltiSnips.vim line 146
Called 7 times
Total time: 0.017601
Self time: 0.017601
count total (s) self (s)
7 0.017586 exec g:_uspy "UltiSnips_Manager._track_change()"
FUNCTION <SNR>33_on_window_changed()
Defined: ~/.vim/plugged/vim-airline/plugin/airline.vim line 39
Called 1 time
Total time: 0.000104
Self time: 0.000104
count total (s) self (s)
1 0.000014 let s:active_winnr = winnr()
1 0.000007 if pumvisible() && (!&previewwindow || g:airline_exclude_preview)
return
1 0.000002 endif
" Handle each window only once, since we might come here several times for
" different autocommands.
1 0.000028 let l:key = [bufnr('%'), s:active_winnr, winnr('$'), tabpagenr(), &ft]
1 0.000039 if get(g:, 'airline_last_window_changed', []) == l:key && &stl is# '%!airline#statusline('.s:active_winnr.')' && &ft !~? 'gitcommit'
" fugitive is special, it changes names and filetypes several times,
" make sure the caching does not get into its way
1 0.000003 return
endif
let g:airline_last_window_changed = l:key
call s:init()
call airline#update_statusline()
FUNCTION <SNR>88_exec_separator()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 165
Called 24 times
Total time: 0.008738
Self time: 0.000803
count total (s) self (s)
24 0.000033 if pumvisible()
return
24 0.000009 endif
24 0.000051 let group = a:from.'_to_'.a:to.a:suffix
24 0.002385 0.000159 let l:from = airline#themes#get_highlight(a:from.a:suffix)
24 0.002137 0.000153 let l:to = airline#themes#get_highlight(a:to.a:suffix)
24 0.000016 if a:inverse
8 0.000031 let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ]
16 0.000008 else
16 0.000053 let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ]
24 0.000008 endif
24 0.000050 let a:dict[group] = colors
24 0.003887 0.000162 call airline#highlighter#exec(group, colors)
FUNCTION airline#highlighter#exec()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 92
Called 122 times
Total time: 0.023479
Self time: 0.008042
count total (s) self (s)
122 0.000175 if pumvisible()
return
122 0.000048 endif
122 0.000146 let colors = a:colors
122 0.000111 if s:is_win32term
let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, ''))
let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, ''))
122 0.000060 endif
122 0.012150 0.001017 let old_hi = airline#highlighter#get_highlight(a:group)
122 0.000190 if len(colors) == 4
33 0.000062 call add(colors, '')
122 0.000066 endif
122 0.000121 if g:airline_gui_mode ==# 'gui'
let new_hi = [colors[0], colors[1], '', '', colors[4]]
122 0.000049 else
122 0.000647 let new_hi = ['', '', printf("%s", colors[2]), printf("%s", colors[3]), colors[4]]
122 0.000066 endif
122 0.003037 0.000773 let colors = s:CheckDefined(colors)
122 0.001240 0.000669 if old_hi != new_hi || !s:hl_group_exists(a:group)
44 0.002792 0.001323 let cmd = printf('hi %s %s %s %s %s %s %s %s', a:group, s:Get(colors, 0, 'guifg='), s:Get(colors, 1, 'guibg='), s:Get(colors, 2, 'ctermfg='), s:Get(colors, 3, 'ctermbg='), s:Get(colors, 4, 'gui='), s:Get(colors, 4, 'cterm='), s:Get(colors, 4, 'term='))
44 0.000363 exe cmd
44 0.000097 if has_key(s:hl_groups, a:group)
44 0.000085 let s:hl_groups[a:group] = colors
44 0.000017 endif
122 0.000054 endif
FUNCTION GoIndent()
Defined: ~/.vim/plugged/vim-go/indent/go.vim line 27
Called 1 time
Total time: 0.000229
Self time: 0.000229
count total (s) self (s)
1 0.000027 let prevlnum = prevnonblank(a:lnum-1)
1 0.000004 if prevlnum == 0
" top of file
return 0
1 0.000002 endif
" grab the previous and current line, stripping comments.
1 0.000018 let prevl = substitute(getline(prevlnum), '//.*$', '', '')
1 0.000007 let thisl = substitute(getline(a:lnum), '//.*$', '', '')
1 0.000005 let previ = indent(prevlnum)
1 0.000002 let ind = previ
3 0.000041 for synid in synstack(a:lnum, 1)
2 0.000010 if synIDattr(synid, 'name') == 'goRawString'
if prevl =~ '\%(\%(:\?=\)\|(\|,\)\s*`[^`]*$'
" previous line started a multi-line raw string
return 0
endif
" return -1 to keep the current indent.
return -1
2 0.000002 endif
3 0.000003 endfor
1 0.000011 if prevl =~ '[({]\s*$'
" previous line opened a block
let ind += shiftwidth()
1 0.000001 endif
1 0.000010 if prevl =~# '^\s*\(case .*\|default\):$'
" previous line is part of a switch statement
let ind += shiftwidth()
1 0.000001 endif
" TODO: handle if the previous line is a label.
1 0.000019 if thisl =~ '^\s*[)}]'
" this line closed a block
let ind -= shiftwidth()
1 0.000001 endif
" Colons are tricky.
" We want to outdent if it's part of a switch ("case foo:" or "default:").
" We ignore trying to deal with jump labels because (a) they're rare, and
" (b) they're hard to disambiguate from a composite literal key.
1 0.000007 if thisl =~# '^\s*\(case .*\|default\):$'
let ind -= shiftwidth()
1 0.000001 endif
1 0.000002 return ind
FUNCTION go#util#ShellError()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 206
Called 4 times
Total time: 0.000011
Self time: 0.000011
count total (s) self (s)
4 0.000008 return v:shell_error
FUNCTION go#path#Default()
Defined: ~/.vim/plugged/vim-go/autoload/go/path.vim line 39
Called 2 times
Total time: 0.000015
Self time: 0.000015
count total (s) self (s)
2 0.000003 if $GOPATH == ""
" use default GOPATH via go env
return go#util#env("gopath")
2 0.000002 endif
2 0.000002 return $GOPATH
FUNCTION airline#parts#spell()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 67
Called 16 times
Total time: 0.000451
Self time: 0.000451
count total (s) self (s)
16 0.000207 let spelllang = g:airline_detect_spelllang ? printf(" [%s]", toupper(substitute(&spelllang, ',', '/', 'g'))) : ''
16 0.000035 if g:airline_detect_spell && &spell
if winwidth(0) >= 90
return g:airline_symbols.spell . spelllang
elseif winwidth(0) >= 70
return g:airline_symbols.spell
else
return split(g:airline_symbols.spell, '\zs')[0]
endif
16 0.000011 endif
16 0.000017 return ''
FUNCTION <SNR>53_Highlight_Matching_Pair()
Defined: ~/usr/vim/share/vim/vim81/plugin/matchparen.vim line 39
Called 14 times
Total time: 0.002797
Self time: 0.002797
count total (s) self (s)
" Remove any previous match.
14 0.000112 if exists('w:paren_hl_on') && w:paren_hl_on
1 0.000008 silent! call matchdelete(3)
1 0.000004 let w:paren_hl_on = 0
14 0.000018 endif
" Avoid that we remove the popup menu.
" Return when there are no colors (looks like the cursor jumps).
14 0.000098 if pumvisible() || (&t_Co < 8 && !has("gui_running"))
return
14 0.000012 endif
" Get the character under the cursor and check if it's in 'matchpairs'.
14 0.000060 let c_lnum = line('.')
14 0.000052 let c_col = col('.')
14 0.000025 let before = 0
14 0.000052 let text = getline(c_lnum)
14 0.000337 let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)')
14 0.000048 if empty(matches)
let [c_before, c] = ['', '']
14 0.000019 else
14 0.000090 let [c_before, c] = matches[1:2]
14 0.000014 endif
14 0.000297 let plist = split(&matchpairs, '.\zs[:,]')
14 0.000062 let i = index(plist, c)
14 0.000022 if i < 0
" not found, in Insert mode try character before the cursor
13 0.000066 if c_col > 1 && (mode() == 'i' || mode() == 'R')
8 0.000029 let before = strlen(c_before)
8 0.000013 let c = c_before
8 0.000021 let i = index(plist, c)
13 0.000012 endif
13 0.000017 if i < 0
" not found, nothing to do
13 0.000052 return
endif
1 0.000001 endif
" Figure out the arguments for searchpairpos().
1 0.000001 if i % 2 == 0
let s_flags = 'nW'
let c2 = plist[i + 1]
1 0.000001 else
1 0.000003 let s_flags = 'nbW'
1 0.000002 let c2 = c
1 0.000004 let c = plist[i - 1]
1 0.000001 endif
1 0.000002 if c == '['
let c = '\['
let c2 = '\]'
1 0.000000 endif
" Find the match. When it was just before the cursor move it there for a
" moment.
1 0.000002 if before > 0
let has_getcurpos = exists("*getcurpos")
if has_getcurpos
" getcurpos() is more efficient but doesn't exist before 7.4.313.
let save_cursor = getcurpos()
else
let save_cursor = winsaveview()
endif
call cursor(c_lnum, c_col - before)
1 0.000001 endif
1 0.000011 if !has("syntax") || !exists("g:syntax_on")
let s_skip = "0"
1 0.000001 else
" Build an expression that detects whether the current cursor position is
" in certain syntax types (string, comment, etc.), for use as
" searchpairpos()'s skip argument.
" We match "escape" for special items, such as lispEscapeSpecial.
1 0.000006 let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))'
" If executing the expression determines that the cursor is currently in
" one of the syntax types, then we want searchpairpos() to find the pair
" within those syntax types (i.e., not skip). Otherwise, the cursor is
" outside of the syntax types and s_skip should keep its value so we skip
" any matching pair inside the syntax types.
" Catch if this throws E363: pattern uses more memory than 'maxmempattern'.
1 0.000002 try
1 0.000133 execute 'if ' . s_skip . ' | let s_skip = "0" | endif'
catch /^Vim\%((\a\+)\)\=:E363/
" We won't find anything, so skip searching, should keep Vim responsive.
return
1 0.000001 endtry
1 0.000001 endif
" Limit the search to lines visible in the window.
1 0.000005 let stoplinebottom = line('w$')
1 0.000005 let stoplinetop = line('w0')
1 0.000002 if i % 2 == 0
let stopline = stoplinebottom
1 0.000001 else
1 0.000004 let stopline = stoplinetop
1 0.000001 endif
" Limit the search time to 300 msec to avoid a hang on very long lines.
" This fails when a timeout is not supported.
1 0.000005 if mode() == 'i' || mode() == 'R'
let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout
1 0.000001 else
1 0.000007 let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout
1 0.000001 endif
1 0.000001 try
1 0.000571 let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout)
catch /E118/
" Can't use the timeout, restrict the stopline a bit more to avoid taking
" a long time on closed folds and long lines.
" The "viewable" variables give a range in which we can scroll while
" keeping the cursor at the same position.
" adjustedScrolloff accounts for very large numbers of scrolloff.
let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2])
let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2])
let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2])
" one of these stoplines will be adjusted below, but the current values are
" minimal boundaries within the current window
if i % 2 == 0
if has("byte_offset") && has("syntax_items") && &smc > 0
let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
let stopline = min([bottom_viewable, byte2line(stopbyte)])
else
let stopline = min([bottom_viewable, c_lnum + 100])
endif
let stoplinebottom = stopline
else
if has("byte_offset") && has("syntax_items") && &smc > 0
let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
let stopline = max([top_viewable, byte2line(stopbyte)])
else
let stopline = max([top_viewable, c_lnum - 100])
endif
let stoplinetop = stopline
endif
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
1 0.000001 endtry
1 0.000001 if before > 0
if has_getcurpos
call setpos('.', save_cursor)
else
call winrestview(save_cursor)
endif
1 0.000000 endif
" If a match is found setup match highlighting.
1 0.000003 if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom
1 0.000003 if exists('*matchaddpos')
1 0.000021 call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3)
else
exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
1 0.000001 endif
1 0.000002 let w:paren_hl_on = 1
1 0.000001 endif
FUNCTION go#config#GocodeProposeSource()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 151
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000004 return get(g:, 'go_gocode_propose_source', 1)
FUNCTION <SNR>98_exec()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 195
Called 3 times
Total time: 0.249221
Self time: 0.000208
count total (s) self (s)
3 0.000009 let l:bin = a:cmd[0]
3 0.000141 0.000028 let l:cmd = go#util#Shelljoin([l:bin] + a:cmd[1:])
3 0.000077 0.000030 if go#util#HasDebug('shell-commands')
call go#util#EchoInfo('shell command: ' . l:cmd)
3 0.000002 endif
3 0.248895 0.000052 let l:out = call('s:system', [l:cmd] + a:000)
3 0.000083 0.000073 return [l:out, go#util#ShellError()]
FUNCTION airline#parts#crypt()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 59
Called 16 times
Total time: 0.000109
Self time: 0.000109
count total (s) self (s)
16 0.000099 return g:airline_detect_crypt && exists("+key") && !empty(&key) ? g:airline_symbols.crypt : ''
FUNCTION airline#extensions#branch#head()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 210
Called 16 times
Total time: 0.006862
Self time: 0.000590
count total (s) self (s)
16 0.000070 if !exists('b:buffer_vcs_config')
call s:init_buffer()
16 0.000012 endif
16 0.004838 0.000173 call s:update_branch()
16 0.001772 0.000165 call s:update_untracked()
16 0.000061 if exists('b:airline_head') && !empty(b:airline_head)
16 0.000021 return b:airline_head
endif
let b:airline_head = ''
let vcs_priority = get(g:, "airline#extensions#branch#vcs_priority", ["git", "mercurial"])
let heads = []
for vcs in vcs_priority
if !empty(b:buffer_vcs_config[vcs].branch)
let heads += [vcs]
endif
endfor
for vcs in heads
if !empty(b:airline_head)
let b:airline_head .= ' | '
endif
if len(heads) > 1
let b:airline_head .= s:vcs_config[vcs].exe .':'
endif
let b:airline_head .= s:format_name({s:vcs_config[vcs].display_branch}())
let b:airline_head .= b:buffer_vcs_config[vcs].untracked
endfor
if empty(heads)
if airline#util#has_vcscommand()
noa call VCSCommandEnableBufferSetup()
if exists('b:VCSCommandBufferInfo')
let b:airline_head = s:format_name(get(b:VCSCommandBufferInfo, 0, ''))
endif
endif
endif
if empty(heads)
if airline#util#has_custom_scm()
try
let Fn = function(g:airline#extensions#branch#custom_head)
let b:airline_head = Fn()
endtry
endif
endif
if exists("g:airline#extensions#branch#displayed_head_limit")
let w:displayed_head_limit = g:airline#extensions#branch#displayed_head_limit
if len(b:airline_head) > w:displayed_head_limit - 1
let b:airline_head = b:airline_head[0:(w:displayed_head_limit - 1)].(&encoding ==? 'utf-8' ? '…' : '.')
endif
endif
let minwidth = empty(get(b:, 'airline_hunks', '')) ? 14 : 7
let b:airline_head = airline#util#shorten(b:airline_head, 120, minwidth)
return b:airline_head
FUNCTION airline#parts#mode()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/parts.vim line 55
Called 16 times
Total time: 0.000512
Self time: 0.000203
count total (s) self (s)
16 0.000501 0.000192 return airline#util#shorten(get(w:, 'airline_current_mode', ''), 79, 1)
FUNCTION <SNR>88_get_syn()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 25
Called 340 times
Total time: 0.006360
Self time: 0.006360
count total (s) self (s)
340 0.000710 if !exists("g:airline_gui_mode")
let g:airline_gui_mode = airline#init#gui_mode()
340 0.000172 endif
340 0.000346 let color = ''
340 0.000557 if hlexists(a:group)
316 0.001047 let color = synIDattr(synIDtrans(hlID(a:group)), a:what, g:airline_gui_mode)
340 0.000176 endif
340 0.000529 if empty(color) || color == -1
" should always exists
24 0.000099 let color = synIDattr(synIDtrans(hlID('Normal')), a:what, g:airline_gui_mode)
" however, just in case
24 0.000036 if empty(color) || color == -1
12 0.000011 let color = 'NONE'
24 0.000007 endif
340 0.000134 endif
340 0.000291 return color
FUNCTION airline#util#has_fugitive()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 108
Called 16 times
Total time: 0.000080
Self time: 0.000080
count total (s) self (s)
16 0.000072 return exists('*fugitive#head') || exists('*FugitiveHead')
FUNCTION <SNR>45_Leave()
Defined: ~/.vim/plugged/vim-ragtag/plugin/ragtag.vim line 242
Called 1 time
Total time: 0.000079
Self time: 0.000032
count total (s) self (s)
1 0.000078 0.000031 call s:disableescape()
FUNCTION airline#statusline()
Defined: ~/.vim/plugged/vim-airline/autoload/airline.vim line 154
Called 16 times
Total time: 0.000353
Self time: 0.000353
count total (s) self (s)
16 0.000170 if has_key(s:contexts, a:winnr)
16 0.000150 return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line
endif
" in rare circumstances this happens...see #276
return ''
FUNCTION <SNR>88_hl_group_exists()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 83
Called 78 times
Total time: 0.000571
Self time: 0.000571
count total (s) self (s)
78 0.000140 if !hlexists(a:group)
return 0
78 0.000216 elseif empty(synIDattr(hlID(a:group), 'fg'))
return 0
78 0.000033 endif
78 0.000049 return 1
FUNCTION go#path#BinPath()
Defined: ~/.vim/plugged/vim-go/autoload/go/path.vim line 123
Called 2 times
Total time: 0.000418
Self time: 0.000267
count total (s) self (s)
2 0.000034 0.000020 let bin_path = go#config#BinPath()
2 0.000006 if bin_path != ""
return bin_path
2 0.000002 endif
" check if our global custom path is set, if not check if $GOBIN is set so
" we can use it, otherwise use default GOPATH
2 0.000007 if $GOBIN != ""
let bin_path = $GOBIN
2 0.000003 else
2 0.000192 0.000055 let go_paths = split(go#path#Default(), go#util#PathListSep())
2 0.000006 if len(go_paths) == 0
return "" "nothing found
2 0.000002 endif
2 0.000146 let bin_path = expand(go_paths[0] . "/bin/")
2 0.000003 endif
2 0.000003 return bin_path
FUNCTION go#util#OffsetCursor()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 280
Called 1 time
Total time: 0.000037
Self time: 0.000012
count total (s) self (s)
1 0.000036 0.000011 return go#util#Offset(line('.'), col('.'))
FUNCTION <SNR>97_sync_gocode()
Defined: ~/.vim/plugged/vim-go/autoload/go/complete.vim line 49
Called 1 time
Total time: 0.263241
Self time: 0.002144
count total (s) self (s)
" We might hit cache problems, as gocode doesn't handle different GOPATHs
" well. See: https://github.com/nsf/gocode/issues/239
1 0.000004 let old_goroot = $GOROOT
1 0.023442 0.000014 let $GOROOT = go#util#env("goroot")
1 0.000001 try
1 0.034700 0.000026 let cmd = s:gocodeCommand(a:cmd, a:args)
" gocode can sometimes be slow, so redraw now to avoid waiting for gocode
" to return before redrawing automatically.
1 0.002035 redraw
1 0.203020 0.000025 let [l:result, l:err] = go#util#Exec(cmd, a:input)
1 0.000001 finally
1 0.000008 let $GOROOT = old_goroot
1 0.000001 endtry
1 0.000002 if l:err != 0
return "[0, []]"
1 0.000000 endif
1 0.000003 if &encoding != 'utf-8'
let l:result = iconv(l:result, 'utf-8', &encoding)
1 0.000000 endif
1 0.000003 return l:result
FUNCTION go#config#GocodeUnimportedPackages()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 138
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000004 return get(g:, 'go_gocode_unimported_packages', 0)
FUNCTION <SNR>88_get_array()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 44
Called 170 times
Total time: 0.001053
Self time: 0.001053
count total (s) self (s)
170 0.000434 let opts=empty(a:opts) ? '' : join(a:opts, ',')
170 0.000560 return g:airline_gui_mode ==# 'gui' ? [ a:fg, a:bg, '', '', opts ] : [ '', '', a:fg, a:bg, opts ]
FUNCTION go#config#GocodeSocketType()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 143
Called 1 time
Total time: 0.000007
Self time: 0.000007
count total (s) self (s)
1 0.000006 return get(g:, 'go_gocode_socket_type', s:sock_type)
FUNCTION airline#util#has_lawrencium()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 112
Called 16 times
Total time: 0.000066
Self time: 0.000066
count total (s) self (s)
16 0.000058 return exists('*lawrencium#statusline')
FUNCTION airline#highlighter#get_highlight()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 55
Called 170 times
Total time: 0.014961
Self time: 0.007548
count total (s) self (s)
170 0.001580 let reverse = get(g:, 'airline_gui_mode', '') ==# 'gui' ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui') : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm')|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term')
170 0.000428 if get(g:, 'airline_highlighting_cache', 0) && has_key(s:hl_groups, a:group)
let res = s:hl_groups[a:group]
return reverse ? [ res[1], res[0], res[3], res[2], res[4] ] : res
170 0.000081 else
170 0.004337 0.001043 let fg = s:get_syn(a:group, 'fg')
170 0.003889 0.000823 let bg = s:get_syn(a:group, 'bg')
170 0.000465 let bold = synIDattr(synIDtrans(hlID(a:group)), 'bold')
170 0.000168 let opts = a:000
170 0.000123 if bold
26 0.000027 let opts = ['bold']
170 0.000085 endif
170 0.002282 0.001229 let res = reverse ? s:get_array(bg, fg, opts) : s:get_array(fg, bg, opts)
170 0.000085 endif
170 0.000482 let s:hl_groups[a:group] = res
170 0.000121 return res
FUNCTION airline#util#shorten()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 13
Called 32 times
Total time: 0.000529
Self time: 0.000529
count total (s) self (s)
32 0.000162 if winwidth(0) < a:winwidth && len(split(a:text, '\zs')) > a:minwidth
if get(a:000, 0, 0)
" shorten from tail
return '…'.matchstr(a:text, '.\{'.a:minwidth.'}$')
else
" shorten from beginning of string
return matchstr(a:text, '^.\{'.a:minwidth.'}').'…'
endif
32 0.000023 else
32 0.000042 return a:text
endif
FUNCTION airline#highlighter#highlight_modified_inactive()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/highlighter.vim line 205
Called 2 times
Total time: 0.000715
Self time: 0.000083
count total (s) self (s)
2 0.000008 if getbufvar(a:bufnr, '&modified')
2 0.000025 let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c') ? g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c : []
else
let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c') ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c : []
2 0.000001 endif
2 0.000003 if !empty(colors)
2 0.000661 0.000029 call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors)
2 0.000000 endif
FUNCTION airline#extensions#branch#get_head()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 273
Called 16 times
Total time: 0.007243
Self time: 0.000381
count total (s) self (s)
16 0.007003 0.000141 let head = airline#extensions#branch#head()
16 0.000055 let empty_message = get(g:, 'airline#extensions#branch#empty_message', '')
16 0.000061 let symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch)
16 0.000106 return empty(head) ? empty_message : printf('%s%s', empty(symbol) ? '' : symbol.(g:airline_symbols.space), head)
FUNCTION go#config#BinPath()
Defined: ~/.vim/plugged/vim-go/autoload/go/config.vim line 355
Called 2 times
Total time: 0.000014
Self time: 0.000014
count total (s) self (s)
2 0.000011 return get(g:, "go_bin_path", "")
FUNCTION airline#util#prepend()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/util.vim line 48
Called 32 times
Total time: 0.000193
Self time: 0.000193
count total (s) self (s)
32 0.000063 if a:minwidth > 0 && winwidth(0) < a:minwidth
return ''
32 0.000011 endif
32 0.000080 return empty(a:text) ? '' : a:text.s:spc.g:airline_right_alt_sep.s:spc
FUNCTION <SNR>45_disableescape()
Defined: ~/.vim/plugged/vim-ragtag/plugin/ragtag.vim line 513
Called 1 time
Total time: 0.000047
Self time: 0.000047
count total (s) self (s)
1 0.000006 if exists("b:ragtag_escape_mode")
if b:ragtag_escape_mode == "xml"
silent! iunmap <buffer> <BS>
silent! iunmap <buffer> <Lt>
silent! iunmap <buffer> >
silent! iunmap <buffer> &
silent! iunmap <buffer> "
elseif b:ragtag_escape_mode == "url"
silent! iunmap <buffer> <BS>
silent! iunmap <buffer> <Tab>
silent! iunmap <buffer> <CR>
silent! iunmap <buffer> <Space>
silent! iunmap <buffer> <Bar>
let i = 33
while i < 127
if nr2char(i) =~# '[|A-Za-z0-9_.~-]'
else
exe "silent! iunmap <buffer> ".nr2char(i)
endif
let i = i + 1
endwhile
endif
unlet b:ragtag_escape_mode
1 0.000001 endif
FUNCTION go#util#IsWin()
Defined: ~/.vim/plugged/vim-go/autoload/go/util.vim line 35
Called 9 times
Total time: 0.000369
Self time: 0.000369
count total (s) self (s)
9 0.000029 let win = ['win16', 'win32', 'win64', 'win95']
45 0.000055 for w in win
36 0.000132 if (has(w))
return 1
36 0.000021 endif
45 0.000034 endfor
9 0.000010 return 0
FUNCTION <SNR>81_update_untracked()
Defined: ~/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim line 172
Called 16 times
Total time: 0.001607
Self time: 0.001358
count total (s) self (s)
16 0.000206 let file = expand("%:p")
16 0.000079 if empty(file) || isdirectory(file)
return
16 0.000009 endif
16 0.000029 let needs_update = 1
48 0.000096 for vcs in keys(s:vcs_config)
32 0.000159 if file =~ s:vcs_config[vcs].exclude
" Skip check for files that live in the exclude directory
let needs_update = 0
32 0.000017 endif
32 0.000126 if has_key(s:vcs_config[vcs].untracked, file)
16 0.000023 let needs_update = 0
16 0.000500 0.000251 call airline#extensions#branch#update_untracked_config(file, vcs)
32 0.000025 endif
48 0.000031 endfor
16 0.000023 if !needs_update
16 0.000016 return
endif
for vcs in keys(s:vcs_config)
let config = s:vcs_config[vcs]
if g:airline#init#vim_async
" Note that asynchronous update updates s:vcs_config only, and only
" s:update_untracked updates b:buffer_vcs_config. If s:vcs_config is
" invalidated again before s:update_untracked is called, then we lose the
" result of the previous call, i.e. the head string is not updated. It
" doesn't happen often in practice, so we let it be.
noa call airline#async#vim_vcs_untracked(config, file)
else
" nvim async or vim without job-feature
noa call airline#async#nvim_vcs_untracked(config, file, vcs)
endif
endfor
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
2 0.264205 0.000102 go#complete#Complete()
1 0.264103 0.000278 <SNR>97_gocodeAutocomplete()
1 0.263241 0.002144 <SNR>97_sync_gocode()
3 0.249221 0.000208 <SNR>98_exec()
3 0.248843 0.000603 <SNR>98_system()
1 0.202995 0.000052 go#util#Exec()
1 0.034674 0.010221 <SNR>97_gocodeCommand()
16 0.034664 0.002157 airline#check_mode()
2 0.031694 0.003834 airline#highlighter#highlight()
122 0.023479 0.008042 airline#highlighter#exec()
1 0.023428 0.000118 go#util#env()
1 0.023365 0.000028 go#util#gomod()
1 0.023309 0.000026 go#util#goroot()
7 0.017601 UltiSnips#TrackChange()
170 0.014961 0.007548 airline#highlighter#get_highlight()
24 0.008738 0.000803 <SNR>88_exec_separator()
16 0.007243 0.000381 airline#extensions#branch#get_head()
16 0.006862 0.000590 airline#extensions#branch#head()
340 0.006360 <SNR>88_get_syn()
16 0.004665 0.001118 <SNR>81_update_branch()
FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
7 0.017601 UltiSnips#TrackChange()
1 0.034674 0.010221 <SNR>97_gocodeCommand()
122 0.023479 0.008042 airline#highlighter#exec()
170 0.014961 0.007548 airline#highlighter#get_highlight()
340 0.006360 <SNR>88_get_syn()
2 0.031694 0.003834 airline#highlighter#highlight()
14 0.002797 <SNR>53_Highlight_Matching_Pair()
122 0.002264 <SNR>88_CheckDefined()
16 0.034664 0.002157 airline#check_mode()
1 0.263241 0.002144 <SNR>97_sync_gocode()
16 0.001754 0.001534 airline#extensions#whitespace#check()
308 0.001469 <SNR>88_Get()
16 0.001607 0.001358 <SNR>81_update_untracked()
16 0.001238 fugitive#Head()
112 0.001173 airline#util#append()
16 0.001203 0.001137 <SNR>81_update_hg_branch()
16 0.004665 0.001118 <SNR>81_update_branch()
170 0.001053 <SNR>88_get_array()
24 0.008738 0.000803 <SNR>88_exec_separator()
3 0.248843 0.000603 <SNR>98_system()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment