Created
September 15, 2022 12:35
-
-
Save llinfeng/add25b090a3a052149b93a54ceddf2af to your computer and use it in GitHub Desktop.
Profiling Vimwiki Link Creation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SCRIPT /home/llinfeng/vimfiles/plugged/vimwiki/autoload/vimwiki/diary.vim | |
Sourced 1 time | |
Total time: 0.000560 | |
Self time: 0.000560 | |
count total (s) self (s) | |
" vim:tabstop=2:shiftwidth=2:expandtab:textwidth=99 | |
" Vimwiki autoload plugin file | |
" Description: Handle diary notes | |
" Home: https://github.com/vimwiki/vimwiki/ | |
" Clause: load only once | |
1 0.000023 if exists('g:loaded_vimwiki_diary_auto') || &compatible | |
finish | |
1 0.000001 endif | |
1 0.000004 let g:loaded_vimwiki_diary_auto = 1 | |
1 0.000005 function! s:prefix_zero(num) abort | |
" Add zero prefix to a number | |
if a:num < 10 | |
return '0'.a:num | |
endif | |
return a:num | |
endfunction | |
1 0.000002 function! s:diary_path(...) abort | |
" Return: diary directory path <String> | |
let idx = a:0 == 0 ? vimwiki#vars#get_bufferlocal('wiki_nr') : a:1 | |
return vimwiki#vars#get_wikilocal('path', idx).vimwiki#vars#get_wikilocal('diary_rel_path', idx) | |
endfunction | |
1 0.000002 function! s:diary_index(...) abort | |
" Return: diary index file path <String> | |
let idx = a:0 == 0 ? vimwiki#vars#get_bufferlocal('wiki_nr') : a:1 | |
return s:diary_path(idx).vimwiki#vars#get_wikilocal('diary_index', idx). | |
\ vimwiki#vars#get_wikilocal('ext', idx) | |
endfunction | |
1 0.000002 function! vimwiki#diary#diary_date_link(...) abort | |
" Return: <String> date | |
let wiki_nr = vimwiki#vars#get_bufferlocal('wiki_nr') | |
if wiki_nr < 0 " this happens when called outside a wiki buffer | |
let wiki_nr = 0 | |
endif | |
if wiki_nr >= vimwiki#vars#number_of_wikis() | |
call vimwiki#u#error('Wiki '.wiki_nr.' is not registered in g:vimwiki_list!') | |
return | |
endif | |
if a:0 | |
let l:timestamp = a:1 | |
else | |
let l:timestamp = localtime() | |
endif | |
let l:delta_periods = 0 | |
if a:0 > 1 | |
let l:delta_periods = a:2 | |
endif | |
let l:day_s = 60*60*24 | |
let l:weekday_number = { | |
\ 'monday': 1, 'tuesday': 2, | |
\ 'wednesday': 3, 'thursday': 4, | |
\ 'friday': 5, 'saturday': 6, | |
\ 'sunday': 0} | |
let l:frequency = vimwiki#vars#get_wikilocal('diary_frequency', wiki_nr) | |
if l:frequency ==? 'weekly' | |
let l:start_week_day = vimwiki#vars#get_wikilocal('diary_start_week_day', wiki_nr) | |
let l:weekday_num = str2nr(strftime('%w', l:timestamp)) | |
let l:days_to_end_of_week = (7-l:weekday_number[l:start_week_day]+weekday_num) % 7 | |
let l:computed_timestamp = l:timestamp | |
\ + 7*l:day_s*l:delta_periods | |
\ - l:day_s*l:days_to_end_of_week | |
elseif l:frequency ==? 'monthly' | |
let l:day_of_month = str2nr(strftime('%d', l:timestamp)) | |
let l:beginning_of_month = l:timestamp - (l:day_of_month - 1)*l:day_s | |
let l:middle_of_month = l:beginning_of_month + 15*l:day_s | |
let l:middle_of_computed_month = l:middle_of_month + float2nr(30.5*l:day_s*l:delta_periods) | |
let l:day_of_computed_month = str2nr(strftime('%d', l:middle_of_computed_month)) - 1 | |
let l:computed_timestamp = l:middle_of_computed_month - l:day_of_computed_month*l:day_s | |
elseif l:frequency ==? 'yearly' | |
let l:day_of_year = str2nr(strftime('%j', l:timestamp)) | |
let l:beginning_of_year = l:timestamp - (l:day_of_year - 1)*l:day_s | |
let l:middle_of_year = l:beginning_of_year + float2nr(365.25/2*l:day_s) | |
let l:middle_of_computed_year = l:middle_of_year + float2nr(365.25*l:day_s*l:delta_periods) | |
let l:day_of_computed_year = str2nr(strftime('%j', l:middle_of_computed_year)) - 1 | |
let l:computed_timestamp = l:middle_of_computed_year - l:day_of_computed_year*l:day_s | |
else "daily | |
let l:computed_timestamp = localtime() + l:delta_periods*l:day_s | |
endif | |
return strftime('%Y-%m-%d', l:computed_timestamp) | |
endfunction | |
1 0.000002 function! s:get_position_links(link) abort | |
" Return: <int:index, list:links> | |
let idx = -1 | |
let links = [] | |
if a:link =~# '^\d\{4}-\d\d-\d\d' | |
let links = map(vimwiki#diary#get_diary_files(), 'fnamemodify(v:val, ":t:r")') | |
" include 'today' into links | |
if index(links, vimwiki#diary#diary_date_link()) == -1 | |
call add(links, vimwiki#diary#diary_date_link()) | |
endif | |
call sort(links) | |
let idx = index(links, a:link) | |
endif | |
return [idx, links] | |
endfunction | |
1 0.000002 function! s:get_month_name(month) abort | |
" Convert month: number -> name | |
return vimwiki#vars#get_global('diary_months')[str2nr(a:month)] | |
endfunction | |
1 0.000004 function! s:get_first_header(fl) abort | |
" Get the first header in the file within the first s:vimwiki_max_scan_for_caption lines. | |
let header_rx = vimwiki#vars#get_syntaxlocal('rxHeader') | |
for line in readfile(a:fl, '', g:vimwiki_max_scan_for_caption) | |
if line =~# header_rx | |
return vimwiki#u#trim(matchstr(line, header_rx)) | |
endif | |
endfor | |
return '' | |
endfunction | |
1 0.000002 function! s:get_all_headers(fl, maxlevel) abort | |
" Get a list of all headers in a file up to a given level. | |
" Return: list whose elements are pairs [level, title] | |
let headers_rx = {} | |
for i in range(1, a:maxlevel) | |
let headers_rx[i] = vimwiki#vars#get_syntaxlocal('rxH'.i.'_Text') | |
endfor | |
let headers = [] | |
for line in readfile(a:fl, '') | |
for [i, header_rx] in items(headers_rx) | |
if line =~# header_rx | |
call add(headers, [i, vimwiki#u#trim(matchstr(line, header_rx))]) | |
break | |
endif | |
endfor | |
endfor | |
return headers | |
endfunction | |
1 0.000002 function! s:count_headers_level_less_equal(headers, maxlevel) abort | |
" Count headers with level <= maxlevel in a list of [level, title] pairs. | |
let l:count = 0 | |
for [header_level, _] in a:headers | |
if header_level <= a:maxlevel | |
let l:count += 1 | |
endif | |
endfor | |
return l:count | |
endfunction | |
1 0.000002 function! s:get_min_header_level(headers) abort | |
" Get the minimum level of any header in a list of [level, title] pairs. | |
if len(a:headers) == 0 | |
return 0 | |
endif | |
let minlevel = a:headers[0][0] | |
for [level, _] in a:headers | |
let minlevel = min([minlevel, level]) | |
endfor | |
return minlevel | |
endfunction | |
1 0.000002 function! s:read_captions(files) abort | |
" Read all cpation in 1. <List>files | |
" Return: <Dic>: key -> caption | |
let result = {} | |
let caption_level = vimwiki#vars#get_wikilocal('diary_caption_level') | |
for fl in a:files | |
" Remove paths and extensions | |
let fl_captions = {} | |
" Default; no captions from the file. | |
let fl_captions['top'] = '' | |
let fl_captions['rest'] = [] | |
if caption_level >= 0 && filereadable(fl) | |
if caption_level == 0 | |
" Take first header of any level as the top caption. | |
let fl_captions['top'] = s:get_first_header(fl) | |
else | |
let headers = s:get_all_headers(fl, caption_level) | |
if len(headers) > 0 | |
" If first header is the only one at its level or less, then make it the top caption. | |
let [first_level, first_header] = headers[0] | |
if s:count_headers_level_less_equal(headers, first_level) == 1 | |
let fl_captions['top'] = first_header | |
call remove(headers, 0) | |
endif | |
let min_header_level = s:get_min_header_level(headers) | |
for [level, header] in headers | |
call add(fl_captions['rest'], [level - min_header_level, header]) | |
endfor | |
endif | |
endif | |
endif | |
let fl_key = substitute(fnamemodify(fl, ':t'), vimwiki#vars#get_wikilocal('ext').'$', '', '') | |
let result[fl_key] = fl_captions | |
endfor | |
return result | |
endfunction | |
1 0.000002 function! vimwiki#diary#get_diary_files() abort | |
" Return: <list> diary file names | |
let rx = '^\d\{4}-\d\d-\d\d' | |
let s_files = glob(vimwiki#vars#get_wikilocal('path'). | |
\ vimwiki#vars#get_wikilocal('diary_rel_path').'*'.vimwiki#vars#get_wikilocal('ext')) | |
let files = split(s_files, '\n') | |
call filter(files, 'fnamemodify(v:val, ":t") =~# "'.escape(rx, '\').'"') | |
" remove backup files (.wiki~) | |
call filter(files, 'v:val !~# ''.*\~$''') | |
return files | |
endfunction | |
1 0.000001 function! s:group_links(links) abort | |
" Return: <dic> nested -> links | |
let result = {} | |
let p_year = 0 | |
let p_month = 0 | |
for fl in sort(keys(a:links)) | |
let year = strpart(fl, 0, 4) | |
let month = strpart(fl, 5, 2) | |
if p_year != year | |
let result[year] = {} | |
let p_month = 0 | |
endif | |
if p_month != month | |
let result[year][month] = {} | |
endif | |
let result[year][month][fl] = a:links[fl] | |
let p_year = year | |
let p_month = month | |
endfor | |
return result | |
endfunction | |
1 0.000002 function! s:sort(lst) abort | |
" Sort list | |
if vimwiki#vars#get_wikilocal('diary_sort') ==? 'desc' | |
return reverse(sort(a:lst)) | |
else | |
return sort(a:lst) | |
endif | |
endfunction | |
1 0.000002 function! vimwiki#diary#diary_sort(lst) abort | |
return s:sort(a:lst) | |
endfunction | |
1 0.000002 function! vimwiki#diary#make_note(wnum, ...) abort | |
" Create note | |
" The given wiki number a:wnum is 1 for the first wiki, 2 for the second and so on. This is in | |
" contrast to most other places, where counting starts with 0. When a:wnum is 0, the current wiki | |
" is used. | |
if a:wnum == 0 | |
let wiki_nr = vimwiki#vars#get_bufferlocal('wiki_nr') | |
if wiki_nr < 0 " this happens when e.g. VimwikiMakeDiaryNote was called outside a wiki buffer | |
let wiki_nr = 0 | |
endif | |
else | |
let wiki_nr = a:wnum - 1 | |
endif | |
if wiki_nr >= vimwiki#vars#number_of_wikis() | |
call vimwiki#u#error('Wiki '.wiki_nr.' is not registered in g:vimwiki_list!') | |
return | |
endif | |
call vimwiki#path#mkdir(vimwiki#vars#get_wikilocal('path', wiki_nr). | |
\ vimwiki#vars#get_wikilocal('diary_rel_path', wiki_nr)) | |
let cmd = 'edit' | |
if a:0 | |
if a:1 == 1 | |
let cmd = 'tabedit' | |
elseif a:1 == 2 | |
let cmd = 'split' | |
elseif a:1 == 3 | |
let cmd = 'vsplit' | |
elseif a:1 == 4 | |
let cmd = 'tab drop' | |
elseif a:1 == 5 | |
let cmd = 'drop' | |
if exists(':drop') | |
let cmd = 'drop' | |
endif | |
endif | |
endif | |
if a:0>1 | |
let link = 'diary:'.a:2 | |
else | |
let link = 'diary:'.vimwiki#diary#diary_date_link() | |
endif | |
call vimwiki#base#open_link(cmd, link, s:diary_index(wiki_nr)) | |
endfunction | |
1 0.000001 function! vimwiki#diary#goto_diary_index(wnum) abort | |
" Jump to diary index of 1. <Int> wikinumber | |
" if wnum = 0 the current wiki is used | |
if a:wnum == 0 | |
let idx = vimwiki#vars#get_bufferlocal('wiki_nr') | |
if idx < 0 " not in a wiki | |
let idx = 0 | |
endif | |
else | |
let idx = a:wnum - 1 " convert to 0 based counting | |
endif | |
if a:wnum > vimwiki#vars#number_of_wikis() | |
call vimwiki#u#error('Wiki '.a:wnum.' is not registered in g:vimwiki_list!') | |
return | |
endif | |
call vimwiki#base#edit_file('e', s:diary_index(idx), '') | |
if vimwiki#vars#get_wikilocal('auto_diary_index') | |
call vimwiki#diary#generate_diary_section() | |
write! " save changes | |
endif | |
endfunction | |
1 0.000002 function! vimwiki#diary#goto_next_day() abort | |
" Jump to next day | |
let link = '' | |
let [idx, links] = s:get_position_links(expand('%:t:r')) | |
if idx == (len(links) - 1) | |
return | |
endif | |
if idx != -1 && idx < len(links) - 1 | |
let link = 'diary:'.links[idx+1] | |
else | |
" goto today | |
let link = 'diary:'.vimwiki#diary#diary_date_link() | |
endif | |
if len(link) | |
call vimwiki#base#open_link(':e ', link) | |
endif | |
endfunction | |
1 0.000001 function! vimwiki#diary#goto_prev_day() abort | |
" Jump to previous day | |
let link = '' | |
let [idx, links] = s:get_position_links(expand('%:t:r')) | |
if idx == 0 | |
return | |
endif | |
if idx > 0 | |
let link = 'diary:'.links[idx-1] | |
else | |
" goto today | |
let link = 'diary:'.vimwiki#diary#diary_date_link() | |
endif | |
if len(link) | |
call vimwiki#base#open_link(':e ', link) | |
endif | |
endfunction | |
1 0.000002 function! vimwiki#diary#generate_diary_section() abort | |
" Create diary index content | |
let GeneratorDiary = copy(l:) | |
function! GeneratorDiary.f() abort | |
let lines = [] | |
let links_with_captions = s:read_captions(vimwiki#diary#get_diary_files()) | |
let g_files = s:group_links(links_with_captions) | |
let g_keys = s:sort(keys(g_files)) | |
for year in g_keys | |
if len(lines) > 0 | |
call add(lines, '') | |
endif | |
call add(lines, substitute(vimwiki#vars#get_syntaxlocal('rxH2_Template'), '__Header__', year , '')) | |
for month in s:sort(keys(g_files[year])) | |
call add(lines, '') | |
call add(lines, substitute(vimwiki#vars#get_syntaxlocal('rxH3_Template'), | |
\ '__Header__', s:get_month_name(month), '')) | |
if vimwiki#vars#get_wikilocal('syntax') ==# 'markdown' | |
for _ in range(vimwiki#vars#get_global('markdown_header_style')) | |
call add(lines, '') | |
endfor | |
endif | |
for [fl, captions] in s:sort(items(g_files[year][month])) | |
let topcap = captions['top'] | |
let link_tpl = vimwiki#vars#get_global('WikiLinkTemplate2') | |
if vimwiki#vars#get_wikilocal('syntax') ==# 'markdown' | |
let link_tpl = vimwiki#vars#get_syntaxlocal('Weblink1Template') | |
if empty(topcap) " When using markdown syntax, we should ensure we always have a link description. | |
let topcap = fl | |
endif | |
endif | |
if empty(topcap) | |
let top_link_tpl = vimwiki#vars#get_global('WikiLinkTemplate1') | |
else | |
let top_link_tpl = link_tpl | |
endif | |
let bullet = vimwiki#lst#default_symbol().' ' | |
let entry = substitute(top_link_tpl, '__LinkUrl__', fl, '') | |
let entry = substitute(entry, '__LinkDescription__', topcap, '') | |
let wiki_nr = vimwiki#vars#get_bufferlocal('wiki_nr') | |
let extension = vimwiki#vars#get_wikilocal('ext', wiki_nr) | |
let entry = substitute(entry, '__FileExtension__', extension, 'g') | |
" If single H1 then that will be used as the description for the link to the file | |
" if multple H1 then the filename will be used as the description for the link to the | |
" file and multiple H1 headers will be indented by shiftwidth | |
call add(lines, repeat(' ', vimwiki#lst#get_list_margin()).bullet.entry) | |
let startindent = repeat(' ', vimwiki#lst#get_list_margin()) | |
let indentstring = repeat(' ', vimwiki#u#sw()) | |
for [depth, subcap] in captions['rest'] | |
if empty(subcap) | |
continue | |
endif | |
let entry = substitute(link_tpl, '__LinkUrl__', fl.'#'.subcap, '') | |
let entry = substitute(entry, '__LinkDescription__', subcap, '') | |
" if single H1 then depth H2=0, H3=1, H4=2, H5=3, H6=4 | |
" if multiple H1 then depth H1= 0, H2=1, H3=2, H4=3, H5=4, H6=5 | |
" indent subsequent headers levels by shiftwidth | |
call add(lines, startindent.repeat(indentstring, depth+1).bullet.entry) | |
endfor | |
endfor | |
endfor | |
endfor | |
return lines | |
endfunction | |
let current_file = vimwiki#path#path_norm(expand('%:p')) | |
let diary_file = vimwiki#path#path_norm(s:diary_index()) | |
if vimwiki#path#is_equal(current_file, diary_file) | |
let content_rx = '^\%('.vimwiki#vars#get_syntaxlocal('rxHeader').'\)\|'. | |
\ '\%(^\s*$\)\|\%('.vimwiki#vars#get_syntaxlocal('rxListBullet').'\)' | |
call vimwiki#base#update_listing_in_buffer( | |
\ GeneratorDiary, | |
\ vimwiki#vars#get_wikilocal('diary_header'), | |
\ content_rx, | |
\ 1, | |
\ 1, | |
\ 1) | |
else | |
call vimwiki#u#error('You can generate diary links only in a diary index page!') | |
endif | |
endfunction | |
1 0.000004 function! vimwiki#diary#calendar_action(day, month, year, week, dir) abort | |
" Callback function for Calendar.vim | |
let day = s:prefix_zero(a:day) | |
let month = s:prefix_zero(a:month) | |
let link = a:year.'-'.month.'-'.day | |
if winnr('#') == 0 | |
if a:dir ==? 'V' | |
vsplit | |
else | |
split | |
endif | |
else | |
wincmd p | |
if !&hidden && &modified | |
new | |
endif | |
endif | |
call vimwiki#diary#make_note(0, 0, link) | |
endfunction | |
1 0.000001 function! vimwiki#diary#calendar_sign(day, month, year) abort | |
" Callback function for Calendar.vim | |
" Clause: no wiki no sign #290 | |
if len(g:vimwiki_list) <= 0 | |
return | |
endif | |
let day = s:prefix_zero(a:day) | |
let month = s:prefix_zero(a:month) | |
let sfile = vimwiki#vars#get_wikilocal('path') . vimwiki#vars#get_wikilocal('diary_rel_path') | |
\ . a:year.'-'.month.'-'.day.vimwiki#vars#get_wikilocal('ext') | |
return filereadable(expand(sfile)) | |
endfunction | |
1 0.000001 function! vimwiki#diary#diary_file_captions() abort | |
return s:read_captions(vimwiki#diary#get_diary_files()) | |
endfunction | |
FUNCTION <SNR>125_Highlight_Matching_Pair() | |
Defined: /usr/share/vim/vim82/plugin/matchparen.vim:40 | |
Called 4 times | |
Total time: 0.001790 | |
Self time: 0.001736 | |
count total (s) self (s) | |
" Remove any previous match. | |
4 0.000099 0.000045 call s:Remove_Matches() | |
" Avoid that we remove the popup menu. | |
" Return when there are no colors (looks like the cursor jumps). | |
4 0.000017 if pumvisible() || (&t_Co < 8 && !has("gui_running")) | |
return | |
4 0.000005 endif | |
" Get the character under the cursor and check if it's in 'matchpairs'. | |
4 0.000009 let c_lnum = line('.') | |
4 0.000010 let c_col = col('.') | |
4 0.000008 let before = 0 | |
4 0.000011 let text = getline(c_lnum) | |
4 0.000051 let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)') | |
4 0.000009 if empty(matches) | |
let [c_before, c] = ['', ''] | |
4 0.000005 else | |
4 0.000017 let [c_before, c] = matches[1:2] | |
4 0.000057 endif | |
4 0.000039 let plist = split(&matchpairs, '.\zs[:,]') | |
4 0.000011 let i = index(plist, c) | |
4 0.000007 if i < 0 | |
" not found, in Insert mode try character before the cursor | |
2 0.000006 if c_col > 1 && (mode() == 'i' || mode() == 'R') | |
let before = strlen(c_before) | |
let c = c_before | |
let i = index(plist, c) | |
2 0.000003 endif | |
2 0.000002 if i < 0 | |
" not found, nothing to do | |
2 0.000002 return | |
endif | |
2 0.000002 endif | |
" Figure out the arguments for searchpairpos(). | |
2 0.000003 if i % 2 == 0 | |
2 0.000003 let s_flags = 'nW' | |
2 0.000006 let c2 = plist[i + 1] | |
else | |
let s_flags = 'nbW' | |
let c2 = c | |
let c = plist[i - 1] | |
2 0.000001 endif | |
2 0.000003 if c == '[' | |
2 0.000003 let c = '\[' | |
2 0.000002 let c2 = '\]' | |
2 0.000001 endif | |
" Find the match. When it was just before the cursor move it there for a | |
" moment. | |
2 0.000004 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) | |
2 0.000002 endif | |
2 0.000011 if !has("syntax") || !exists("g:syntax_on") | |
let s_skip = "0" | |
2 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. | |
2 0.000007 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'. | |
2 0.000002 try | |
2 0.000444 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 | |
2 0.000002 endtry | |
2 0.000002 endif | |
" Limit the search to lines visible in the window. | |
2 0.000006 let stoplinebottom = line('w$') | |
2 0.000005 let stoplinetop = line('w0') | |
2 0.000003 if i % 2 == 0 | |
2 0.000004 let stopline = stoplinebottom | |
else | |
let stopline = stoplinetop | |
2 0.000002 endif | |
" Limit the search time to 300 msec to avoid a hang on very long lines. | |
" This fails when a timeout is not supported. | |
2 0.000005 if mode() == 'i' || mode() == 'R' | |
let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout | |
2 0.000002 else | |
2 0.000007 let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout | |
2 0.000001 endif | |
2 0.000002 try | |
2 0.000429 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) | |
2 0.000002 endtry | |
2 0.000004 if before > 0 | |
if has_getcurpos | |
call setpos('.', save_cursor) | |
else | |
call winrestview(save_cursor) | |
endif | |
2 0.000002 endif | |
" If a match is found setup match highlighting. | |
2 0.000004 if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom | |
2 0.000004 if exists('*matchaddpos') | |
2 0.000094 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\)/' | |
2 0.000002 endif | |
2 0.000004 let w:paren_hl_on = 1 | |
2 0.000001 endif | |
FUNCTION airline#util#exec_funcrefs() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:95 | |
Called 2 times | |
Total time: 0.004556 | |
Self time: 0.000613 | |
count total (s) self (s) | |
22 0.000092 for Fn in a:list | |
22 0.004270 0.000327 let code = call(Fn, a:000) | |
22 0.000045 if code != 0 | |
2 0.000003 return code | |
20 0.000021 endif | |
20 0.000024 endfor | |
return 0 | |
FUNCTION airline#extensions#unite#apply() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/unite.vim:11 | |
Called 2 times | |
Total time: 0.000072 | |
Self time: 0.000072 | |
count total (s) self (s) | |
2 0.000022 if &ft == 'unite' | |
call a:1.add_section('airline_a', ' Unite ') | |
call a:1.add_section('airline_b', ' %{get(unite#get_context(), "buffer_name", "")} ') | |
call a:1.add_section('airline_c', ' %{unite#get_status_string()} ') | |
call a:1.split() | |
call a:1.add_section('airline_y', ' %{get(unite#get_context(), "real_buffer_name", "")} ') | |
return 1 | |
2 0.000005 endif | |
FUNCTION vimwiki#vars#get_wikilocal() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/vars.vim:1617 | |
Called 20 times | |
Total time: 0.000680 | |
Self time: 0.000341 | |
count total (s) self (s) | |
" Return: wiki local named variable | |
" Param: (1): variable name (alias key, <string>) | |
" Param: (2): wiki number (<int>). When absent, the wiki of the currently active buffer is | |
" used | |
20 0.000026 if a:0 | |
1 0.000002 return g:vimwiki_wikilocal_vars[a:1][a:key] | |
19 0.000014 else | |
19 0.000512 0.000173 return g:vimwiki_wikilocal_vars[vimwiki#vars#get_bufferlocal('wiki_nr')][a:key] | |
endif | |
FUNCTION <SNR>163_get_array() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/highlighter.vim:60 | |
Called 304 times | |
Total time: 0.002141 | |
Self time: 0.002141 | |
count total (s) self (s) | |
304 0.001724 return [ a:guifg, a:guibg, a:ctermfg, a:ctermbg, empty(a:opts) ? '' : join(a:opts, ',') ] | |
FUNCTION airline#check_mode() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline.vim:227 | |
Called 14 times | |
Total time: 0.109588 | |
Self time: 0.003458 | |
count total (s) self (s) | |
14 0.000083 if !has_key(s:contexts, a:winnr) | |
return '' | |
14 0.000040 endif | |
14 0.000069 let context = s:contexts[a:winnr] | |
14 0.000067 if get(w:, 'airline_active', 1) | |
14 0.000057 let m = mode(1) | |
" Refer :help mode() to see the list of modes | |
" NB: 'let mode' here refers to the display colour _groups_, | |
" not the literal mode's code (i.e., m). E.g., Select modes | |
" v, S and ^V use 'visual' since they are of similar ilk. | |
" Some modes do not get recognised for status line purposes: | |
" no, nov, noV, no^V, !, cv, and ce. | |
" Mode name displayed is handled in init.vim (g:airline_mode_map). | |
" | |
14 0.000060 if m[0] ==# "i" | |
let mode = ['insert'] " Insert modes + submodes (i, ic, ix) | |
14 0.000039 elseif m[0] == "R" | |
let mode = ['replace'] " Replace modes + submodes (R, Rc, Rv, Rx) (NB: case sensitive as 'r' is a mode) | |
14 0.000203 elseif m[0] =~ '\v(v|V||s|S|)' | |
let mode = ['visual'] " Visual and Select modes (v, V, ^V, s, S, ^S)) | |
14 0.000031 elseif m ==# "t" | |
let mode = ['terminal'] " Terminal mode (only has one mode (t)) | |
14 0.000080 elseif m[0] =~ '\v(c|r|!)' | |
let mode = ['commandline'] " c, cv, ce, r, rm, r? (NB: cv and ce stay showing as mode entered from) | |
14 0.000019 else | |
14 0.000040 let mode = ['normal'] " Normal mode + submodes (n, niI, niR, niV; plus operator pendings no, nov, noV, no^V) | |
14 0.000019 endif | |
14 0.000095 if exists("*VMInfos") && !empty(VMInfos()) | |
" Vim plugin Multiple Cursors https://github.com/mg979/vim-visual-multi | |
let m = 'multi' | |
14 0.000014 endif | |
" Adjust to handle additional modes, which don't display correctly otherwise | |
14 0.000102 if index(['niI', 'niR', 'niV', 'ic', 'ix', 'Rc', 'Rv', 'Rx', 'multi'], m) == -1 | |
14 0.000045 let m = m[0] | |
14 0.000018 endif | |
14 0.000085 let w:airline_current_mode = get(g:airline_mode_map, m, m) | |
else | |
let mode = ['inactive'] | |
let w:airline_current_mode = get(g:airline_mode_map, '__') | |
14 0.000018 endif | |
14 0.000427 if g:airline_detect_modified && &modified | |
2 0.000007 call add(mode, 'modified') | |
14 0.000018 endif | |
14 0.000033 if g:airline_detect_paste && &paste | |
call add(mode, 'paste') | |
14 0.000016 endif | |
14 0.000080 if g:airline_detect_crypt && exists("+key") && !empty(&key) | |
call add(mode, 'crypt') | |
14 0.000015 endif | |
14 0.000047 if g:airline_detect_spell && &spell | |
14 0.000053 call add(mode, 'spell') | |
14 0.000016 endif | |
14 0.000034 if &readonly || ! &modifiable | |
call add(mode, 'readonly') | |
14 0.000015 endif | |
14 0.000099 let mode_string = join(mode) | |
14 0.000057 if get(w:, 'airline_lastmode', '') != mode_string | |
4 0.003038 0.000108 call airline#highlighter#highlight_modified_inactive(context.bufnr) | |
4 0.102931 0.000076 call airline#highlighter#highlight(mode, string(context.bufnr)) | |
4 0.000387 0.000042 call airline#util#doautocmd('AirlineModeChanged') | |
4 0.000011 let w:airline_lastmode = mode_string | |
14 0.000017 endif | |
14 0.000021 return '' | |
FUNCTION airline#extensions#vimtex#apply() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/vimtex.vim:44 | |
Called 2 times | |
Total time: 0.000024 | |
Self time: 0.000024 | |
count total (s) self (s) | |
2 0.000006 if exists("b:vimtex") | |
let w:airline_section_x = get(w:, 'airline_section_x', g:airline_section_x) | |
let w:airline_section_x.=s:spc.g:airline_left_alt_sep.s:spc.'%{airline#extensions#vimtex#get_scope()}' | |
2 0.000002 endif | |
FUNCTION airline#extensions#tabline#add_label() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline.vim:30 | |
Called 2 times | |
Total time: 0.000019 | |
Self time: 0.000019 | |
count total (s) self (s) | |
2 0.000004 if get(g:, 'airline#extensions#tabline#show_tab_type', 1) | |
call a:dict.add_section_spaced('airline_tablabel'. (a:right ? '_right' : ''), get(g:, 'airline#extensions#tabline#'.a:type.'_label', a:type)) | |
2 0.000001 endif | |
FUNCTION airline#util#try_focusgained() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:223 | |
Called 2 times | |
Total time: 0.000049 | |
Self time: 0.000049 | |
count total (s) self (s) | |
" Ignore lasts for at most one second and is cleared on the first | |
" focusgained. We use ignore to prevent system() calls from triggering | |
" FocusGained (which occurs 100% on win32 and seem to sometimes occur under | |
" tmux). | |
2 0.000018 let dt = localtime() - s:focusgained_ignore_time | |
2 0.000007 let s:focusgained_ignore_time = 0 | |
2 0.000007 return dt >= 1 | |
FUNCTION airline#extensions#branch#update_untracked_config() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/branch.vim:193 | |
Called 14 times | |
Total time: 0.000336 | |
Self time: 0.000336 | |
count total (s) self (s) | |
14 0.000085 if !has_key(s:vcs_config[a:vcs].untracked, a:file) | |
return | |
14 0.000086 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 | |
14 0.000014 endif | |
FUNCTION airline#themes#get_highlight() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/themes.vim:35 | |
Called 112 times | |
Total time: 0.030379 | |
Self time: 0.001154 | |
count total (s) self (s) | |
112 0.030234 0.001009 return call('airline#highlighter#get_highlight', [a:group] + a:000) | |
FUNCTION airline#util#has_custom_scm() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:174 | |
Called 14 times | |
Total time: 0.000078 | |
Self time: 0.000078 | |
count total (s) self (s) | |
14 0.000060 return !empty(get(g:, 'airline#extensions#branch#custom_head', '')) | |
FUNCTION <SNR>58_GetCurrentFile() | |
Defined: ~/vimfiles/plugged/vim-wakatime/plugin/wakatime.vim:415 | |
Called 3 times | |
Total time: 0.003620 | |
Self time: 0.003620 | |
count total (s) self (s) | |
3 0.003612 return expand("%:p") | |
FUNCTION <SNR>164_update_branch() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/branch.vim:183 | |
Called 14 times | |
Total time: 0.004724 | |
Self time: 0.001090 | |
count total (s) self (s) | |
42 0.000135 for vcs in keys(s:vcs_config) | |
28 0.003957 0.000323 call {s:vcs_config[vcs].update_branch}() | |
28 0.000143 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 | |
28 0.000029 endif | |
42 0.000053 endfor | |
FUNCTION airline#util#has_fugitive() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:145 | |
Called 14 times | |
Total time: 0.000154 | |
Self time: 0.000154 | |
count total (s) self (s) | |
14 0.000056 if !exists("s:has_fugitive") | |
let s:has_fugitive = exists('*FugitiveHead') | |
14 0.000014 endif | |
14 0.000023 return s:has_fugitive | |
FUNCTION <SNR>164_update_hg_branch() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/branch.vim:148 | |
Called 14 times | |
Total time: 0.001201 | |
Self time: 0.001045 | |
count total (s) self (s) | |
14 0.000254 0.000098 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 | |
14 0.000015 else | |
14 0.000042 let s:vcs_config['mercurial'].branch = '' | |
14 0.000014 endif | |
FUNCTION <SNR>125_Remove_Matches() | |
Defined: /usr/share/vim/vim82/plugin/matchparen.vim:196 | |
Called 4 times | |
Total time: 0.000054 | |
Self time: 0.000054 | |
count total (s) self (s) | |
4 0.000017 if exists('w:paren_hl_on') && w:paren_hl_on | |
2 0.000008 silent! call matchdelete(3) | |
2 0.000005 let w:paren_hl_on = 0 | |
4 0.000004 endif | |
FUNCTION airline#extensions#netrw#apply() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/netrw.vim:11 | |
Called 2 times | |
Total time: 0.000089 | |
Self time: 0.000089 | |
count total (s) self (s) | |
2 0.000014 if &ft == 'netrw' | |
let spc = g:airline_symbols.space | |
call a:1.add_section('airline_a', spc.'netrw'.spc) | |
if exists('*airline#extensions#branch#get_head') | |
call a:1.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc) | |
endif | |
call a:1.add_section('airline_c', spc.'%f'.spc) | |
call a:1.split() | |
call a:1.add_section('airline_y', spc.'%{airline#extensions#netrw#sortstring()}'.spc) | |
return 1 | |
2 0.000003 endif | |
FUNCTION airline#extensions#term#apply() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/term.vim:14 | |
Called 2 times | |
Total time: 0.000083 | |
Self time: 0.000083 | |
count total (s) self (s) | |
2 0.000018 if &buftype ==? 'terminal' || bufname(a:2.bufnr)[0] ==? '!' | |
call a:1.add_section_spaced('airline_a', s:section_a) | |
call a:1.add_section_spaced('airline_b', s:neoterm_id(a:2.bufnr)) | |
call a:1.add_section('airline_term', s:spc.s:termname(a:2.bufnr)) | |
call a:1.split() | |
call a:1.add_section('airline_y', '') | |
call a:1.add_section_spaced('airline_z', s:section_z) | |
return 1 | |
2 0.000003 endif | |
FUNCTION <SNR>179_get_accented_line() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/builder.vim:163 | |
Called 22 times | |
Total time: 0.001394 | |
Self time: 0.001394 | |
count total (s) self (s) | |
22 0.000054 if a:self._context.active | |
" active window | |
22 0.000044 let contents = [] | |
22 0.000186 let content_parts = split(a:contents, '__accent') | |
36 0.000123 for cpart in content_parts | |
14 0.000169 let accent = matchstr(cpart, '_\zs[^#]*\ze') | |
14 0.000051 call add(contents, cpart) | |
36 0.000047 endfor | |
22 0.000125 let line = join(contents, a:group) | |
22 0.000124 let line = substitute(line, '__restore__', a:group, 'g') | |
else | |
" inactive window | |
let line = substitute(a:contents, '%#__accent[^#]*#', '', 'g') | |
let line = substitute(line, '%#__restore__#', '', 'g') | |
22 0.000023 endif | |
22 0.000031 return line | |
FUNCTION airline#extensions#tabline#buflist#list() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/buflist.vim:39 | |
Called 8 times | |
Total time: 0.000071 | |
Self time: 0.000071 | |
count total (s) self (s) | |
8 0.000035 if exists('s:current_buffer_list') | |
8 0.000013 return s:current_buffer_list | |
endif | |
let exclude_buffers = get(g:, 'airline#extensions#tabline#exclude_buffers', []) | |
let exclude_paths = get(g:, 'airline#extensions#tabline#excludes', []) | |
let exclude_preview = get(g:, 'airline#extensions#tabline#exclude_preview', 1) | |
let list = (exists('g:did_bufmru') && g:did_bufmru) ? BufMRUList() : range(1, bufnr("$")) | |
let buffers = [] | |
" If this is too slow, we can switch to a different algorithm. | |
" Basically branch 535 already does it, but since it relies on | |
" BufAdd autocommand, I'd like to avoid this if possible. | |
for nr in list | |
if buflisted(nr) | |
" Do not add to the bufferlist, if either | |
" 1) bufnr is exclude_buffers list | |
" 2) buffername matches one of exclude_paths patterns | |
" 3) buffer is a quickfix buffer | |
" 4) when excluding preview windows: | |
" 'bufhidden' == wipe | |
" 'buftype' == nofile | |
" 5) ignore buffers matching airline#extensions#tabline#ignore_bufadd_pat | |
" check buffer numbers first | |
if index(exclude_buffers, nr) >= 0 | |
continue | |
" check paths second | |
elseif !empty(exclude_paths) && s:ExcludePaths(nr, exclude_paths) | |
continue | |
" ignore buffers matching airline#extensions#tabline#ignore_bufadd_pat | |
elseif airline#util#ignore_buf(bufname(nr)) | |
continue | |
" check other types last | |
elseif s:ExcludeOther(nr, exclude_preview) | |
continue | |
endif | |
call add(buffers, nr) | |
endif | |
endfor | |
let s:current_buffer_list = buffers | |
return buffers | |
FUNCTION <SNR>179_section_is_empty() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/builder.vim:182 | |
Called 28 times | |
Total time: 0.000516 | |
Self time: 0.000516 | |
count total (s) self (s) | |
28 0.000050 let start=1 | |
" do not check for inactive windows or the tabline | |
28 0.000062 if a:self._context.active == 0 | |
return 0 | |
28 0.000083 elseif get(a:self._context, 'tabline', 0) | |
14 0.000017 return 0 | |
14 0.000015 endif | |
" only check, if airline#skip_empty_sections == 1 | |
14 0.000040 if get(g:, 'airline_skip_empty_sections', 0) == 0 | |
14 0.000017 return 0 | |
endif | |
" only check, if airline#skip_empty_sections == 1 | |
if get(w:, 'airline_skip_empty_sections', -1) == 0 | |
return 0 | |
endif | |
" special case: When the content is %=, that is the | |
" separation marker, which switches between left- and | |
" right-aligned content. | |
" Consider that to be empty, so that the previous previous | |
" group is correctly remembered in the builder() function | |
if empty(a:content) || a:content is# '%=' | |
return 1 | |
endif | |
let stripped = substitute(a:content, '\(%{.*}\|%#__accent_[^#]*#\|%#__restore__#\|%( \| %)\)', '', 'g') | |
if !empty(stripped) | |
return 0 " There is content in the statusline | |
endif | |
let exprlist = [] | |
call substitute(a:content, '%{\([^}]*\)}', '\=add(exprlist, submatch(1))', 'g') | |
for expr in exprlist | |
try | |
" catch all exceptions, just in case | |
if !empty(eval(expr)) | |
return 0 | |
endif | |
catch | |
return 0 | |
endtry | |
endfor | |
return 1 | |
FUNCTION <SNR>157_invoke_funcrefs() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline.vim:205 | |
Called 2 times | |
Total time: 0.027136 | |
Self time: 0.000176 | |
count total (s) self (s) | |
2 0.000101 0.000025 let builder = airline#builder#new(a:context) | |
2 0.004594 0.000038 let err = airline#util#exec_funcrefs(a:funcrefs + s:core_funcrefs, builder, a:context) | |
2 0.000004 if err == 1 | |
2 0.022373 0.000045 let a:context.line = builder.build() | |
2 0.000012 let s:contexts[a:context.winnr] = a:context | |
2 0.000010 let option = get(g:, 'airline_statusline_ontop', 0) ? '&tabline' : '&statusline' | |
2 0.000024 call setwinvar(a:context.winnr, option, '%!airline#statusline('.a:context.winnr.')') | |
2 0.000003 endif | |
FUNCTION 17() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/builder.vim:8 | |
Called 4 times | |
Total time: 0.000065 | |
Self time: 0.000065 | |
count total (s) self (s) | |
4 0.000061 call add(self._sections, ['|', a:0 ? a:1 : '%=']) | |
FUNCTION 19() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/builder.vim:17 | |
Called 16 times | |
Total time: 0.000100 | |
Self time: 0.000100 | |
count total (s) self (s) | |
16 0.000078 call add(self._sections, [a:group, a:contents]) | |
FUNCTION airline#highlighter#add_separator() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/highlighter.vim:184 | |
Called 16 times | |
Total time: 0.019597 | |
Self time: 0.000363 | |
count total (s) self (s) | |
16 0.000119 let s:separators[a:from.a:to] = [a:from, a:to, a:inverse] | |
16 0.019437 0.000203 call <sid>exec_separator({}, a:from, a:to, a:inverse, '') | |
FUNCTION <SNR>58_HandleActivity() | |
Defined: ~/vimfiles/plugged/vim-wakatime/plugin/wakatime.vim:718 | |
Called 3 times | |
Total time: 0.004138 | |
Self time: 0.000346 | |
count total (s) self (s) | |
3 0.003673 0.000053 let file = s:GetCurrentFile() | |
3 0.000074 if !empty(file) && file !~ "-MiniBufExplorer-" && file !~ "--NO NAME--" && file !~ "^term:" | |
3 0.000179 0.000055 let last = s:GetLastHeartbeat() | |
3 0.000007 let now = localtime() | |
" Create a heartbeat when saving a file, when the current file | |
" changes, and when still editing the same file but enough time | |
" has passed since the last heartbeat. | |
3 0.000080 0.000042 if a:is_write || s:EnoughTimePassed(now, last) || file != last.file | |
call s:AppendHeartbeat(file, now, a:is_write, last) | |
3 0.000003 else | |
3 0.000007 if now - s:last_heartbeat.last_activity_at > s:local_cache_expire | |
1 0.000018 0.000008 call s:SetLastHeartbeatInMemory(now, last.last_heartbeat_at, last.file) | |
3 0.000003 endif | |
3 0.000003 endif | |
" When buffering heartbeats disabled, no need to re-check the | |
" heartbeats buffer. | |
3 0.000006 if s:buffering_heartbeats_enabled | |
" Only send buffered heartbeats every s:send_buffer_seconds | |
3 0.000005 if now - s:last_sent > s:send_buffer_seconds | |
call s:SendHeartbeats() | |
3 0.000001 endif | |
3 0.000003 endif | |
3 0.000002 endif | |
FUNCTION 21() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/builder.vim:25 | |
Called 2 times | |
Total time: 0.000016 | |
Self time: 0.000016 | |
count total (s) self (s) | |
2 0.000013 call insert(self._sections, [a:group, a:contents], a:position) | |
FUNCTION 24() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/builder.vim:62 | |
Called 6 times | |
Total time: 0.034887 | |
Self time: 0.004474 | |
count total (s) self (s) | |
6 0.000016 let side = 1 | |
6 0.000012 let line = '' | |
6 0.000013 let i = 0 | |
6 0.000019 let length = len(self._sections) | |
6 0.000010 let split = 0 | |
6 0.000010 let is_empty = 0 | |
6 0.000012 let prev_group = '' | |
34 0.000072 while i < length | |
28 0.000103 let section = self._sections[i] | |
28 0.000097 let group = section[0] | |
28 0.000064 let contents = section[1] | |
28 0.000052 let pgroup = prev_group | |
28 0.000821 0.000261 let prev_group = airline#builder#get_prev_group(self._sections, i) | |
28 0.000077 if group ==# 'airline_c' && &buftype ==# 'terminal' && self._context.active | |
let group = 'airline_term' | |
28 0.000096 elseif group ==# 'airline_c' && !self._context.active && has_key(self._context, 'bufnr') | |
let group = 'airline_c'. self._context.bufnr | |
28 0.000084 elseif prev_group ==# 'airline_c' && !self._context.active && has_key(self._context, 'bufnr') | |
let prev_group = 'airline_c'. self._context.bufnr | |
28 0.000022 endif | |
28 0.000036 if is_empty | |
let prev_group = pgroup | |
28 0.000031 endif | |
28 0.000783 0.000267 let is_empty = s:section_is_empty(self, contents) | |
28 0.000058 if is_empty | |
" need to fix highlighting groups, since we | |
" have skipped a section, we actually need | |
" the previous previous group and so the | |
" seperator goes from the previous previous group | |
" to the current group | |
let pgroup = group | |
28 0.000027 endif | |
28 0.000044 if group == '' | |
let line .= contents | |
28 0.000042 elseif group == '|' | |
6 0.000010 let side = 0 | |
6 0.000013 let line .= contents | |
6 0.000010 let split = 1 | |
22 0.000020 else | |
22 0.000033 if prev_group == '' | |
6 0.000020 let line .= '%#'.group.'#' | |
16 0.000026 elseif split | |
6 0.000008 if !is_empty | |
6 0.006657 0.000080 let line .= s:get_transitioned_seperator(self, prev_group, group, side) | |
6 0.000007 endif | |
6 0.000012 let split = 0 | |
10 0.000013 else | |
10 0.000017 if !is_empty | |
10 0.021487 0.000121 let line .= s:get_seperator(self, prev_group, group, side) | |
10 0.000009 endif | |
22 0.000027 endif | |
22 0.001675 0.000281 let line .= is_empty ? '' : s:get_accented_line(self, group, contents) | |
28 0.000032 endif | |
28 0.000055 let i = i + 1 | |
34 0.000046 endwhile | |
6 0.000012 if !self._context.active | |
"let line = substitute(line, '%#airline_c#', '%#airline_c'.self._context.bufnr.'#', '') | |
let line = substitute(line, '%#.\{-}\ze#', '\0_inactive', 'g') | |
6 0.000014 endif | |
6 0.000013 return line | |
FUNCTION airline#util#winwidth() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:19 | |
Called 8 times | |
Total time: 0.000184 | |
Self time: 0.000184 | |
count total (s) self (s) | |
8 0.000036 let nr = get(a:000, 0, 0) | |
" When statusline is on top, or using global statusline for Neovim | |
" always return the number of columns | |
8 0.000046 if get(g:, 'airline_statusline_ontop', 0) || &laststatus > 2 | |
return &columns | |
8 0.000014 else | |
8 0.000030 return winwidth(nr) | |
endif | |
FUNCTION <SNR>109_normalize_link_syntax_n() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/markdown_base.vim:51 | |
Called 1 time | |
Total time: 6.650219 | |
Self time: 0.000937 | |
count total (s) self (s) | |
1 0.000002 let lnum = line('.') | |
" try WikiIncl | |
1 0.000054 0.000013 let lnk = vimwiki#base#matchstr_at_cursor(vimwiki#vars#get_global('rxWikiIncl')) | |
1 0.000002 if !empty(lnk) | |
" NO-OP !! | |
return | |
1 0.000001 endif | |
" try WikiLink0: replace with WikiLink1 | |
1 0.000106 0.000010 let lnk = vimwiki#base#matchstr_at_cursor(vimwiki#vars#get_syntaxlocal('rxWikiLink0')) | |
1 0.000002 if !empty(lnk) | |
let sub = vimwiki#base#normalize_link_helper(lnk, vimwiki#vars#get_syntaxlocal('rxWikiLinkMatchUrl'), vimwiki#vars#get_syntaxlocal('rxWikiLinkMatchDescr'), vimwiki#vars#get_syntaxlocal('WikiLink1Template2')) | |
call vimwiki#base#replacestr_at_cursor(vimwiki#vars#get_syntaxlocal('rxWikiLink0'), sub) | |
return | |
1 0.000001 endif | |
" try WikiLink1: replace with WikiLink0 | |
1 0.000105 0.000009 let lnk = vimwiki#base#matchstr_at_cursor(vimwiki#vars#get_syntaxlocal('rxWikiLink1')) | |
1 0.000002 if !empty(lnk) | |
let sub = vimwiki#base#normalize_link_helper(lnk, vimwiki#vars#get_syntaxlocal('rxWikiLinkMatchUrl'), vimwiki#vars#get_syntaxlocal('rxWikiLinkMatchDescr'), vimwiki#vars#get_global('WikiLinkTemplate2')) | |
call vimwiki#base#replacestr_at_cursor(vimwiki#vars#get_syntaxlocal('rxWikiLink1'), sub) | |
return | |
1 0.000000 endif | |
" try Weblink | |
1 0.000151 0.000010 let lnk = vimwiki#base#matchstr_at_cursor(vimwiki#vars#get_syntaxlocal('rxWeblink')) | |
1 0.000001 if !empty(lnk) | |
let sub = vimwiki#base#normalize_link_helper(lnk, vimwiki#vars#get_syntaxlocal('rxWeblinkMatchUrl'), vimwiki#vars#get_syntaxlocal('rxWeblinkMatchDescr'), vimwiki#vars#get_syntaxlocal('Weblink1Template')) | |
call vimwiki#base#replacestr_at_cursor(vimwiki#vars#get_syntaxlocal('rxWeblink'), sub) | |
return | |
1 0.000001 endif | |
" try Word (any characters except separators) | |
" rxWord is less permissive than rxWikiLinkUrl which is used in | |
" normalize_link_syntax_v | |
1 0.000061 0.000009 let lnk = vimwiki#base#matchstr_at_cursor(vimwiki#vars#get_global('rxWord')) | |
1 0.000002 if !empty(lnk) | |
1 6.649146 0.000785 if vimwiki#base#is_diary_file(expand('%:p')) | |
let sub = vimwiki#base#normalize_link_in_diary(lnk) | |
1 0.000001 else | |
1 0.000465 0.000026 let sub = vimwiki#base#normalize_link_helper(lnk, vimwiki#vars#get_global('rxWord'), '', vimwiki#vars#get_syntaxlocal('Link1')) | |
1 0.000001 endif | |
1 0.000064 0.000008 call vimwiki#base#replacestr_at_cursor('\V'.lnk, sub) | |
1 0.000002 return | |
endif | |
FUNCTION airline#util#doautocmd() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:178 | |
Called 6 times | |
Total time: 0.000633 | |
Self time: 0.000284 | |
count total (s) self (s) | |
6 0.000036 if !exists('#airline') && a:event !=? 'AirlineToggledOff' | |
" airline disabled | |
return | |
6 0.000005 endif | |
6 0.000008 try | |
6 0.000491 0.000142 exe printf("silent doautocmd %s User %s", s:nomodeline, a:event) | |
catch /^Vim\%((\a\+)\)\=:E48:/ | |
" Catch: Sandbox mode | |
" no-op | |
6 0.000008 endtry | |
FUNCTION <SNR>79_on_focus_gained() | |
Defined: ~/vimfiles/plugged/vim-airline/plugin/airline.vim:77 | |
Called 2 times | |
Total time: 0.028751 | |
Self time: 0.000197 | |
count total (s) self (s) | |
2 0.000022 if &eventignore =~? 'focusgained' | |
return | |
2 0.000005 endif | |
2 0.000079 0.000030 if airline#util#try_focusgained() | |
2 0.028615 0.000110 unlet! w:airline_lastmode | :call <sid>airline_refresh(1) | |
2 0.000002 endif | |
FUNCTION <SNR>164_update_git_branch() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/branch.vim:87 | |
Called 14 times | |
Total time: 0.002433 | |
Self time: 0.000533 | |
count total (s) self (s) | |
14 0.000311 0.000149 call airline#util#ignore_next_focusgain() | |
14 0.000243 0.000089 if airline#util#has_fugitive() | |
14 0.001700 0.000116 call s:config_fugitive_branch() | |
elseif airline#util#has_gina() | |
call s:config_gina_branch() | |
else | |
let s:vcs_config['git'].branch = '' | |
return | |
14 0.000013 endif | |
FUNCTION <SNR>58_SetLastHeartbeatInMemory() | |
Defined: ~/vimfiles/plugged/vim-wakatime/plugin/wakatime.vim:652 | |
Called 1 time | |
Total time: 0.000010 | |
Self time: 0.000010 | |
count total (s) self (s) | |
1 0.000008 let s:last_heartbeat = {'last_activity_at': a:last_activity_at, 'last_heartbeat_at': a:last_heartbeat_at, 'file': a:file} | |
FUNCTION <SNR>79_airline_refresh() | |
Defined: ~/vimfiles/plugged/vim-airline/plugin/airline.vim:224 | |
Called 2 times | |
Total time: 0.028505 | |
Self time: 0.000273 | |
count total (s) self (s) | |
" a:1, fast refresh, do not reload the theme | |
2 0.000014 let fast=!empty(get(a:000, 0, 0)) | |
2 0.000016 if !exists("#airline") | |
" disabled | |
return | |
2 0.000002 endif | |
2 0.000318 0.000030 call airline#util#doautocmd('AirlineBeforeRefresh') | |
2 0.000154 0.000061 call airline#highlighter#reset_hlcache() | |
2 0.000006 if !fast | |
call airline#load_theme() | |
2 0.000005 endif | |
2 0.027863 0.000069 call airline#update_statusline() | |
2 0.000085 0.000028 call airline#update_tabline() | |
FUNCTION airline#extensions#tabline#get_buffer_name() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline.vim:228 | |
Called 6 times | |
Total time: 0.001116 | |
Self time: 0.000260 | |
count total (s) self (s) | |
6 0.000119 0.000065 let buffers = a:0 ? a:1 : airline#extensions#tabline#buflist#list() | |
6 0.000024 let formatter = get(g:, 'airline#extensions#tabline#formatter', 'default') | |
6 0.000954 0.000152 return airline#extensions#tabline#formatters#{formatter}#format(a:nr, buffers) | |
FUNCTION airline#mode_changed() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline.vim:307 | |
Called 4 times | |
Total time: 0.000110 | |
Self time: 0.000080 | |
count total (s) self (s) | |
" airline#visual_active | |
" Boolean: for when to get visual wordcount | |
" needed for the wordcount extension | |
4 0.000033 let g:airline#visual_active = (mode() =~? '[vs]') | |
4 0.000065 0.000035 call airline#update_tabline() | |
FUNCTION vimwiki#vars#get_syntaxlocal() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/vars.vim:1541 | |
Called 10 times | |
Total time: 0.000682 | |
Self time: 0.000296 | |
count total (s) self (s) | |
" Get syntax variable | |
" Param: 1: key (<string>) | |
" Param: (2): syntax name (<string> ex:'markdown') | |
" Retrieve desired syntax name | |
10 0.000013 if a:0 | |
let syntax = a:1 | |
10 0.000009 else | |
10 0.000447 0.000061 let syntax = vimwiki#vars#get_wikilocal('syntax') | |
10 0.000010 endif | |
" Create syntax variable dict if not exists (lazy) | |
10 0.000052 if !exists('g:vimwiki_syntaxlocal_vars') || !has_key(g:vimwiki_syntaxlocal_vars, syntax) | |
call vimwiki#vars#populate_syntax_vars(syntax) | |
10 0.000009 endif | |
" Return d_syntax[a:key] | |
10 0.000023 return g:vimwiki_syntaxlocal_vars[syntax][a:key] | |
FUNCTION airline#extensions#tabline#new_builder() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline.vim:234 | |
Called 2 times | |
Total time: 0.000154 | |
Self time: 0.000076 | |
count total (s) self (s) | |
2 0.000020 let builder_context = { 'active' : 1, 'tabline' : 1, 'right_sep' : get(g:, 'airline#extensions#tabline#right_sep' , g:airline_right_sep), 'right_alt_sep' : get(g:, 'airline#extensions#tabline#right_alt_sep', g:airline_right_alt_sep), } | |
2 0.000006 if get(g:, 'airline_powerline_fonts', 0) | |
let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , g:airline_left_sep) | |
let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , g:airline_left_alt_sep) | |
2 0.000002 else | |
2 0.000006 let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , ' ') | |
2 0.000006 let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , '|') | |
2 0.000002 endif | |
2 0.000093 0.000015 return airline#extensions#tabline#builder#new(builder_context) | |
FUNCTION 65() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim:18 | |
Called 2 times | |
Total time: 0.000041 | |
Self time: 0.000035 | |
count total (s) self (s) | |
2 0.000004 let self._first_title = a:first " lowest index | |
2 0.000002 let self._last_title = a:last " highest index | |
2 0.000003 let self._left_title = a:current " next index to add on the left | |
2 0.000004 let self._right_title = a:current + 1 " next index to add on the right | |
2 0.000016 0.000010 let self._left_position = self.get_position() " left end of titles | |
2 0.000004 let self._right_position = self._left_position " right end of the titles | |
FUNCTION 66() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim:41 | |
Called 2 times | |
Total time: 0.000898 | |
Self time: 0.000158 | |
count total (s) self (s) | |
2 0.000294 0.000008 let title = self.get_title(a:index) | |
2 0.000477 0.000039 let title_size = s:tabline_evaluated_length(title) + a:sep_size | |
2 0.000006 if a:force || self._remaining_space >= title_size | |
2 0.000005 let pos = a:pos | |
2 0.000007 if has_key(self, "get_pretitle") | |
call self.insert_raw(self.get_pretitle(a:index), pos) | |
let self._right_position += 1 | |
let pos += 1 | |
2 0.000002 endif | |
2 0.000034 0.000018 call self.insert_section(a:group, title, pos) | |
2 0.000005 let self._right_position += 1 | |
2 0.000004 let pos += 1 | |
2 0.000006 if has_key(self, "get_posttitle") | |
call self.insert_raw(self.get_posttitle(a:index), pos) | |
let self._right_position += 1 | |
let pos += 1 | |
2 0.000002 endif | |
2 0.000004 let self._remaining_space -= title_size | |
2 0.000002 return 1 | |
endif | |
return 0 | |
FUNCTION 67() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim:96 | |
Called 2 times | |
Total time: 0.015997 | |
Self time: 0.000581 | |
count total (s) self (s) | |
2 0.000006 if has_key(self, '_left_position') && self._first_title <= self._last_title | |
2 0.003150 0.000028 let self._remaining_space = &columns - s:tabline_evaluated_length(self._build()) | |
2 0.000007 let center_active = get(g:, 'airline#extensions#tabline#center_active', 0) | |
2 0.000130 0.000014 let sep_size = s:tabline_evaluated_length(self._context.left_sep) | |
2 0.000103 0.000013 let alt_sep_size = s:tabline_evaluated_length(self._context.left_alt_sep) | |
2 0.000046 0.000011 let outer_left_group = airline#builder#get_prev_group(self._sections, self._left_position) | |
2 0.000085 0.000028 let outer_right_group = airline#builder#get_next_group(self._sections, self._right_position) | |
2 0.000010 let overflow_marker = get(g:, 'airline#extensions#tabline#overflow_marker', g:airline_symbols.ellipsis) | |
2 0.000133 0.000013 let overflow_marker_size = s:tabline_evaluated_length(overflow_marker) | |
" Allow space for the markers before we begin filling in titles. | |
2 0.000005 if self._left_title > self._first_title | |
let self._remaining_space -= overflow_marker_size + s:get_separator_change(self.overflow_group, "", outer_left_group, sep_size, alt_sep_size) | |
2 0.000002 endif | |
2 0.000003 if self._left_title < self._last_title | |
let self._remaining_space -= overflow_marker_size + s:get_separator_change(self.overflow_group, "", outer_right_group, sep_size, alt_sep_size) | |
2 0.000002 endif | |
" Add the current title | |
2 0.000118 0.000010 let group = self.get_group(self._left_title) | |
2 0.000004 if self._left_title == self._first_title | |
2 0.000079 0.000016 let sep_change = s:get_separator_change(group, "", outer_left_group, sep_size, alt_sep_size) | |
else | |
let sep_change = s:get_separator_change(group, "", self.overflow_group, sep_size, alt_sep_size) | |
2 0.000002 endif | |
2 0.000004 if self._left_title == self._last_title | |
2 0.001242 0.000014 let sep_change += s:get_separator_change(group, "", outer_right_group, sep_size, alt_sep_size) | |
else | |
let sep_change += s:get_separator_change(group, "", self.overflow_group, sep_size, alt_sep_size) | |
2 0.000002 endif | |
2 0.000004 let left_group = group | |
2 0.000004 let right_group = group | |
2 0.000924 0.000026 let self._left_title -= self.try_insert_title(self._left_title, group, self._left_position, sep_change, 1) | |
2 0.000007 if get(g:, 'airline#extensions#tabline#current_first', 0) | |
" always have current title first | |
let self._left_position += 1 | |
2 0.000002 endif | |
2 0.000005 if !center_active && self._right_title <= self._last_title | |
" Add the title to the right | |
let group = self.get_group(self._right_title) | |
if self._right_title == self._last_title | |
let sep_change = s:get_separator_change_with_end(group, right_group, outer_right_group, self.overflow_group, sep_size, alt_sep_size) - overflow_marker_size | |
else | |
let sep_change = s:get_separator_change(group, right_group, self.overflow_group, sep_size, alt_sep_size) | |
endif | |
let right_group = group | |
let self._right_title += self.try_insert_title(self._right_title, group, self._right_position, sep_change, 1) | |
2 0.000001 endif | |
2 0.000004 while self._remaining_space > 0 | |
2 0.000005 let done = 0 | |
2 0.000003 if self._left_title >= self._first_title | |
" Insert next title to the left | |
let group = self.get_group(self._left_title) | |
if self._left_title == self._first_title | |
let sep_change = s:get_separator_change_with_end(group, left_group, outer_left_group, self.overflow_group, sep_size, alt_sep_size) - overflow_marker_size | |
else | |
let sep_change = s:get_separator_change(group, left_group, self.overflow_group, sep_size, alt_sep_size) | |
endif | |
let left_group = group | |
let done = self.try_insert_title(self._left_title, group, self._left_position, sep_change, 0) | |
let self._left_title -= done | |
2 0.000002 endif | |
" If center_active is set, this |if| operates as an independent |if|, | |
" otherwise as an |elif|. | |
2 0.000005 if self._right_title <= self._last_title && (center_active || !done) | |
" Insert next title to the right | |
let group = self.get_group(self._right_title) | |
if self._right_title == self._last_title | |
let sep_change = s:get_separator_change_with_end(group, right_group, outer_right_group, self.overflow_group, sep_size, alt_sep_size) - overflow_marker_size | |
else | |
let sep_change = s:get_separator_change(group, right_group, self.overflow_group, sep_size, alt_sep_size) | |
endif | |
let right_group = group | |
let done = self.try_insert_title(self._right_title, group, self._right_position, sep_change, 0) | |
let self._right_title += done | |
2 0.000002 endif | |
2 0.000002 if !done | |
2 0.000003 break | |
endif | |
2 0.000004 endwhile | |
2 0.000003 if self._left_title >= self._first_title | |
if get(g:, 'airline#extensions#tabline#current_first', 0) | |
let self._left_position -= 1 | |
endif | |
call self.insert_section(self.overflow_group, overflow_marker, self._left_position) | |
let self._right_position += 1 | |
2 0.000002 endif | |
2 0.000003 if self._right_title <= self._last_title | |
call self.insert_section(self.overflow_group, overflow_marker, self._right_position) | |
2 0.000002 endif | |
2 0.000003 endif | |
2 0.009599 0.000020 return self._build() | |
FUNCTION <SNR>165_sh_autocmd_handler() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/fugitiveline.vim:36 | |
Called 2 times | |
Total time: 0.000022 | |
Self time: 0.000022 | |
count total (s) self (s) | |
2 0.000008 if exists('#airline') | |
2 0.000005 unlet! b:fugitive_name | |
2 0.000002 endif | |
FUNCTION airline#extensions#default#apply() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/default.vim:79 | |
Called 2 times | |
Total time: 0.002899 | |
Self time: 0.000216 | |
count total (s) self (s) | |
2 0.000007 let winnr = a:context.winnr | |
2 0.000006 let active = a:context.active | |
2 0.000043 0.000027 if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse)) | |
2 0.001105 0.000031 call s:build_sections(a:builder, a:context, s:layout[0]) | |
else | |
let text = !empty(s:get_section(winnr, 'c')) ? s:get_section(winnr, 'c') : ' %f%m ' | |
call a:builder.add_section('airline_c'.(a:context.bufnr), text) | |
2 0.000003 endif | |
2 0.000249 0.000032 call a:builder.split(s:get_section(winnr, 'gutter', '', '')) | |
2 0.000041 0.000024 if airline#util#getwinvar(winnr, 'airline_render_right', 1) | |
2 0.001387 0.000028 call s:build_sections(a:builder, a:context, s:layout[1]) | |
2 0.000003 endif | |
2 0.000004 return 1 | |
FUNCTION airline#util#stl_disabled() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:196 | |
Called 4 times | |
Total time: 0.000294 | |
Self time: 0.000202 | |
count total (s) self (s) | |
" setting the statusline is disabled, | |
" either globally, per window, or per buffer | |
" w:airline_disabled is deprecated! | |
4 0.000260 0.000168 return get(g:, 'airline_disable_statusline', 0) || airline#util#getwinvar(a:winnr, 'airline_disable_statusline', 0) || airline#util#getwinvar(a:winnr, 'airline_disabled', 0) || airline#util#getbufvar(winbufnr(a:winnr), 'airline_disable_statusline', 0) | |
FUNCTION vimwiki#vars#get_global() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/vars.vim:1604 | |
Called 6 times | |
Total time: 0.000044 | |
Self time: 0.000044 | |
count total (s) self (s) | |
" Return: wiki global variable | |
6 0.000023 return g:vimwiki_global_vars[a:key] | |
FUNCTION 78() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/buffers.vim:86 | |
Called 3 times | |
Total time: 0.000151 | |
Self time: 0.000071 | |
count total (s) self (s) | |
3 0.000007 let bufnum = get(self.buffers, a:i, -1) | |
3 0.000004 if bufnum == -1 | |
return '' | |
3 0.000003 endif | |
3 0.000098 0.000018 let group = airline#extensions#tabline#group_of_bufnr(self.tab_bufs, bufnum) | |
3 0.000005 if bufnum == bufnr('%') | |
3 0.000008 let s:current_modified = (group == 'airline_tabmod') ? 1 : 0 | |
3 0.000002 endif | |
3 0.000003 return group | |
FUNCTION 79() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/buffers.vim:109 | |
Called 1 time | |
Total time: 0.000137 | |
Self time: 0.000039 | |
count total (s) self (s) | |
1 0.000003 let bufnum = get(self.buffers, a:i, -1) | |
1 0.000054 0.000003 let group = self.get_group(a:i) | |
1 0.000051 0.000004 let pgroup = self.get_group(a:i - 1) | |
" always add a space when powerline_fonts are used | |
" or for the very first item | |
1 0.000002 if get(g:, 'airline_powerline_fonts', 0) || a:i == 0 | |
1 0.000001 let space = s:spc | |
else | |
let space= (pgroup == group ? s:spc : '') | |
1 0.000001 endif | |
1 0.000003 if get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0) | |
if len(s:number_map) > 0 | |
return space. s:get_number(a:i) . '%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)' . s:spc | |
else | |
return '['.(a:i+1).s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)'.']' | |
endif | |
1 0.000001 else | |
1 0.000003 return space.'%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)'.s:spc | |
endif | |
FUNCTION airline#update_tabline() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline.vim:301 | |
Called 9 times | |
Total time: 0.000110 | |
Self time: 0.000110 | |
count total (s) self (s) | |
9 0.000063 if get(g:, 'airline_statusline_ontop', 0) | |
call airline#extensions#tabline#redraw() | |
9 0.000008 endif | |
FUNCTION airline#extensions#tabline#formatters#unique_tail_improved#format() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/unique_tail_improved.vim:8 | |
Called 6 times | |
Total time: 0.000802 | |
Self time: 0.000113 | |
count total (s) self (s) | |
6 0.000033 if len(a:buffers) <= 1 " don't need to compare bufnames if has less than one buffer opened | |
6 0.000752 0.000063 return airline#extensions#tabline#formatters#default#format(a:bufnr, a:buffers) | |
endif | |
let curbuf_tail = fnamemodify(bufname(a:bufnr), ':t') | |
let do_deduplicate = 0 | |
let path_tokens = {} | |
for nr in a:buffers | |
let name = bufname(nr) | |
if !empty(name) && nr != a:bufnr && fnamemodify(name, ':t') == curbuf_tail " only perform actions if curbuf_tail isn't unique | |
let do_deduplicate = 1 | |
let tokens = reverse(split(substitute(fnamemodify(name, ':p:h'), '\\', '/', 'g'), '/')) | |
let token_index = 0 | |
for token in tokens | |
if token == '' | continue | endif | |
if token == '.' | break | endif | |
if !has_key(path_tokens, token_index) | |
let path_tokens[token_index] = {} | |
endif | |
let path_tokens[token_index][token] = 1 | |
let token_index += 1 | |
endfor | |
endif | |
endfor | |
if do_deduplicate == 1 | |
let path = [] | |
let token_index = 0 | |
for token in reverse(split(substitute(fnamemodify(bufname(a:bufnr), ':p:h'), '\\', '/', 'g'), '/')) | |
if token == '.' | break | endif | |
let duplicated = 0 | |
let uniq = 1 | |
let single = 1 | |
if has_key(path_tokens, token_index) | |
let duplicated = 1 | |
if len(keys(path_tokens[token_index])) > 1 | let single = 0 | endif | |
if has_key(path_tokens[token_index], token) | let uniq = 0 | endif | |
endif | |
call insert(path, {'token': token, 'duplicated': duplicated, 'uniq': uniq, 'single': single}) | |
let token_index += 1 | |
endfor | |
let buf_name = [curbuf_tail] | |
let has_uniq = 0 | |
let has_skipped = 0 | |
for token1 in reverse(path) | |
if !token1['duplicated'] && len(buf_name) > 1 | |
call insert(buf_name, s:skip_symbol) | |
let has_skipped = 0 | |
break | |
endif | |
if has_uniq == 1 | |
call insert(buf_name, s:skip_symbol) | |
let has_skipped = 0 | |
break | |
endif | |
if token1['uniq'] == 0 && token1['single'] == 1 | |
let has_skipped = 1 | |
else | |
if has_skipped == 1 | |
call insert(buf_name, s:skip_symbol) | |
let has_skipped = 0 | |
endif | |
call insert(buf_name, token1['token']) | |
endif | |
if token1['uniq'] == 1 | |
let has_uniq = 1 | |
endif | |
endfor | |
if has_skipped == 1 | |
call insert(buf_name, s:skip_symbol) | |
endif | |
return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, join(buf_name, '/')) | |
else | |
return airline#extensions#tabline#formatters#default#format(a:bufnr, a:buffers) | |
endif | |
FUNCTION airline#highlighter#get_highlight() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/highlighter.vim:68 | |
Called 304 times | |
Total time: 0.082539 | |
Self time: 0.029950 | |
count total (s) self (s) | |
" only check for the cterm reverse attribute | |
" TODO: do we need to check all modes (gui, term, as well)? | |
304 0.004606 let reverse = synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm') | |
304 0.001280 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 | |
304 0.000319 else | |
304 0.015642 0.002296 let ctermfg = s:get_syn(a:group, 'fg', 'cterm') | |
304 0.015049 0.002178 let ctermbg = s:get_syn(a:group, 'bg', 'cterm') | |
304 0.014353 0.002078 let guifg = s:get_syn(a:group, 'fg', 'gui') | |
304 0.014070 0.002114 let guibg = s:get_syn(a:group, 'bg', 'gui') | |
304 0.003397 let bold = synIDattr(synIDtrans(hlID(a:group)), 'bold') | |
304 0.000466 if reverse | |
let res = s:get_array(guibg, guifg, ctermbg, ctermfg, bold ? ['bold'] : a:000) | |
304 0.000356 else | |
304 0.004904 0.002763 let res = s:get_array(guifg, guibg, ctermfg, ctermbg, bold ? ['bold'] : a:000) | |
304 0.000311 endif | |
304 0.000268 endif | |
304 0.001040 let s:hl_groups[a:group] = res | |
304 0.000416 return res | |
FUNCTION 80() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/buffers.vim:86 | |
Called 3 times | |
Total time: 0.000160 | |
Self time: 0.000072 | |
count total (s) self (s) | |
3 0.000010 let bufnum = get(self.buffers, a:i, -1) | |
3 0.000005 if bufnum == -1 | |
return '' | |
3 0.000002 endif | |
3 0.000108 0.000020 let group = airline#extensions#tabline#group_of_bufnr(self.tab_bufs, bufnum) | |
3 0.000006 if bufnum == bufnr('%') | |
3 0.000009 let s:current_modified = (group == 'airline_tabmod') ? 1 : 0 | |
3 0.000003 endif | |
3 0.000003 return group | |
FUNCTION 81() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/buffers.vim:109 | |
Called 1 time | |
Total time: 0.000149 | |
Self time: 0.000044 | |
count total (s) self (s) | |
1 0.000003 let bufnum = get(self.buffers, a:i, -1) | |
1 0.000061 0.000004 let group = self.get_group(a:i) | |
1 0.000052 0.000004 let pgroup = self.get_group(a:i - 1) | |
" always add a space when powerline_fonts are used | |
" or for the very first item | |
1 0.000003 if get(g:, 'airline_powerline_fonts', 0) || a:i == 0 | |
1 0.000002 let space = s:spc | |
else | |
let space= (pgroup == group ? s:spc : '') | |
1 0.000000 endif | |
1 0.000002 if get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0) | |
if len(s:number_map) > 0 | |
return space. s:get_number(a:i) . '%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)' . s:spc | |
else | |
return '['.(a:i+1).s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)'.']' | |
endif | |
1 0.000001 else | |
1 0.000004 return space.'%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)'.s:spc | |
endif | |
FUNCTION FugitiveGitDir() | |
Defined: ~/vimfiles/plugged/vim-fugitive/plugin/fugitive.vim:18 | |
Called 14 times | |
Total time: 0.000762 | |
Self time: 0.000762 | |
count total (s) self (s) | |
14 0.000027 if v:version < 704 | |
return '' | |
14 0.000057 elseif !a:0 || type(a:1) == type(0) && a:1 < 0 || a:1 is# get(v:, 'true', -1) | |
14 0.000034 if exists('g:fugitive_event') | |
return g:fugitive_event | |
14 0.000016 endif | |
14 0.000054 let dir = get(b:, 'git_dir', '') | |
14 0.000169 if empty(dir) && (empty(bufname('')) || &buftype =~# '^\%(nofile\|acwrite\|quickfix\|terminal\|prompt\)$') | |
return FugitiveExtractGitDir(getcwd()) | |
14 0.000088 elseif (!exists('b:git_dir') || b:git_dir =~# s:bad_git_dir) && &buftype =~# '^\%(nowrite\)\=$' | |
let b:git_dir = FugitiveExtractGitDir(bufnr('')) | |
return b:git_dir | |
14 0.000014 endif | |
14 0.000059 return dir =~# s:bad_git_dir ? '' : dir | |
elseif type(a:1) == type(0) && a:1 isnot# 0 | |
if a:1 == bufnr('') && (!exists('b:git_dir') || b:git_dir =~# s:bad_git_dir) && &buftype =~# '^\%(nowrite\)\=$' | |
let b:git_dir = FugitiveExtractGitDir(a:1) | |
endif | |
let dir = getbufvar(a:1, 'git_dir') | |
return dir =~# s:bad_git_dir ? '' : dir | |
elseif type(a:1) == type('') | |
return substitute(s:Slash(a:1), '/$', '', '') | |
elseif type(a:1) == type({}) | |
return get(a:1, 'fugitive_dir', get(a:1, 'git_dir', '')) | |
else | |
return '' | |
endif | |
FUNCTION <SNR>164_update_untracked() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/branch.vim:202 | |
Called 14 times | |
Total time: 0.030924 | |
Self time: 0.030588 | |
count total (s) self (s) | |
14 0.015327 let file = expand("%:p") | |
14 0.013384 if empty(file) || isdirectory(file) || !empty(&buftype) | |
return | |
14 0.000027 endif | |
14 0.000063 let needs_update = 1 | |
14 0.000120 let vcs_checks = get(g:, "airline#extensions#branch#vcs_checks", ["untracked", "dirty"]) | |
42 0.000144 for vcs in keys(s:vcs_config) | |
28 0.000223 if file =~ s:vcs_config[vcs].exclude | |
" Skip check for files that live in the exclude directory | |
let needs_update = 0 | |
28 0.000034 endif | |
28 0.000105 if has_key(s:vcs_config[vcs].untracked, file) | |
14 0.000031 let needs_update = 0 | |
14 0.000698 0.000362 call airline#extensions#branch#update_untracked_config(file, vcs) | |
28 0.000031 endif | |
42 0.000077 endfor | |
14 0.000024 if !needs_update | |
14 0.000020 return | |
endif | |
for vcs in keys(s:vcs_config) | |
" only check, for git, if fugitive is installed | |
" and for 'hg' if lawrencium is installed, else skip | |
if vcs is# 'git' && (!airline#util#has_fugitive() && !airline#util#has_gina()) | |
continue | |
elseif vcs is# 'mercurial' && !airline#util#has_lawrencium() | |
continue | |
endif | |
let config = s:vcs_config[vcs] | |
" 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. | |
if index(vcs_checks, 'untracked') > -1 | |
call airline#async#vcs_untracked(config, file, vcs) | |
endif | |
" Check clean state of repo | |
if index(vcs_checks, 'dirty') > -1 | |
call airline#async#vcs_clean(config.dirty, file, vcs) | |
endif | |
endfor | |
FUNCTION 23() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/builder.vim:33 | |
Called 2 times | |
Total time: 0.000006 | |
Self time: 0.000006 | |
count total (s) self (s) | |
2 0.000005 return len(self._sections) | |
FUNCTION airline#extensions#tabline#get() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline.vim:169 | |
Called 4 times | |
Total time: 0.019148 | |
Self time: 0.000374 | |
count total (s) self (s) | |
4 0.000045 let show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1) | |
4 0.000020 let show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1) | |
4 0.000016 let curtabcnt = tabpagenr('$') | |
4 0.000016 if curtabcnt != s:current_tabcnt | |
let s:current_tabcnt = curtabcnt | |
call airline#extensions#tabline#tabs#invalidate() | |
call airline#extensions#tabline#buffers#invalidate() | |
call airline#extensions#tabline#ctrlspace#invalidate() | |
call airline#extensions#tabline#tabws#invalidate() | |
4 0.000009 endif | |
4 0.000038 if !exists('#airline#BufAdd#*') | |
autocmd airline BufAdd * call <sid>update_tabline(0) | |
4 0.000002 endif | |
4 0.000018 if !exists('#airline#SessionLoadPost') | |
autocmd airline SessionLoadPost * call <sid>update_tabline(1) | |
4 0.000005 endif | |
4 0.000006 if s:ctrlspace | |
return airline#extensions#tabline#ctrlspace#get() | |
4 0.000009 elseif s:tabws | |
return airline#extensions#tabline#tabws#get() | |
4 0.000015 elseif show_buffers && curtabcnt == 1 || !show_tabs | |
4 0.018815 0.000041 return airline#extensions#tabline#buffers#get() | |
else | |
return airline#extensions#tabline#tabs#get() | |
endif | |
FUNCTION <SNR>163_get_syn() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/highlighter.vim:44 | |
Called 1216 times | |
Total time: 0.050448 | |
Self time: 0.050448 | |
count total (s) self (s) | |
1216 0.001979 let color = '' | |
1216 0.011863 if hlexists(a:group) | |
1216 0.013950 let color = synIDattr(synIDtrans(hlID(a:group)), a:what, a:mode) | |
1216 0.001359 endif | |
1216 0.003224 if empty(color) || color == -1 | |
" should always exist | |
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, a:mode) | |
" however, just in case | |
if empty(color) || color == -1 | |
let color = 'NONE' | |
endif | |
1216 0.001080 endif | |
1216 0.001671 return color | |
FUNCTION <SNR>163_GetHiCmd() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/highlighter.vim:140 | |
Called 6 times | |
Total time: 0.000876 | |
Self time: 0.000876 | |
count total (s) self (s) | |
" a:list needs to have 5 items! | |
6 0.000008 let res = '' | |
6 0.000008 let i = -1 | |
36 0.000047 while i < 4 | |
30 0.000039 let i += 1 | |
30 0.000063 let item = get(a:list, i, '') | |
30 0.000035 if item is '' | |
6 0.000006 continue | |
24 0.000018 endif | |
24 0.000027 if i == 0 | |
6 0.000014 let res .= ' guifg='.item | |
18 0.000019 elseif i == 1 | |
5 0.000010 let res .= ' guibg='.item | |
13 0.000013 elseif i == 2 | |
6 0.000012 let res .= ' ctermfg='.item | |
7 0.000008 elseif i == 3 | |
5 0.000009 let res .= ' ctermbg='.item | |
2 0.000002 elseif i == 4 | |
2 0.000007 let res .= printf(' gui=%s cterm=%s term=%s', item, item, item) | |
24 0.000023 endif | |
30 0.000030 endwhile | |
6 0.000012 return res | |
FUNCTION airline#builder#get_prev_group() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/builder.vim:37 | |
Called 30 times | |
Total time: 0.000595 | |
Self time: 0.000595 | |
count total (s) self (s) | |
30 0.000075 let x = a:i - 1 | |
36 0.000062 while x >= 0 | |
28 0.000088 let group = a:sections[x][0] | |
28 0.000066 if group != '' && group != '|' | |
22 0.000047 return group | |
6 0.000006 endif | |
6 0.000010 let x = x - 1 | |
14 0.000018 endwhile | |
8 0.000012 return '' | |
FUNCTION airline#util#getwinvar() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:84 | |
Called 26 times | |
Total time: 0.000181 | |
Self time: 0.000181 | |
count total (s) self (s) | |
26 0.000137 return getwinvar(a:winnr, a:key, a:def) | |
FUNCTION airline#extensions#searchcount#apply() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/searchcount.vim:15 | |
Called 2 times | |
Total time: 0.000136 | |
Self time: 0.000060 | |
count total (s) self (s) | |
2 0.000133 0.000057 call airline#extensions#append_to_section('y', '%{v:hlsearch ? airline#extensions#searchcount#status() : ""}') | |
FUNCTION <SNR>58_GetLastHeartbeat() | |
Defined: ~/vimfiles/plugged/vim-wakatime/plugin/wakatime.vim:638 | |
Called 3 times | |
Total time: 0.000124 | |
Self time: 0.000124 | |
count total (s) self (s) | |
3 0.000018 if !s:last_heartbeat.last_activity_at || localtime() - s:last_heartbeat.last_activity_at > s:local_cache_expire | |
1 0.000012 if !filereadable(s:shared_state_file) | |
return {'last_activity_at': 0, 'last_heartbeat_at': 0, 'file': ''} | |
1 0.000001 endif | |
1 0.000023 let last = readfile(s:shared_state_file, '', 3) | |
1 0.000003 if len(last) == 3 | |
1 0.000005 let s:last_heartbeat.last_heartbeat_at = last[1] | |
1 0.000002 let s:last_heartbeat.file = last[2] | |
1 0.000001 endif | |
3 0.000003 endif | |
3 0.000004 return s:last_heartbeat | |
FUNCTION <SNR>164_config_fugitive_branch() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/branch.vim:99 | |
Called 14 times | |
Total time: 0.001584 | |
Self time: 0.000261 | |
count total (s) self (s) | |
14 0.001444 0.000121 let s:vcs_config['git'].branch = FugitiveHead(s:sha1size) | |
14 0.000050 if s:vcs_config['git'].branch is# 'master' && airline#util#winwidth() < 81 | |
" Shorten default a bit | |
let s:vcs_config['git'].branch='mas' | |
14 0.000017 endif | |
FUNCTION airline#extensions#tabline#group_of_bufnr() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline.vim:252 | |
Called 6 times | |
Total time: 0.000168 | |
Self time: 0.000168 | |
count total (s) self (s) | |
6 0.000015 let cur = bufnr('%') | |
6 0.000008 if cur == a:bufnr | |
6 0.000023 if g:airline_detect_modified && getbufvar(a:bufnr, '&modified') | |
3 0.000006 let group = 'airline_tabmod' | |
3 0.000003 else | |
3 0.000006 let group = 'airline_tabsel' | |
6 0.000006 endif | |
else | |
if g:airline_detect_modified && getbufvar(a:bufnr, '&modified') | |
let group = 'airline_tabmod_unsel' | |
elseif index(a:tab_bufs, a:bufnr) > -1 | |
let group = 'airline_tab' | |
else | |
let group = 'airline_tabhid' | |
endif | |
6 0.000005 endif | |
6 0.000007 return group | |
FUNCTION <SNR>216_get_separator_change() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim:68 | |
Called 4 times | |
Total time: 0.001291 | |
Self time: 0.000035 | |
count total (s) self (s) | |
4 0.001288 0.000032 return s:get_separator_change_with_end(a:new_group, a:old_group, a:end_group, a:end_group, a:sep_size, a:alt_sep_size) | |
FUNCTION vimwiki#base#normalize_link_helper() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/base.vim:2644 | |
Called 1 time | |
Total time: 0.000314 | |
Self time: 0.000094 | |
count total (s) self (s) | |
" Treat link string towards normalization | |
" [__LinkDescription__](__LinkUrl__.__FileExtension__) | |
1 0.000011 let url = matchstr(a:str, a:rxUrl) | |
1 0.000074 0.000010 if vimwiki#vars#get_wikilocal('syntax') ==# 'markdown' && vimwiki#vars#get_wikilocal('markdown_link_ext') | |
" Strip the extension if it exists so it doesn't get added multiple times | |
let url = substitute(url, '\'.vimwiki#vars#get_wikilocal('ext').'$', '', '') | |
1 0.000001 endif | |
1 0.000004 let descr = matchstr(a:str, a:rxDesc) | |
" Try to clean, do not work if bad link | |
1 0.000001 if descr ==# '' | |
1 0.000119 0.000016 let descr = s:clean_url(url) | |
1 0.000003 if descr ==# '' | return url | endif | |
1 0.000000 endif | |
" Substiture placeholders | |
1 0.000020 0.000009 let lnk = s:safesubstitute(a:template, '__LinkDescription__', descr, '') | |
1 0.000015 0.000006 let lnk = s:safesubstitute(lnk, '__LinkUrl__', url, '') | |
1 0.000035 0.000011 let file_extension = vimwiki#vars#get_wikilocal('ext', vimwiki#vars#get_bufferlocal('wiki_nr')) | |
1 0.000015 0.000006 let lnk = s:safesubstitute(lnk, '__FileExtension__', file_extension , '') | |
1 0.000002 return lnk | |
FUNCTION FugitiveHead() | |
Defined: ~/vimfiles/plugged/vim-fugitive/plugin/fugitive.vim:236 | |
Called 14 times | |
Total time: 0.001323 | |
Self time: 0.000561 | |
count total (s) self (s) | |
14 0.000123 if a:0 && (type(a:1) ==# type({}) || type(a:1) ==# type('') && a:1 !~# '^\d\+$') | |
let dir = FugitiveGitDir(a:1) | |
let arg = get(a:, 2, 0) | |
14 0.000022 elseif a:0 > 1 | |
let dir = FugitiveGitDir(a:2) | |
let arg = a:1 | |
14 0.000016 else | |
14 0.000857 0.000095 let dir = FugitiveGitDir() | |
14 0.000055 let arg = get(a:, 1, 0) | |
14 0.000015 endif | |
14 0.000030 if empty(dir) | |
14 0.000018 return '' | |
endif | |
return fugitive#Head(arg, dir) | |
FUNCTION airline#highlighter#highlight() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/highlighter.vim:255 | |
Called 4 times | |
Total time: 0.102855 | |
Self time: 0.013515 | |
count total (s) self (s) | |
4 0.000011 let bufnr = a:0 ? a:1 : '' | |
4 0.000015 let p = g:airline#themes#{g:airline_theme}#palette | |
" draw the base mode, followed by any overrides | |
4 0.000058 let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val') | |
4 0.000012 let suffix = a:modes[0] == 'inactive' ? '_inactive' : '' | |
4 0.000006 let airline_grouplist = [] | |
4 0.000015 let buffers_in_tabpage = sort(tabpagebuflist()) | |
4 0.000013 if exists("*uniq") | |
4 0.000014 let buffers_in_tabpage = uniq(buffers_in_tabpage) | |
4 0.000005 endif | |
" mapped might be something like ['normal', 'normal_modified'] | |
" if a group is in both modes available, only define the second | |
" that is how this was done previously overwrite the previous definition | |
13 0.000030 for mode in reverse(mapped) | |
9 0.000064 if exists('g:airline#themes#{g:airline_theme}#palette[mode]') | |
5 0.000017 let dict = g:airline#themes#{g:airline_theme}#palette[mode] | |
85 0.000211 for kvp in items(dict) | |
80 0.000211 let mode_colors = kvp[1] | |
80 0.000151 let name = kvp[0] | |
80 0.000253 if name is# 'airline_c' && !empty(bufnr) && suffix is# '_inactive' | |
let name = 'airline_c'.bufnr | |
80 0.000075 endif | |
" do not re-create highlighting for buffers that are no longer visible | |
" in the current tabpage | |
80 0.000527 if name =~# 'airline_c\d\+' | |
let bnr = matchstr(name, 'airline_c\zs\d\+') + 0 | |
if bnr > 0 && index(buffers_in_tabpage, bnr) == -1 | |
continue | |
endif | |
80 0.000382 elseif (name =~# '_to_') || (name[0:10] is# 'airline_tab' && !empty(suffix)) | |
" group will be redefined below at exec_separator | |
" or is not needed for tabline with '_inactive' suffix | |
" since active flag is 1 for builder) | |
40 0.000044 continue | |
40 0.000041 endif | |
40 0.000732 0.000299 if s:group_not_done(airline_grouplist, name.suffix) | |
36 0.018095 0.000352 call airline#highlighter#exec(name.suffix, mode_colors) | |
40 0.000043 endif | |
40 0.000121 if !has_key(p, 'accents') | |
" work around a broken installation | |
" shouldn't actually happen, p should always contain accents | |
continue | |
40 0.000038 endif | |
120 0.000299 for accent in keys(s:accents) | |
80 0.000256 if !has_key(p.accents, accent) | |
continue | |
80 0.000088 endif | |
80 0.000259 let colors = copy(mode_colors) | |
80 0.000295 if p.accents[accent][0] != '' | |
40 0.000128 let colors[0] = p.accents[accent][0] | |
80 0.000082 endif | |
80 0.000189 if p.accents[accent][2] != '' | |
40 0.000126 let colors[2] = p.accents[accent][2] | |
80 0.000074 endif | |
80 0.000180 if len(colors) >= 5 | |
80 0.000320 let colors[4] = get(p.accents[accent], 4, '') | |
else | |
call add(colors, get(p.accents[accent], 4, '')) | |
80 0.000078 endif | |
80 0.001806 0.000817 if s:group_not_done(airline_grouplist, name.suffix.'_'.accent) | |
72 0.034747 0.000758 call airline#highlighter#exec(name.suffix.'_'.accent, colors) | |
80 0.000083 endif | |
120 0.000136 endfor | |
45 0.000109 endfor | |
5 0.000016 if empty(s:separators) | |
" nothing to be done | |
continue | |
5 0.000005 endif | |
" TODO: optimize this | |
45 0.000100 for sep in items(s:separators) | |
" we cannot check, that the group already exists, else the separators | |
" might not be correctly defined. But perhaps we can skip above groups | |
" that match the '_to_' name, because they would be redefined here... | |
40 0.036694 0.000508 call <sid>exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix) | |
45 0.000059 endfor | |
9 0.000011 endif | |
13 0.000025 endfor | |
FUNCTION airline#builder#get_next_group() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/builder.vim:49 | |
Called 2 times | |
Total time: 0.000057 | |
Self time: 0.000057 | |
count total (s) self (s) | |
2 0.000004 let x = a:i + 1 | |
2 0.000004 let l = len(a:sections) | |
4 0.000005 while x < l | |
4 0.000010 let group = a:sections[x][0] | |
4 0.000008 if group != '' && group != '|' | |
2 0.000003 return group | |
2 0.000002 endif | |
2 0.000003 let x = x + 1 | |
2 0.000003 endwhile | |
return '' | |
FUNCTION airline#extensions#branch#head() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/branch.vim:249 | |
Called 14 times | |
Total time: 0.038722 | |
Self time: 0.002810 | |
count total (s) self (s) | |
14 0.000059 if !exists('b:buffer_vcs_config') | |
call s:init_buffer() | |
14 0.000015 endif | |
14 0.004856 0.000132 call s:update_branch() | |
14 0.031113 0.000189 call s:update_untracked() | |
14 0.000080 if exists('b:airline_head') && !empty(b:airline_head) | |
return b:airline_head | |
14 0.000015 endif | |
14 0.000024 let b:airline_head = '' | |
14 0.000064 let vcs_priority = get(g:, "airline#extensions#branch#vcs_priority", ["git", "mercurial"]) | |
14 0.000029 let heads = [] | |
42 0.000067 for vcs in vcs_priority | |
28 0.000098 if !empty(b:buffer_vcs_config[vcs].branch) | |
let heads += [vcs] | |
28 0.000027 endif | |
42 0.000045 endfor | |
14 0.000022 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 additional = b:buffer_vcs_config[vcs].untracked | |
if empty(additional) && has_key(b:buffer_vcs_config[vcs], 'dirty') && b:buffer_vcs_config[vcs].dirty | |
let additional = g:airline_symbols['dirty'] | |
endif | |
let b:airline_head .= additional | |
14 0.000020 endfor | |
14 0.000029 if empty(heads) | |
14 0.000295 0.000109 if airline#util#has_vcscommand() | |
noa call VCSCommandEnableBufferSetup() | |
if exists('b:VCSCommandBufferInfo') | |
let b:airline_head = s:format_name(get(b:VCSCommandBufferInfo, 0, '')) | |
endif | |
14 0.000018 endif | |
14 0.000014 endif | |
14 0.000029 if empty(heads) | |
14 0.000188 0.000110 if airline#util#has_custom_scm() | |
try | |
let Fn = function(g:airline#extensions#branch#custom_head) | |
let b:airline_head = Fn() | |
endtry | |
14 0.000013 endif | |
14 0.000014 endif | |
14 0.000045 if exists("g:airline#extensions#branch#displayed_head_limit") | |
let w:displayed_head_limit = g:airline#extensions#branch#displayed_head_limit | |
if strwidth(b:airline_head) > w:displayed_head_limit - 1 | |
let b:airline_head = airline#util#strcharpart(b:airline_head, 0, w:displayed_head_limit - 1) . (&encoding ==? 'utf-8' ? '…' : '.') | |
endif | |
14 0.000011 endif | |
14 0.000026 return b:airline_head | |
FUNCTION <SNR>179_get_seperator() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/builder.vim:155 | |
Called 10 times | |
Total time: 0.021366 | |
Self time: 0.000271 | |
count total (s) self (s) | |
10 0.007286 0.000117 if airline#builder#should_change_group(a:prev_group, a:group) | |
10 0.014057 0.000131 return s:get_transitioned_seperator(a:self, a:prev_group, a:group, a:side) | |
else | |
return a:side ? a:self._context.left_alt_sep : a:self._context.right_alt_sep | |
endif | |
FUNCTION <SNR>58_EnoughTimePassed() | |
Defined: ~/vimfiles/plugged/vim-wakatime/plugin/wakatime.vim:668 | |
Called 3 times | |
Total time: 0.000038 | |
Self time: 0.000038 | |
count total (s) self (s) | |
3 0.000009 let prev = a:last.last_heartbeat_at | |
3 0.000007 if a:now - prev > g:wakatime_HeartbeatFrequency * 60 | |
return s:true | |
3 0.000003 endif | |
3 0.000004 return s:false | |
FUNCTION airline#highlighter#highlight_modified_inactive() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/highlighter.vim:205 | |
Called 4 times | |
Total time: 0.002930 | |
Self time: 0.000205 | |
count total (s) self (s) | |
4 0.000032 if getbufvar(a:bufnr, '&modified') | |
1 0.000007 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 : [] | |
3 0.000005 else | |
3 0.000037 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.000007 endif | |
4 0.000009 if !empty(colors) | |
4 0.002779 0.000054 call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors) | |
4 0.000004 endif | |
FUNCTION <SNR>216_tabline_evaluated_length() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim:223 | |
Called 10 times | |
Total time: 0.000906 | |
Self time: 0.000121 | |
count total (s) self (s) | |
10 0.000896 0.000111 return airline#util#strchars(s:evaluate_tabline(a:tabline)) | |
FUNCTION airline#extensions#wordcount#formatters#default#update_fmt() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/wordcount/formatters/default.vim:6 | |
Called 2 times | |
Total time: 0.000040 | |
Self time: 0.000040 | |
count total (s) self (s) | |
2 0.000018 let s:fmt = get(g:, 'airline#extensions#wordcount#formatter#default#fmt', '%s words') | |
2 0.000015 let s:fmt_short = get(g:, 'airline#extensions#wordcount#formatter#default#fmt_short', s:fmt == '%s words' ? '%sW' : s:fmt) | |
FUNCTION airline#util#ignore_next_focusgain() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:206 | |
Called 14 times | |
Total time: 0.000162 | |
Self time: 0.000162 | |
count total (s) self (s) | |
14 0.000065 if has('win32') | |
" Setup an ignore for platforms that trigger FocusLost on calls to | |
" system(). macvim (gui and terminal) and Linux terminal vim do not. | |
let s:focusgained_ignore_time = localtime() | |
14 0.000013 endif | |
FUNCTION vimwiki#diary#get_diary_files() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/diary.vim:229 | |
Called 1 time | |
Total time: 6.560854 | |
Self time: 6.560745 | |
count total (s) self (s) | |
" Return: <list> diary file names | |
1 0.000003 let rx = '^\d\{4}-\d\d-\d\d' | |
1 6.531083 6.530974 let s_files = glob(vimwiki#vars#get_wikilocal('path'). vimwiki#vars#get_wikilocal('diary_rel_path').'*'.vimwiki#vars#get_wikilocal('ext')) | |
1 0.001359 let files = split(s_files, '\n') | |
1 0.011067 call filter(files, 'fnamemodify(v:val, ":t") =~# "'.escape(rx, '\').'"') | |
" remove backup files (.wiki~) | |
1 0.017326 call filter(files, 'v:val !~# ''.*\~$''') | |
1 0.000005 return files | |
FUNCTION airline#update_statusline() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline.vim:144 | |
Called 2 times | |
Total time: 0.027794 | |
Self time: 0.000234 | |
count total (s) self (s) | |
2 0.000259 0.000035 if airline#util#stl_disabled(winnr()) || airline#util#is_popup_window(winnr()) | |
return | |
2 0.000002 endif | |
" TODO: need to ignore popup windows here as well? | |
2 0.000025 let range = filter(range(1, winnr('$')), 'v:val != winnr()') | |
" create inactive statusline | |
2 0.000234 0.000034 call airline#update_statusline_inactive(range) | |
2 0.000005 unlet! w:airline_render_left w:airline_render_right | |
2 0.000025 exe 'unlet! ' 'w:airline_section_'. join(s:sections, ' w:airline_section_') | |
" Now create the active statusline | |
2 0.000005 let w:airline_active = 1 | |
2 0.000014 let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) } | |
2 0.000002 try | |
2 0.027180 0.000044 call s:invoke_funcrefs(context, g:airline_statusline_funcrefs) | |
catch /^Vim\%((\a\+)\)\=:E48:/ | |
" Catch: Sandbox mode | |
" no-op | |
2 0.000003 endtry | |
FUNCTION vimwiki#path#normalize() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/path.vim:50 | |
Called 2727 times | |
Total time: 0.072039 | |
Self time: 0.072039 | |
count total (s) self (s) | |
" Collapse Sections: like /a/b/../c to /a/c and /a/b/./c to /a/b/c | |
2727 0.003961 let path = a:path | |
2727 0.003192 while 1 | |
2727 0.025437 let intermediateResult = substitute(path, '/[^/]\+/\.\.', '', '') | |
2727 0.008932 let result = substitute(intermediateResult, '/\./', '/', '') | |
2727 0.003597 if result ==# path | |
2727 0.002451 break | |
endif | |
let path = result | |
2727 0.002620 endwhile | |
2727 0.003059 return result | |
FUNCTION airline#highlighter#exec() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/highlighter.vim:219 | |
Called 168 times | |
Total time: 0.076542 | |
Self time: 0.019274 | |
count total (s) self (s) | |
168 0.000378 if pumvisible() | |
return | |
168 0.000160 endif | |
168 0.000309 let colors = a:colors | |
168 0.000387 if len(colors) == 4 | |
56 0.000158 call add(colors, '') | |
168 0.000161 endif | |
" colors should always be string values | |
168 0.002987 let colors = map(copy(colors), 'type(v:val) != type("") ? string(v:val) : v:val') | |
168 0.000277 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, '')) | |
168 0.000173 endif | |
168 0.047261 0.001743 let old_hi = airline#highlighter#get_highlight(a:group) | |
168 0.001410 let new_hi = [colors[0], colors[1], printf('%s', colors[2]), printf('%s', colors[3]), colors[4]] | |
168 0.006857 0.001392 let colors = s:CheckDefined(colors) | |
168 0.006959 0.001550 if old_hi != new_hi || !s:hl_group_exists(a:group) | |
6 0.000919 0.000043 let cmd = printf('hi %s%s', a:group, s:GetHiCmd(colors)) | |
6 0.000008 try | |
6 0.000105 exe cmd | |
catch /^Vim\%((\a\+)\)\=:E421:/ " color definition not found | |
let group=matchstr(v:exception, '\w\+\ze=') | |
let color=matchstr(v:exception, '=\zs\w\+') | |
let cmd=substitute(cmd, color, 'grey', 'g') | |
exe cmd | |
call airline#util#warning('color definition for group ' . a:group . ' not found, using grey as fallback') | |
catch | |
call airline#util#warning('Error when running command: '. cmd) | |
6 0.000007 endtry | |
6 0.000018 if has_key(s:hl_groups, a:group) | |
6 0.000014 let s:hl_groups[a:group] = colors | |
6 0.000006 endif | |
168 0.000152 endif | |
FUNCTION <SNR>155_check_defined_section() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions.vim:48 | |
Called 2 times | |
Total time: 0.000039 | |
Self time: 0.000039 | |
count total (s) self (s) | |
2 0.000016 if !exists('w:airline_section_{a:name}') | |
2 0.000012 let w:airline_section_{a:name} = g:airline_section_{a:name} | |
2 0.000003 endif | |
FUNCTION <SNR>216_get_separator_change_with_end() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim:76 | |
Called 4 times | |
Total time: 0.001256 | |
Self time: 0.000121 | |
count total (s) self (s) | |
4 0.000005 let sep_change = 0 | |
4 0.000008 if !empty(a:new_end_group) " Separator between title and the end | |
2 0.001154 0.000019 let sep_change += airline#builder#should_change_group(a:new_group, a:new_end_group) ? a:sep_size : a:alt_sep_size | |
4 0.000005 endif | |
4 0.000010 if !empty(a:old_group) " Separator between the title and the one adjacent | |
let sep_change += airline#builder#should_change_group(a:new_group, a:old_group) ? a:sep_size : a:alt_sep_size | |
if !empty(a:old_end_group) " Remove mis-predicted separator | |
let sep_change -= airline#builder#should_change_group(a:old_group, a:old_end_group) ? a:sep_size : a:alt_sep_size | |
endif | |
4 0.000004 endif | |
4 0.000008 return sep_change | |
FUNCTION airline#builder#should_change_group() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/builder.vim:130 | |
Called 12 times | |
Total time: 0.008304 | |
Self time: 0.000508 | |
count total (s) self (s) | |
12 0.000031 if a:group1 == a:group2 | |
return 0 | |
12 0.000011 endif | |
12 0.004439 0.000147 let color1 = airline#highlighter#get_highlight(a:group1) | |
12 0.003645 0.000141 let color2 = airline#highlighter#get_highlight(a:group2) | |
12 0.000105 return color1[1] != color2[1] || color1[0] != color2[0] || color1[2] != color2[2] || color1[3] != color2[3] | |
FUNCTION airline#extensions#append_to_section() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions.vim:54 | |
Called 2 times | |
Total time: 0.000076 | |
Self time: 0.000037 | |
count total (s) self (s) | |
2 0.000062 0.000023 call <sid>check_defined_section(a:name) | |
2 0.000010 let w:airline_section_{a:name} .= a:value | |
FUNCTION <SNR>108_safesubstitute() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/base.vim:18 | |
Called 3 times | |
Total time: 0.000029 | |
Self time: 0.000029 | |
count total (s) self (s) | |
" Substitute regexp but do not interpret replace | |
3 0.000007 let escaped = escape(a:replace, '\&') | |
3 0.000014 return substitute(a:text, a:search, escaped, a:mode) | |
FUNCTION airline#util#is_popup_window() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:214 | |
Called 2 times | |
Total time: 0.000030 | |
Self time: 0.000030 | |
count total (s) self (s) | |
" Keep the statusline active if it's a popup window | |
2 0.000008 if exists('*win_gettype') | |
2 0.000014 return win_gettype(a:winnr) ==# 'popup' || win_gettype(a:winnr) ==# 'autocmd' | |
else | |
return getwinvar(a:winnr, '&buftype', '') ==# 'popup' | |
endif | |
FUNCTION <SNR>163_hl_group_exists() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/highlighter.vim:99 | |
Called 162 times | |
Total time: 0.005409 | |
Self time: 0.005409 | |
count total (s) self (s) | |
162 0.001837 if !hlexists(a:group) | |
return 0 | |
162 0.002084 elseif empty(synIDattr(synIDtrans(hlID(a:group)), 'fg')) | |
return 0 | |
162 0.000195 endif | |
162 0.000192 return 1 | |
FUNCTION vimwiki#vars#get_bufferlocal() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/vars.vim:1562 | |
Called 20 times | |
Total time: 0.000353 | |
Self time: 0.000353 | |
count total (s) self (s) | |
" Return: buffer local variable | |
" for the buffer we are currently in or for the given buffer (number or name). | |
" Populate the variable, if it doesn't exist. | |
20 0.000042 let buffer = a:0 ? a:1 : '%' | |
" 'get(getbufvar(...' handles vim < v7.3.831 that didn't allow a default value for getbufvar | |
20 0.000119 let value = get(getbufvar(buffer, ''), 'vimwiki_'.a:key, '/\/\') | |
20 0.000047 if type(value) != 1 || value !=# '/\/\' | |
20 0.000023 return value | |
elseif a:key ==# 'wiki_nr' | |
call setbufvar(buffer, 'vimwiki_wiki_nr', vimwiki#base#find_wiki(expand('%:p'))) | |
elseif a:key ==# 'subdir' | |
call setbufvar(buffer, 'vimwiki_subdir', vimwiki#base#current_subdir()) | |
elseif a:key ==# 'invsubdir' | |
let subdir = vimwiki#vars#get_bufferlocal('subdir') | |
call setbufvar(buffer, 'vimwiki_invsubdir', vimwiki#base#invsubdir(subdir)) | |
elseif a:key ==# 'existing_wikifiles' | |
call setbufvar(buffer, 'vimwiki_existing_wikifiles', vimwiki#base#get_wikilinks(vimwiki#vars#get_bufferlocal('wiki_nr'), 1, '')) | |
elseif a:key ==# 'existing_wikidirs' | |
call setbufvar(buffer, 'vimwiki_existing_wikidirs', vimwiki#base#get_wiki_directories(vimwiki#vars#get_bufferlocal('wiki_nr'))) | |
elseif a:key ==# 'prev_links' | |
call setbufvar(buffer, 'vimwiki_prev_links', []) | |
elseif a:key ==# 'markdown_refs' | |
call setbufvar(buffer, 'vimwiki_markdown_refs', vimwiki#markdown_base#scan_reflinks()) | |
else | |
call vimwiki#u#echo('unknown buffer variable ' . string(a:key)) | |
endif | |
return getbufvar(buffer, 'vimwiki_'.a:key) | |
FUNCTION <SNR>79_on_cursor_moved() | |
Defined: ~/vimfiles/plugged/vim-airline/plugin/airline.vim:87 | |
Called 3 times | |
Total time: 0.000067 | |
Self time: 0.000044 | |
count total (s) self (s) | |
3 0.000016 if winnr() != s:active_winnr || !exists('w:airline_active') | |
call s:on_window_changed('CursorMoved') | |
3 0.000003 endif | |
3 0.000036 0.000013 call airline#update_tabline() | |
FUNCTION airline#extensions#tabline#formatters#default#wrap_name() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/default.vim:34 | |
Called 6 times | |
Total time: 0.000220 | |
Self time: 0.000220 | |
count total (s) self (s) | |
6 0.000029 let buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ') | |
6 0.000025 let buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0) | |
6 0.000035 let _ = buf_nr_show ? printf(buf_nr_format, a:bufnr) : '' | |
6 0.000037 let _ .= substitute(a:buffer_name, '\\', '/', 'g') | |
6 0.000025 if getbufvar(a:bufnr, '&modified') == 1 | |
2 0.000004 let _ .= g:airline_symbols.modified | |
6 0.000007 endif | |
6 0.000010 return _ | |
FUNCTION airline#extensions#tabline#formatters#default#format() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/default.vim:7 | |
Called 6 times | |
Total time: 0.000689 | |
Self time: 0.000469 | |
count total (s) self (s) | |
6 0.000025 let fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0) | |
6 0.000019 let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.') | |
6 0.000008 let _ = '' | |
6 0.000026 let name = bufname(a:bufnr) | |
6 0.000015 if empty(name) | |
let _ = '[No Name]' | |
6 0.000046 elseif name =~ 'term://' | |
" Neovim Terminal | |
let _ = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '') | |
6 0.000006 else | |
6 0.000018 if get(g:, 'airline#extensions#tabline#fnamecollapse', 1) | |
" Does not handle non-ascii characters like Cyrillic: 'D/Учёба/t.c' | |
"let _ .= substitute(fnamemodify(name, fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g') | |
6 0.000029 let _ = pathshorten(fnamemodify(name, fmod)) | |
else | |
let _ = fnamemodify(name, fmod) | |
6 0.000019 endif | |
6 0.000028 if a:bufnr != bufnr('%') && fnametruncate && strlen(_) > fnametruncate | |
let _ = airline#util#strcharpart(_, 0, fnametruncate) | |
6 0.000007 endif | |
6 0.000006 endif | |
6 0.000296 0.000076 return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _) | |
FUNCTION airline#update_statusline_focuslost() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline.vim:169 | |
Called 2 times | |
Total time: 0.000063 | |
Self time: 0.000063 | |
count total (s) self (s) | |
2 0.000021 if get(g:, 'airline_focuslost_inactive', 0) | |
let bufnr=bufnr('%') | |
call airline#highlighter#highlight_modified_inactive(bufnr) | |
call airline#highlighter#highlight(['inactive'], bufnr) | |
call airline#update_statusline_inactive(range(1, winnr('$'))) | |
2 0.000003 endif | |
FUNCTION airline#extensions#quickfix#apply() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/quickfix.vim:14 | |
Called 2 times | |
Total time: 0.000032 | |
Self time: 0.000032 | |
count total (s) self (s) | |
2 0.000008 if &buftype == 'quickfix' | |
let w:airline_section_a = airline#extensions#quickfix#get_type() | |
let w:airline_section_b = '%{get(w:, "quickfix_title", "")}' | |
let w:airline_section_c = '' | |
let w:airline_section_x = '' | |
2 0.000002 endif | |
FUNCTION airline#util#strchars() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:121 | |
Called 10 times | |
Total time: 0.000059 | |
Self time: 0.000059 | |
count total (s) self (s) | |
10 0.000016 if s:has_strchars | |
10 0.000022 return strchars(a:str) | |
else | |
return strlen(substitute(a:str, '.', 'a', 'g')) | |
endif | |
FUNCTION vimwiki#base#replacestr_at_cursor() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/base.vim:1188 | |
Called 1 time | |
Total time: 0.000056 | |
Self time: 0.000056 | |
count total (s) self (s) | |
" Replace next 1. wikiRX by 2. sub | |
" Gather: cursor info | |
1 0.000002 let col = col('.') - 1 | |
1 0.000003 let line = getline('.') | |
1 0.000001 let ebeg = -1 | |
1 0.000004 let cont = match(line, a:wikiRX, 0) | |
" Find: link | |
1 0.000003 while (ebeg >= 0 || (0 <= cont) && (cont <= col)) | |
1 0.000003 let contn = matchend(line, a:wikiRX, cont) | |
1 0.000002 if (cont <= col) && (col < contn) | |
1 0.000003 let ebeg = match(line, a:wikiRX, cont) | |
1 0.000002 let elen = contn - ebeg | |
1 0.000001 break | |
else | |
let cont = match(line, a:wikiRX, contn) | |
endif | |
1 0.000001 endwhile | |
" Replace: by sub | |
1 0.000001 if ebeg >= 0 | |
" TODO: There might be problems with Unicode chars... | |
1 0.000004 let newline = strpart(line, 0, ebeg).a:sub.strpart(line, ebeg+elen) | |
1 0.000009 call setline(line('.'), newline) | |
1 0.000001 endif | |
FUNCTION <SNR>181_get_section() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/default.vim:20 | |
Called 14 times | |
Total time: 0.001156 | |
Self time: 0.000881 | |
count total (s) self (s) | |
14 0.000066 if has_key(s:section_truncate_width, a:key) | |
8 0.000268 0.000084 if airline#util#winwidth(a:winnr) < s:section_truncate_width[a:key] | |
return '' | |
8 0.000010 endif | |
14 0.000016 endif | |
14 0.000044 let spc = g:airline_symbols.space | |
14 0.000072 if !exists('g:airline_section_{a:key}') | |
return '' | |
14 0.000024 endif | |
14 0.000288 0.000197 let text = airline#util#getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key}) | |
14 0.000102 let [prefix, suffix] = [get(a:000, 0, '%('.spc), get(a:000, 1, spc.'%)')] | |
14 0.000078 return empty(text) ? '' : prefix.text.suffix | |
FUNCTION airline#extensions#wordcount#apply() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/wordcount.vim:93 | |
Called 2 times | |
Total time: 0.000123 | |
Self time: 0.000123 | |
count total (s) self (s) | |
2 0.000034 let filetypes = get(g:, 'airline#extensions#wordcount#filetypes', ['asciidoc', 'help', 'mail', 'markdown', 'nroff', 'org', 'rst', 'plaintex', 'tex', 'text']) | |
" export current filetypes settings to global namespace | |
2 0.000005 let g:airline#extensions#wordcount#filetypes = filetypes | |
" Check if filetype needs testing | |
2 0.000004 if did_filetype() | |
" correctly test for compound filetypes (e.g. markdown.pandoc) | |
let ft = substitute(&filetype, '\.', '\\|', 'g') | |
" Select test based on type of "filetypes": new=list, old=string | |
if type(filetypes) == get(v:, 't_list', type([])) ? match(filetypes, '\<'. ft. '\>') > -1 || index(filetypes, 'all') > -1 : match(&filetype, filetypes) > -1 | |
let b:airline_changedtick = -1 | |
call s:update_wordcount(1) " force update: ensures initial worcount exists | |
elseif exists('b:airline_wordcount') " cleanup when filetype is removed | |
unlet b:airline_wordcount | |
endif | |
2 0.000003 endif | |
2 0.000007 if exists('b:airline_wordcount') | |
call airline#extensions#prepend_to_section( 'z', '%{airline#extensions#wordcount#get()}') | |
2 0.000002 endif | |
FUNCTION <SNR>216_evaluate_tabline() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim:209 | |
Called 10 times | |
Total time: 0.000726 | |
Self time: 0.000455 | |
count total (s) self (s) | |
10 0.000018 let tabline = a:tabline | |
10 0.000349 0.000078 let tabline = substitute(tabline, '%{\([^}]\+\)}', '\=eval(submatch(1))', 'g') | |
10 0.000052 let tabline = substitute(tabline, '%#[^#]\+#', '', 'g') | |
10 0.000041 let tabline = substitute(tabline, '%(\([^)]\+\)%)', '\1', 'g') | |
10 0.000037 let tabline = substitute(tabline, '%\d\+[TX]', '', 'g') | |
10 0.000033 let tabline = substitute(tabline, '%=', '', 'g') | |
10 0.000030 let tabline = substitute(tabline, '%\d*\*', '', 'g') | |
10 0.000057 if has('tablineat') | |
let tabline = substitute(tabline, '%@[^@]\+@', '', 'g') | |
10 0.000009 endif | |
10 0.000016 return tabline | |
FUNCTION vimwiki#markdown_base#normalize_link() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/markdown_base.vim:112 | |
Called 1 time | |
Total time: 6.650229 | |
Self time: 0.000010 | |
count total (s) self (s) | |
" TODO mutualize with base | |
1 6.650228 0.000009 call s:normalize_link_syntax_n() | |
FUNCTION airline#extensions#tabline#builder#new() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim:227 | |
Called 2 times | |
Total time: 0.000078 | |
Self time: 0.000032 | |
count total (s) self (s) | |
2 0.000059 0.000013 let builder = airline#builder#new(a:context) | |
2 0.000004 let builder._build = builder.build | |
2 0.000008 call extend(builder, s:prototype, 'force') | |
2 0.000003 return builder | |
FUNCTION airline#extensions#tabline#buffers#get() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/buffers.vim:51 | |
Called 4 times | |
Total time: 0.018774 | |
Self time: 0.000591 | |
count total (s) self (s) | |
4 0.000006 try | |
4 0.001970 0.000081 call <sid>map_keys() | |
catch | |
" no-op | |
4 0.000005 endtry | |
4 0.000019 let cur = bufnr('%') | |
4 0.000015 if cur == s:current_bufnr && &columns == s:column_width | |
4 0.000023 if !g:airline_detect_modified || getbufvar(cur, '&modified') == s:current_modified | |
2 0.000003 return s:current_tabline | |
2 0.000001 endif | |
2 0.000002 endif | |
2 0.000169 0.000015 let b = airline#extensions#tabline#new_builder() | |
2 0.000006 let tab_bufs = tabpagebuflist(tabpagenr()) | |
2 0.000004 let show_buf_label_first = 0 | |
2 0.000009 if get(g:, 'airline#extensions#tabline#buf_label_first', 0) | |
let show_buf_label_first = 1 | |
2 0.000002 endif | |
2 0.000002 if show_buf_label_first | |
call airline#extensions#tabline#add_label(b, 'buffers', 0) | |
2 0.000002 endif | |
2 0.000005 let b.tab_bufs = tabpagebuflist(tabpagenr()) | |
2 0.000003 let b.overflow_group = 'airline_tabhid' | |
2 0.000057 0.000040 let b.buffers = airline#extensions#tabline#buflist#list() | |
2 0.000005 if get(g:, 'airline#extensions#tabline#current_first', 0) | |
if index(b.buffers, cur) > -1 | |
call remove(b.buffers, index(b.buffers, cur)) | |
endif | |
let b.buffers = [cur] + b.buffers | |
2 0.000001 endif | |
2 0.000005 function! b.get_group(i) dict | |
let bufnum = get(self.buffers, a:i, -1) | |
if bufnum == -1 | |
return '' | |
endif | |
let group = airline#extensions#tabline#group_of_bufnr(self.tab_bufs, bufnum) | |
if bufnum == bufnr('%') | |
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0 | |
endif | |
return group | |
endfunction | |
2 0.000010 if has("tablineat") | |
function! b.get_pretitle(i) dict | |
let bufnum = get(self.buffers, a:i, -1) | |
return '%'.bufnum.'@airline#extensions#tabline#buffers#clickbuf@' | |
endfunction | |
function! b.get_posttitle(i) dict | |
return '%X' | |
endfunction | |
2 0.000001 endif | |
2 0.000003 function! b.get_title(i) dict | |
let bufnum = get(self.buffers, a:i, -1) | |
let group = self.get_group(a:i) | |
let pgroup = self.get_group(a:i - 1) | |
" always add a space when powerline_fonts are used | |
" or for the very first item | |
if get(g:, 'airline_powerline_fonts', 0) || a:i == 0 | |
let space = s:spc | |
else | |
let space= (pgroup == group ? s:spc : '') | |
endif | |
if get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0) | |
if len(s:number_map) > 0 | |
return space. s:get_number(a:i) . '%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)' . s:spc | |
else | |
return '['.(a:i+1).s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)'.']' | |
endif | |
else | |
return space.'%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)'.s:spc | |
endif | |
endfunction | |
2 0.000010 let current_buffer = max([index(b.buffers, cur), 0]) | |
2 0.000005 let last_buffer = len(b.buffers) - 1 | |
2 0.000051 0.000010 call b.insert_titles(current_buffer, 0, last_buffer) | |
2 0.000019 0.000009 call b.add_section('airline_tabfill', '') | |
2 0.000016 0.000006 call b.split() | |
2 0.000014 0.000007 call b.add_section('airline_tabfill', '') | |
2 0.000004 if !show_buf_label_first | |
2 0.000033 0.000014 call airline#extensions#tabline#add_label(b, 'buffers', 1) | |
2 0.000002 endif | |
2 0.000050 0.000011 call airline#extensions#tabline#add_tab_label(b) | |
2 0.000003 let s:current_bufnr = cur | |
2 0.000004 let s:column_width = &columns | |
2 0.016017 0.000020 let s:current_tabline = b.build() | |
2 0.000014 let s:current_visible_buffers = copy(b.buffers) | |
" Do not remove from s:current_visible_buffers, this breaks s:select_tab() | |
"if b._right_title <= last_buffer | |
" call remove(s:current_visible_buffers, b._right_title, last_buffer) | |
"endif | |
"if b._left_title > 0 | |
" call remove(s:current_visible_buffers, 0, b._left_title) | |
"endif | |
2 0.000004 return s:current_tabline | |
FUNCTION <SNR>163_group_not_done() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/highlighter.vim:32 | |
Called 120 times | |
Total time: 0.001422 | |
Self time: 0.001422 | |
count total (s) self (s) | |
120 0.000466 if index(a:list, a:name) == -1 | |
108 0.000352 call add(a:list, a:name) | |
108 0.000156 return 1 | |
12 0.000009 else | |
12 0.000022 if &vbs | |
echomsg printf("airline: group: %s already done, skipping", a:name) | |
12 0.000009 endif | |
12 0.000013 return 0 | |
endif | |
FUNCTION <SNR>171_map_keys() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline/buffers.vim:195 | |
Called 4 times | |
Total time: 0.001889 | |
Self time: 0.001889 | |
count total (s) self (s) | |
4 0.000025 let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 1) | |
4 0.000009 if bidx_mode > 0 | |
4 0.000007 if bidx_mode == 1 | |
44 0.000115 for i in range(1, 10) | |
40 0.001349 exe printf('noremap <silent> <Plug>AirlineSelectTab%d :call <SID>select_tab(%d)<CR>', i%10, i-1) | |
44 0.000070 endfor | |
else | |
let start_idx = bidx_mode == 2 ? 11 : 1 | |
for i in range(start_idx, 99) | |
exe printf('noremap <silent> <Plug>AirlineSelectTab%02d :call <SID>select_tab(%d)<CR>', i, i-start_idx) | |
endfor | |
4 0.000007 endif | |
4 0.000088 noremap <silent> <Plug>AirlineSelectPrevTab :<C-u>call <SID>jump_to_tab(-v:count1)<CR> | |
4 0.000068 noremap <silent> <Plug>AirlineSelectNextTab :<C-u>call <SID>jump_to_tab(v:count1)<CR> | |
" Enable this for debugging | |
" com! AirlineBufferList :echo map(copy(s:current_visible_buffers), {i,k -> k.": ".bufname(k)}) | |
4 0.000005 endif | |
FUNCTION <SNR>179_get_transitioned_seperator() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/builder.vim:140 | |
Called 16 times | |
Total time: 0.020503 | |
Self time: 0.000906 | |
count total (s) self (s) | |
16 0.000036 let line = '' | |
16 0.000132 if get(a:self._context, 'tabline', 0) && get(g:, 'airline#extensions#tabline#alt_sep', 0) && a:group ==# 'airline_tabsel' && a:side | |
call airline#highlighter#add_separator(a:prev_group, a:group, 0) | |
let line .= '%#'.a:prev_group.'_to_'.a:group.'#' | |
let line .= a:self._context.right_sep.'%#'.a:group.'#' | |
16 0.000016 else | |
16 0.019813 0.000216 call airline#highlighter#add_separator(a:prev_group, a:group, a:side) | |
16 0.000099 let line .= '%#'.a:prev_group.'_to_'.a:group.'#' | |
16 0.000074 let line .= a:side ? a:self._context.left_sep : a:self._context.right_sep | |
16 0.000034 let line .= '%#'.a:group.'#' | |
16 0.000014 endif | |
16 0.000020 return line | |
FUNCTION airline#statusline() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline.vim:218 | |
Called 14 times | |
Total time: 0.000321 | |
Self time: 0.000321 | |
count total (s) self (s) | |
14 0.000163 if has_key(s:contexts, a:winnr) | |
14 0.000108 return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line | |
endif | |
" in rare circumstances this happens...see #276 | |
return '' | |
FUNCTION <SNR>181_build_sections() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/default.vim:35 | |
Called 4 times | |
Total time: 0.002433 | |
Self time: 0.000478 | |
count total (s) self (s) | |
16 0.000100 for key in a:keys | |
12 0.000053 if (key == 'warning' || key == 'error') && !a:context.active | |
continue | |
12 0.000018 endif | |
12 0.002125 0.000170 call s:add_section(a:builder, a:context, key) | |
16 0.000022 endfor | |
FUNCTION airline#extensions#apply() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions.vim:72 | |
Called 2 times | |
Total time: 0.000418 | |
Self time: 0.000256 | |
count total (s) self (s) | |
2 0.000013 let filetype_overrides = get(s:, 'filetype_overrides', {}) | |
2 0.000012 call extend(filetype_overrides, get(g:, 'airline_filetype_overrides', {}), 'force') | |
2 0.000182 0.000020 if s:is_excluded_window() | |
return -1 | |
2 0.000002 endif | |
2 0.000006 if &buftype == 'terminal' | |
let w:airline_section_x = '' | |
let w:airline_section_y = '' | |
2 0.000002 endif | |
2 0.000008 if &previewwindow && empty(get(w:, 'airline_section_a', '')) | |
let w:airline_section_a = 'Preview' | |
let w:airline_section_b = '' | |
let w:airline_section_c = bufname(winbufnr(winnr())) | |
2 0.000005 endif | |
2 0.000052 if has_key(filetype_overrides, &ft) && ((&filetype == 'help' && &buftype == 'help') || &filetype !~ 'help') | |
" for help files only override it, if the buftype is also of type 'help', | |
" else it would trigger when editing Vim help files | |
let args = filetype_overrides[&ft] | |
call airline#extensions#apply_left_override(args[0], args[1]) | |
2 0.000004 endif | |
2 0.000006 if &buftype == 'help' | |
let w:airline_section_x = '' | |
let w:airline_section_y = '' | |
let w:airline_render_right = 1 | |
2 0.000002 endif | |
2 0.000009 for item in items(s:filetype_regex_overrides) | |
if match(&ft, item[0]) >= 0 | |
call airline#extensions#apply_left_override(item[1][0], item[1][1]) | |
endif | |
2 0.000004 endfor | |
FUNCTION vimwiki#base#is_diary_file() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/base.vim:2629 | |
Called 1 time | |
Total time: 6.648361 | |
Self time: 0.014885 | |
count total (s) self (s) | |
" Check if 1.filename is a diary file | |
" An optional second argument allows you to pass in a list of diary files rather | |
" than generating a list on each call to the function. | |
1 6.562433 0.000996 let l:diary_file_paths = a:0 > 0 ? a:1 : vimwiki#diary#get_diary_files() | |
1 0.082543 0.010504 let l:normalised_file_paths = map(l:diary_file_paths, 'vimwiki#path#normalize(v:val)') | |
" Escape single quote (Issue #886) | |
1 0.000004 let filename = substitute(a:filename, "'", "''", 'g') | |
1 0.003367 let l:matching_files = filter(l:normalised_file_paths, "v:val ==# '" . filename . "'" ) | |
1 0.000004 return len(l:matching_files) > 0 " filename is a diary file if match is found | |
FUNCTION vimwiki#base#follow_link() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/base.vim:1627 | |
Called 1 time | |
Total time: 6.651241 | |
Self time: 0.000286 | |
count total (s) self (s) | |
" Jump to link target (Enter press, Exported) | |
1 0.000007 let reuse_other_split_window = a:0 >= 1 ? a:1 : 0 | |
1 0.000002 let move_cursor_to_new_window = a:0 >= 2 ? a:2 : 1 | |
" Parse link at cursor and pass to VimwikiLinkHandler, or failing that, the | |
" default open_link handler | |
" Try WikiLink | |
1 0.000253 0.000050 let lnk = matchstr(vimwiki#base#matchstr_at_cursor(vimwiki#vars#get_syntaxlocal('rxWikiLink')), vimwiki#vars#get_syntaxlocal('rxWikiLinkMatchUrl')) | |
" Try WikiIncl | |
1 0.000002 if lnk ==? '' | |
1 0.000087 0.000040 let lnk = matchstr(vimwiki#base#matchstr_at_cursor(vimwiki#vars#get_global('rxWikiIncl')), vimwiki#vars#get_global('rxWikiInclMatchUrl')) | |
1 0.000001 endif | |
" Try Weblink | |
1 0.000002 if lnk ==? '' | |
1 0.000232 0.000032 let lnk = matchstr(vimwiki#base#matchstr_at_cursor(vimwiki#vars#get_syntaxlocal('rxWeblink')), vimwiki#vars#get_syntaxlocal('rxWeblinkMatchUrl')) | |
1 0.000001 endif | |
" Try markdown image ![]() | |
1 0.000035 0.000007 if vimwiki#vars#get_wikilocal('syntax') ==# 'markdown' && lnk ==# '' | |
1 0.000175 0.000025 let lnk = matchstr(vimwiki#base#matchstr_at_cursor(vimwiki#vars#get_syntaxlocal('rxImage')), vimwiki#vars#get_syntaxlocal('rxWeblinkMatchUrl')) | |
1 0.000002 if lnk !=# '' | |
if lnk !~# '\%(\%('.vimwiki#vars#get_global('schemes_web').'\):\%(\/\/\)\?\)\S\{-1,}' | |
" prepend file: scheme so link is opened by sytem handler if it isn't a web url | |
let lnk = 'file:'.lnk | |
endif | |
1 0.000000 endif | |
1 0.000001 endif | |
" If cursor is indeed on a link | |
1 0.000002 if lnk !=? '' | |
let processed_by_user_defined_handler = VimwikiLinkHandler(lnk) | |
if processed_by_user_defined_handler | |
return | |
endif | |
if a:split ==# 'hsplit' | |
let cmd = ':split ' | |
elseif a:split ==# 'vsplit' | |
let cmd = ':vsplit ' | |
elseif a:split ==# 'badd' | |
let cmd = ':badd ' | |
elseif a:split ==# 'tab' | |
let cmd = ':tabnew ' | |
elseif a:split ==# 'tabdrop' | |
" Use tab drop if we've already got the file open in an existing tab | |
let cmd = ':tab drop ' | |
else | |
" Same as above - doing this by default reduces incidence of multiple | |
" tabs with the same file. We default to :e just in case :drop doesn't | |
" exist in the current build. | |
let cmd = ':e ' | |
if exists(':drop') | |
let cmd = ':drop ' | |
endif | |
endif | |
" if we want to and can reuse a split window, jump to that window and open | |
" the new file there | |
if (a:split ==# 'hsplit' || a:split ==# 'vsplit') && reuse_other_split_window | |
let previous_window_nr = winnr('#') | |
if previous_window_nr > 0 && previous_window_nr != winnr() | |
execute previous_window_nr . 'wincmd w' | |
let cmd = ':e' | |
endif | |
endif | |
if vimwiki#vars#get_wikilocal('syntax') ==# 'markdown' | |
let processed_by_markdown_reflink = vimwiki#markdown_base#open_reflink(lnk) | |
if processed_by_markdown_reflink | |
return | |
endif | |
endif | |
let current_tab_page = tabpagenr() | |
call vimwiki#base#open_link(cmd, lnk) | |
if !move_cursor_to_new_window | |
if (a:split ==# 'hsplit' || a:split ==# 'vsplit') | |
execute 'wincmd p' | |
elseif a:split ==# 'tab' | |
execute 'tabnext ' . current_tab_page | |
endif | |
endif | |
" Else cursor is not on a link | |
1 0.000001 else | |
1 0.000001 if a:0 >= 3 | |
execute 'normal! '.a:3 | |
1 0.000009 0.000005 elseif vimwiki#vars#get_global('create_link') | |
1 6.650332 0.000009 call vimwiki#base#normalize_link(0) | |
1 0.000001 endif | |
1 0.000001 endif | |
FUNCTION airline#util#has_lawrencium() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:160 | |
Called 14 times | |
Total time: 0.000156 | |
Self time: 0.000156 | |
count total (s) self (s) | |
14 0.000054 if !exists("s:has_lawrencium") | |
let s:has_lawrencium = exists('*lawrencium#statusline') | |
14 0.000015 endif | |
14 0.000025 return s:has_lawrencium | |
FUNCTION <SNR>164_sh_autocmd_handler() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/branch.vim:356 | |
Called 2 times | |
Total time: 0.000038 | |
Self time: 0.000038 | |
count total (s) self (s) | |
2 0.000013 if exists('#airline') | |
2 0.000007 unlet! b:airline_head b:airline_do_mq_check | |
2 0.000003 endif | |
FUNCTION <SNR>163_CheckDefined() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/highlighter.vim:108 | |
Called 168 times | |
Total time: 0.005465 | |
Self time: 0.005465 | |
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 | |
168 0.000663 if !exists("g:airline#highlighter#normal_fg_hi") | |
let g:airline#highlighter#normal_fg_hi = synIDattr(synIDtrans(hlID('Normal')), 'fg', 'cterm') | |
168 0.000182 endif | |
168 0.000561 if empty(g:airline#highlighter#normal_fg_hi) || g:airline#highlighter#normal_fg_hi < 0 | |
return a:colors | |
168 0.000169 endif | |
168 0.000489 for val in a:colors | |
168 0.000468 if !empty(val) && val !=# 'NONE' | |
168 0.000247 return a:colors | |
endif | |
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 empty(bg) || 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#extensions#fzf#apply() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/fzf.vim:28 | |
Called 2 times | |
Total time: 0.000027 | |
Self time: 0.000027 | |
count total (s) self (s) | |
2 0.000005 if &filetype ==# 'fzf' | |
let spc = g:airline_symbols.space | |
call a:1.add_section('airline_a', spc.'FZF'.spc) | |
call a:1.add_section('airline_c', '') | |
return 1 | |
2 0.000003 endif | |
FUNCTION <SNR>108_clean_url() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/base.vim:2599 | |
Called 1 time | |
Total time: 0.000103 | |
Self time: 0.000074 | |
count total (s) self (s) | |
" Helper: Clean url string | |
" don't use an extension as part of the description | |
1 0.000038 0.000009 let url = substitute(a:url, '\'.vimwiki#vars#get_wikilocal('ext').'$', '', '') | |
" remove protocol and tld | |
1 0.000006 let url = substitute(url, '^\a\+\d*:', '', '') | |
" remove absolute path prefix | |
1 0.000003 let url = substitute(url, '^//', '', '') | |
1 0.000006 let url = substitute(url, '^\([^/]\+\)\.\a\{2,4}/', '\1/', '') | |
1 0.000005 let url_l = split(url, '/\|=\|-\|&\|?\|\.') | |
" case only a '-' | |
1 0.000002 if url_l == [] | |
return '' | |
1 0.000001 endif | |
1 0.000003 let url_l = filter(url_l, 'v:val !=# ""') | |
1 0.000002 if url_l[0] ==# 'www' | |
let url_l = url_l[1:] | |
1 0.000001 endif | |
1 0.000004 if url_l[-1] =~# '^\(htm\|html\|php\)$' | |
let url_l = url_l[0:-2] | |
1 0.000001 endif | |
" remove words with black listed codepoints | |
" TODO mutualize blacklist in a variable | |
1 0.000006 let url_l = filter(url_l, 'v:val !~? "[!\"$%&''()*+,:;<=>?\[\]\\^`{}]"') | |
" remove words consisting of only hexadecimal digits | |
1 0.000005 let url_l = filter(url_l, 'v:val !~? "^\\x\\{4,}$" || v:val !~? "\\d"') | |
1 0.000002 return join(url_l, ' ') | |
FUNCTION <SNR>155_is_excluded_window() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions.vim:112 | |
Called 2 times | |
Total time: 0.000162 | |
Self time: 0.000162 | |
count total (s) self (s) | |
2 0.000006 for matchft in g:airline_exclude_filetypes | |
if matchft ==# &ft | |
return 1 | |
endif | |
2 0.000003 endfor | |
8 0.000017 for matchw in g:airline_exclude_filenames | |
6 0.000045 if matchstr(expand('%'), matchw) ==# matchw | |
return 1 | |
6 0.000008 endif | |
8 0.000011 endfor | |
2 0.000007 if g:airline_exclude_preview && &previewwindow | |
return 1 | |
2 0.000004 endif | |
2 0.000003 return 0 | |
FUNCTION <SNR>163_exec_separator() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/highlighter.vim:189 | |
Called 56 times | |
Total time: 0.055420 | |
Self time: 0.002956 | |
count total (s) self (s) | |
56 0.000128 if pumvisible() | |
return | |
56 0.000047 endif | |
56 0.000166 let group = a:from.'_to_'.a:to.a:suffix | |
56 0.016132 0.000452 let l:from = airline#themes#get_highlight(a:from.a:suffix) | |
56 0.015140 0.000441 let l:to = airline#themes#get_highlight(a:to.a:suffix) | |
56 0.000084 if a:inverse | |
26 0.000134 let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ] | |
30 0.000030 else | |
30 0.000194 let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ] | |
56 0.000053 endif | |
56 0.000163 let a:dict[group] = colors | |
56 0.022530 0.000445 call airline#highlighter#exec(group, colors) | |
FUNCTION vimwiki#base#matchstr_at_cursor() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/base.vim:1164 | |
Called 9 times | |
Total time: 0.000429 | |
Self time: 0.000429 | |
count total (s) self (s) | |
" Return: part of the line that matches wikiRX at cursor | |
9 0.000022 let col = col('.') - 1 | |
9 0.000016 let line = getline('.') | |
9 0.000010 let ebeg = -1 | |
9 0.000135 let cont = match(line, a:wikiRX, 0) | |
9 0.000024 while (ebeg >= 0 || (0 <= cont) && (cont <= col)) | |
1 0.000006 let contn = matchend(line, a:wikiRX, cont) | |
1 0.000003 if (cont <= col) && (col < contn) | |
1 0.000006 let ebeg = match(line, a:wikiRX, cont) | |
1 0.000002 let elen = contn - ebeg | |
1 0.000001 break | |
else | |
let cont = match(line, a:wikiRX, contn) | |
endif | |
9 0.000010 endwh | |
9 0.000010 if ebeg >= 0 | |
1 0.000003 return strpart(line, ebeg, elen) | |
8 0.000008 else | |
8 0.000008 return '' | |
endif | |
FUNCTION airline#highlighter#reset_hlcache() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/highlighter.vim:64 | |
Called 2 times | |
Total time: 0.000093 | |
Self time: 0.000093 | |
count total (s) self (s) | |
2 0.000072 let s:hl_groups = {} | |
FUNCTION airline#update_statusline_inactive() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline.vim:179 | |
Called 2 times | |
Total time: 0.000200 | |
Self time: 0.000100 | |
count total (s) self (s) | |
2 0.000119 0.000019 if airline#util#stl_disabled(winnr()) | |
return | |
2 0.000003 endif | |
2 0.000008 for nr in a:range | |
if airline#util#stl_disabled(nr) | |
continue | |
endif | |
call setwinvar(nr, 'airline_active', 0) | |
let context = { 'winnr': nr, 'active': 0, 'bufnr': winbufnr(nr) } | |
if get(g:, 'airline_inactive_alt_sep', 0) | |
call extend(context, { 'left_sep': g:airline_left_alt_sep, 'right_sep': g:airline_right_alt_sep }, 'keep') | |
endif | |
try | |
call s:invoke_funcrefs(context, g:airline_inactive_funcrefs) | |
catch /^Vim\%((\a\+)\)\=:E48:/ | |
" Catch: Sandbox mode | |
" no-op | |
endtry | |
2 0.000004 endfor | |
FUNCTION airline#util#has_vcscommand() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:167 | |
Called 14 times | |
Total time: 0.000186 | |
Self time: 0.000186 | |
count total (s) self (s) | |
14 0.000050 if !exists("s:has_vcscommand") | |
let s:has_vcscommand = exists('*VCSCommandGetStatusLine') | |
14 0.000015 endif | |
14 0.000054 return get(g:, 'airline#extensions#branch#use_vcscommand', 0) && s:has_vcscommand | |
FUNCTION airline#extensions#tabline#add_tab_label() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/tabline.vim:37 | |
Called 2 times | |
Total time: 0.000039 | |
Self time: 0.000039 | |
count total (s) self (s) | |
2 0.000007 let show_tab_count = get(g:, 'airline#extensions#tabline#show_tab_count', 1) | |
2 0.000004 if show_tab_count == 2 | |
call a:dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$'))) | |
2 0.000005 elseif show_tab_count == 1 && tabpagenr('$') > 1 | |
call a:dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$'))) | |
2 0.000003 endif | |
FUNCTION airline#util#getbufvar() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/util.vim:73 | |
Called 4 times | |
Total time: 0.000035 | |
Self time: 0.000035 | |
count total (s) self (s) | |
4 0.000028 return getbufvar(a:bufnr, a:key, a:def) | |
FUNCTION vimwiki#base#normalize_link() | |
Defined: ~/vimfiles/plugged/vimwiki/autoload/vimwiki/base.vim:2798 | |
Called 1 time | |
Total time: 6.650323 | |
Self time: 0.000040 | |
count total (s) self (s) | |
" Normalize link (Implemented as a switch function) | |
" If visual mode | |
1 0.000001 if a:is_visual_mode | |
return s:normalize_link_syntax_v() | |
" If Syntax-specific normalizer exists: call it | |
1 0.000035 0.000007 elseif exists('*vimwiki#'.vimwiki#vars#get_wikilocal('syntax').'_base#normalize_link') | |
1 6.650280 0.000025 return vimwiki#{vimwiki#vars#get_wikilocal('syntax')}_base#normalize_link() | |
" Normal mode default | |
else | |
return s:normalize_link_syntax_n() | |
endif | |
FUNCTION <SNR>181_add_section() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/default.vim:47 | |
Called 12 times | |
Total time: 0.001955 | |
Self time: 0.000878 | |
count total (s) self (s) | |
12 0.000092 let condition = (a:key is# "warning" || a:key is# "error") && (v:version == 704 && !has("patch1511")) | |
" i have no idea why the warning section needs special treatment, but it's | |
" needed to prevent separators from showing up | |
12 0.000081 if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key))) | |
return | |
12 0.000018 endif | |
12 0.000023 if condition | |
call a:builder.add_raw('%(') | |
12 0.000013 endif | |
12 0.001402 0.000325 call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key)) | |
12 0.000024 if condition | |
call a:builder.add_raw('%)') | |
12 0.000015 endif | |
FUNCTION airline#builder#new() | |
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/builder.vim:234 | |
Called 4 times | |
Total time: 0.000122 | |
Self time: 0.000122 | |
count total (s) self (s) | |
4 0.000035 let builder = copy(s:prototype) | |
4 0.000013 let builder._context = a:context | |
4 0.000007 let builder._sections = [] | |
4 0.000039 call extend(builder._context, { 'left_sep': g:airline_left_sep, 'left_alt_sep': g:airline_left_alt_sep, 'right_sep': g:airline_right_sep, 'right_alt_sep': g:airline_right_alt_sep, }, 'keep') | |
4 0.000009 return builder | |
FUNCTIONS SORTED ON TOTAL TIME | |
count total (s) self (s) function | |
1 6.651241 0.000286 vimwiki#base#follow_link() | |
1 6.650323 0.000040 vimwiki#base#normalize_link() | |
1 6.650229 0.000010 vimwiki#markdown_base#normalize_link() | |
1 6.650219 0.000937 <SNR>109_normalize_link_syntax_n() | |
1 6.648361 0.014885 vimwiki#base#is_diary_file() | |
1 6.560854 6.560745 vimwiki#diary#get_diary_files() | |
14 0.109588 0.003458 airline#check_mode() | |
4 0.102855 0.013515 airline#highlighter#highlight() | |
304 0.082539 0.029950 airline#highlighter#get_highlight() | |
168 0.076542 0.019274 airline#highlighter#exec() | |
2727 0.072039 vimwiki#path#normalize() | |
56 0.055420 0.002956 <SNR>163_exec_separator() | |
1216 0.050448 <SNR>163_get_syn() | |
14 0.038722 0.002810 airline#extensions#branch#head() | |
6 0.034887 0.004474 24() | |
14 0.030924 0.030588 <SNR>164_update_untracked() | |
112 0.030379 0.001154 airline#themes#get_highlight() | |
2 0.028751 0.000197 <SNR>79_on_focus_gained() | |
2 0.028505 0.000273 <SNR>79_airline_refresh() | |
2 0.027794 0.000234 airline#update_statusline() | |
FUNCTIONS SORTED ON SELF TIME | |
count total (s) self (s) function | |
1 6.560854 6.560745 vimwiki#diary#get_diary_files() | |
2727 0.072039 vimwiki#path#normalize() | |
1216 0.050448 <SNR>163_get_syn() | |
14 0.030924 0.030588 <SNR>164_update_untracked() | |
304 0.082539 0.029950 airline#highlighter#get_highlight() | |
168 0.076542 0.019274 airline#highlighter#exec() | |
1 6.648361 0.014885 vimwiki#base#is_diary_file() | |
4 0.102855 0.013515 airline#highlighter#highlight() | |
168 0.005465 <SNR>163_CheckDefined() | |
162 0.005409 <SNR>163_hl_group_exists() | |
6 0.034887 0.004474 24() | |
3 0.003620 <SNR>58_GetCurrentFile() | |
14 0.109588 0.003458 airline#check_mode() | |
56 0.055420 0.002956 <SNR>163_exec_separator() | |
14 0.038722 0.002810 airline#extensions#branch#head() | |
304 0.002141 <SNR>163_get_array() | |
4 0.001889 <SNR>171_map_keys() | |
4 0.001790 0.001736 <SNR>125_Highlight_Matching_Pair() | |
120 0.001422 <SNR>163_group_not_done() | |
22 0.001394 <SNR>179_get_accented_line() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment