Skip to content

Instantly share code, notes, and snippets.

@pidgeon777
Created March 1, 2023 12:47
Show Gist options
  • Save pidgeon777/d1bea4a7955605a963f5f14fcb88deef to your computer and use it in GitHub Desktop.
Save pidgeon777/d1bea4a7955605a963f5f14fcb88deef to your computer and use it in GitHub Desktop.
SCRIPT C:\Work\Temp\Neovim\data\LunarVim\site\pack\packer\start\telescope.nvim\ftplugin\TelescopePrompt.lua
Sourced 2 times
Total time: 0.000387
Self time: 0.000387
count total (s) self (s)
-- Don't wrap textwidth things
vim.opt_local.formatoptions:remove "t"
vim.opt_local.formatoptions:remove "c"
-- Don't include `showbreak` when calculating strdisplaywidth
vim.opt_local.wrap = false
-- There's also no reason to enable textwidth here anyway
vim.opt_local.textwidth = 0
vim.opt_local.scrollbind = false
vim.opt_local.signcolumn = "no"
SCRIPT C:\Work\Temp\Neovim\data\LunarVim\site\pack\packer\start\telescope.nvim\ftplugin\TelescopeResults.lua
Sourced 2 times
Total time: 0.000287
Self time: 0.000287
count total (s) self (s)
-- Don't have scrolloff, it makes things weird.
vim.opt_local.scrolloff = 0
vim.opt_local.scrollbind = false
vim.opt_local.signcolumn = "no"
FUNCTION 9()
Defined: ~\Portable\Neovim\share\nvim\runtime\autoload\provider\clipboard.vim:153
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
if type(s:paste[a:reg]) == v:t_func
return s:paste[a:reg]()
elseif s:selections[a:reg].owner > 0
return s:selections[a:reg].data
end
let clipboard_data = s:try_cmd(s:paste[a:reg])
if match(&clipboard, '\v(unnamed|unnamedplus)') >= 0 && type(clipboard_data) == v:t_list && get(s:selections[a:reg].data, 0, []) ==# clipboard_data
" When system clipboard return is same as our cache return the cache
" as it contains regtype information
return s:selections[a:reg].data
end
return clipboard_data
FUNCTION <SNR>60_ShouldHighlight()
Defined: C:\Work\Temp\Neovim\data\LunarVim\site\pack\packer\start\vim-better-whitespace\plugin\better-whitespace.vim:129
Called 89 times
Total time: 0.002176
Self time: 0.002176
count total (s) self (s)
" Guess from the filetype if a) not locally decided, b) globally enabled, c) there is enough information
89 0.000469 if get(b:, 'better_whitespace_guess', 1) && g:better_whitespace_enabled == 1
89 0.001077 let b:better_whitespace_enabled = (empty(&buftype) || &buftype == 'acwrite') && index(g:better_whitespace_filetypes_blacklist, &ft) == -1
89 0.000062 endif
89 0.000314 return get(b:, 'better_whitespace_enabled', g:better_whitespace_enabled)
FUNCTION <SNR>1_LoadFTPlugin()
Defined: ~\Portable\Neovim\share\nvim\runtime\ftplugin.vim:14
Called 5 times
Total time: 0.113866
Self time: 0.112961
count total (s) self (s)
5 0.000019 if exists("b:undo_ftplugin")
exe b:undo_ftplugin
unlet! b:undo_ftplugin b:did_ftplugin
5 0.000003 endif
5 0.000016 let s = expand("<amatch>")
5 0.000010 if s != ""
5 0.000031 if &cpo =~# "S" && exists("b:did_ftplugin")
" In compatible mode options are reset to the global values, need to
" set the local values also when a plugin was already used.
unlet b:did_ftplugin
5 0.000002 endif
" When there is a dot it is used to separate filetype names. Thus for
" "aaa.bbb" load "aaa" and then "bbb".
10 0.000041 for name in split(s, '\.')
5 0.055078 exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim'
" Load lua ftplugins
5 0.058533 0.057628 exe printf('runtime! ftplugin/%s.lua ftplugin/%s_*.lua ftplugin/%s/*.lua', name, name, name)
10 0.000025 endfor
5 0.000005 endif
FUNCTION <SNR>61_display_annotation()
Defined: C:\Work\Temp\Neovim\data\LunarVim\site\pack\packer\start\vim-bookmarks\plugin\bookmark.vim:540
Called 32 times
Total time: 0.018744
Self time: 0.018509
count total (s) self (s)
32 0.016549 let file = expand("%:p")
32 0.000135 if file ==# ""
2 0.000001 return
30 0.000023 endif
30 0.000113 let current_line = line('.')
30 0.001298 0.001062 let has_bm = bm#has_bookmark_at_line(file, current_line)
30 0.000105 let bm = has_bm ? bm#get_bookmark_by_line(file, current_line) : 0
30 0.000076 let annotation = has_bm ? bm['annotation'] : ""
30 0.000042 if annotation !=# ""
echo "Bookmark annotation: ". annotation
30 0.000018 else
30 0.000116 echo
30 0.000016 endif
FUNCTION <SNR>11_SynSet()
Defined: ~\Portable\Neovim\share\nvim\runtime\syntax\synload.vim:26
Called 5 times
Total time: 0.062757
Self time: 0.062757
count total (s) self (s)
" clear syntax for :set syntax=OFF and any syntax name that doesn't exist
5 0.000020 syn clear
5 0.000011 if exists("b:current_syntax")
unlet b:current_syntax
5 0.000003 endif
5 0.000021 0verbose let s = expand("<amatch>")
5 0.000008 if s == "ON"
" :set syntax=ON
if &filetype == ""
echohl ErrorMsg
echo "filetype unknown"
echohl None
endif
let s = &filetype
5 0.000006 elseif s == "OFF"
let s = ""
5 0.000002 endif
5 0.000007 if s != ""
" Load the syntax file(s). When there are several, separated by dots,
" load each in sequence. Skip empty entries.
10 0.000053 for name in split(s, '\.')
5 0.000009 if !empty(name)
5 0.031331 exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim"
5 0.031152 exe "runtime! syntax/" . name . ".lua syntax/" . name . "/*.lua"
5 0.000015 endif
10 0.000010 endfor
5 0.000003 endif
FUNCTION <SNR>2_LoadIndent()
Defined: ~\Portable\Neovim\share\nvim\runtime\indent.vim:13
Called 5 times
Total time: 0.030490
Self time: 0.030490
count total (s) self (s)
5 0.000022 if exists("b:undo_indent")
exe b:undo_indent
unlet! b:undo_indent b:did_indent
5 0.000003 endif
5 0.000022 let s = expand("<amatch>")
5 0.000010 if s != ""
5 0.000008 if exists("b:did_indent")
unlet b:did_indent
5 0.000002 endif
" When there is a dot it is used to separate filetype names. Thus for
" "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim".
10 0.000047 for name in split(s, '\.')
5 0.015236 exe 'runtime! indent/' . name . '.vim'
5 0.015051 exe 'runtime! indent/' . name . '.lua'
10 0.000018 endfor
5 0.000004 endif
FUNCTION <SNR>60_ShouldStripWhitespaceOnSave()
Defined: C:\Work\Temp\Neovim\data\LunarVim\site\pack\packer\start\vim-better-whitespace\plugin\better-whitespace.vim:138
Called 47 times
Total time: 0.000876
Self time: 0.000876
count total (s) self (s)
" Guess from local whitespace enabled-ness and global whitespace setting
47 0.000252 if get(b:, 'strip_whitespace_guess', 1) && exists('b:better_whitespace_enabled')
47 0.000300 let b:strip_whitespace_on_save = b:better_whitespace_enabled && g:strip_whitespace_on_save && &modifiable && (g:strip_max_file_size == 0 || g:strip_max_file_size >= line('$'))
47 0.000021 endif
47 0.000147 return get(b:, 'strip_whitespace_on_save', g:strip_whitespace_on_save)
FUNCTION bm#has_bookmark_at_line()
Defined: C:\Work\Temp\Neovim\data\LunarVim\site\pack\packer\start\vim-bookmarks\autoload\bm.vim:15
Called 30 times
Total time: 0.000236
Self time: 0.000236
count total (s) self (s)
30 0.000145 if !has_key(g:line_map, a:file)
30 0.000040 return 0
endif
return has_key(g:line_map[a:file], a:line_nr)
FUNCTION <SNR>36_dopopd()
Defined: C:\Work\Temp\Neovim\data\LunarVim\site\pack\packer\start\fzf\plugin\fzf.vim:599
Called 4 times
Total time: 0.000014
Self time: 0.000014
count total (s) self (s)
4 0.000009 if !exists('w:fzf_pushd')
4 0.000002 return
endif
" FIXME: We temporarily change the working directory to 'dir' entry
" of options dictionary (set to the current working directory if not given)
" before running fzf.
"
" e.g. call fzf#run({'dir': '/tmp', 'source': 'ls', 'sink': 'e'})
"
" After processing the sink function, we have to restore the current working
" directory. But doing so may not be desirable if the function changed the
" working directory on purpose.
"
" So how can we tell if we should do it or not? A simple heuristic we use
" here is that we change directory only if the current working directory
" matches 'dir' entry. However, it is possible that the sink function did
" change the directory to 'dir'. In that case, the user will have an
" unexpected result.
if s:fzf_getcwd() ==# w:fzf_pushd.dir && (!&autochdir || w:fzf_pushd.bufname ==# bufname(''))
execute w:fzf_pushd.command s:escape(w:fzf_pushd.origin)
endif
unlet! w:fzf_pushd
FUNCTION <SNR>16_Highlight_Matching_Pair()
Defined: ~\Portable\Neovim\share\nvim\runtime\plugin\matchparen.vim:39
Called 71 times
Total time: 0.008575
Self time: 0.007703
count total (s) self (s)
" Remove any previous match.
71 0.002838 0.001965 call s:Remove_Matches()
" Avoid that we remove the popup menu.
" Return when there are no colors (looks like the cursor jumps).
71 0.000338 if pumvisible() || (&t_Co < 8 && !has("gui_running"))
return
71 0.000046 endif
" Get the character under the cursor and check if it's in 'matchpairs'.
71 0.000221 let c_lnum = line('.')
71 0.000175 let c_col = col('.')
71 0.000090 let before = 0
71 0.000205 let text = getline(c_lnum)
71 0.001172 let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)')
71 0.000160 if empty(matches)
let [c_before, c] = ['', '']
71 0.000046 else
71 0.000286 let [c_before, c] = matches[1:2]
71 0.000041 endif
71 0.000983 let plist = split(&matchpairs, '.\zs[:,]')
71 0.000293 let i = index(plist, c)
71 0.000084 if i < 0
" not found, in Insert mode try character before the cursor
71 0.000227 if c_col > 1 && (mode() == 'i' || mode() == 'R')
4 0.000015 let before = strlen(c_before)
4 0.000007 let c = c_before
4 0.000010 let i = index(plist, c)
71 0.000038 endif
71 0.000061 if i < 0
" not found, nothing to do
71 0.000067 return
endif
endif
" Figure out the arguments for searchpairpos().
if i % 2 == 0
let s_flags = 'nW'
let c2 = plist[i + 1]
else
let s_flags = 'nbW'
let c2 = c
let c = plist[i - 1]
endif
if c == '['
let c = '\['
let c2 = '\]'
endif
" Find the match. When it was just before the cursor move it there for a
" moment.
if before > 0
let has_getcurpos = exists("*getcurpos")
if has_getcurpos
" getcurpos() is more efficient but doesn't exist before 7.4.313.
let save_cursor = getcurpos()
else
let save_cursor = winsaveview()
endif
call cursor(c_lnum, c_col - before)
endif
if !has("syntax") || !exists("g:syntax_on")
let s_skip = "0"
else
" Build an expression that detects whether the current cursor position is
" in certain syntax types (string, comment, etc.), for use as
" searchpairpos()'s skip argument.
" We match "escape" for special items, such as lispEscapeSpecial, and
" match "symbol" for lispBarSymbol.
let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . '''v:val =~? "string\\|character\\|singlequote\\|escape\\|symbol\\|comment"''))'
" If executing the expression determines that the cursor is currently in
" one of the syntax types, then we want searchpairpos() to find the pair
" within those syntax types (i.e., not skip). Otherwise, the cursor is
" outside of the syntax types and s_skip should keep its value so we skip
" any matching pair inside the syntax types.
" Catch if this throws E363: pattern uses more memory than 'maxmempattern'.
try
execute 'if ' . s_skip . ' | let s_skip = "0" | endif'
catch /^Vim\%((\a\+)\)\=:E363/
" We won't find anything, so skip searching, should keep Vim responsive.
return
endtry
endif
" Limit the search to lines visible in the window.
let stoplinebottom = line('w$')
let stoplinetop = line('w0')
if i % 2 == 0
let stopline = stoplinebottom
else
let stopline = stoplinetop
endif
" Limit the search time to 300 msec to avoid a hang on very long lines.
" This fails when a timeout is not supported.
if mode() == 'i' || mode() == 'R'
let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout
else
let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout
endif
try
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout)
catch /E118/
" Can't use the timeout, restrict the stopline a bit more to avoid taking
" a long time on closed folds and long lines.
" The "viewable" variables give a range in which we can scroll while
" keeping the cursor at the same position.
" adjustedScrolloff accounts for very large numbers of scrolloff.
let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2])
let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2])
let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2])
" one of these stoplines will be adjusted below, but the current values are
" minimal boundaries within the current window
if i % 2 == 0
if has("byte_offset") && has("syntax_items") && &smc > 0
let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
let stopline = min([bottom_viewable, byte2line(stopbyte)])
else
let stopline = min([bottom_viewable, c_lnum + 100])
endif
let stoplinebottom = stopline
else
if has("byte_offset") && has("syntax_items") && &smc > 0
let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
let stopline = max([top_viewable, byte2line(stopbyte)])
else
let stopline = max([top_viewable, c_lnum - 100])
endif
let stoplinetop = stopline
endif
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
endtry
if before > 0
if has_getcurpos
call setpos('.', save_cursor)
else
call winrestview(save_cursor)
endif
endif
" If a match is found setup match highlighting.
if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom
if exists('*matchaddpos')
call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3)
else
exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
endif
let w:paren_hl_on = 1
endif
FUNCTION <SNR>16_Remove_Matches()
Defined: ~\Portable\Neovim\share\nvim\runtime\plugin\matchparen.vim:196
Called 75 times
Total time: 0.000915
Self time: 0.000915
count total (s) self (s)
75 0.000414 if exists('w:paren_hl_on') && w:paren_hl_on
silent! call matchdelete(3)
let w:paren_hl_on = 0
75 0.000064 endif
FUNCTION <SNR>60_ClearHighlighting()
Defined: C:\Work\Temp\Neovim\data\LunarVim\site\pack\packer\start\vim-better-whitespace\plugin\better-whitespace.vim:190
Called 86 times
Total time: 0.002365
Self time: 0.002365
count total (s) self (s)
86 0.002258 silent! call matchdelete(get(s:, 'match_id', -1))
FUNCTION <SNR>80_try_cmd()
Defined: ~\Portable\Neovim\share\nvim\runtime\autoload\provider\clipboard.vim:37
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let out = systemlist(a:cmd, (a:0 ? a:1 : ['']), 1)
if v:shell_error
if !exists('s:did_error_try_cmd')
echohl WarningMsg
echomsg "clipboard: error: ".(len(out) ? out[0] : v:shell_error)
echohl None
let s:did_error_try_cmd = 1
endif
return 0
endif
return out
FUNCTION provider#clipboard#Call()
Defined: ~\Portable\Neovim\share\nvim\runtime\autoload\provider\clipboard.vim:230
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
if get(s:, 'here', v:false) " Clipboard provider must not recurse. #7184
return 0
endif
let s:here = v:true
try
return call(s:clipboard[a:method],a:args,s:clipboard)
finally
let s:here = v:false
endtry
FUNCTION <SNR>111_setup_toc()
Defined: ~\Portable\Neovim\share\nvim\runtime\ftplugin\qf.vim:20
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
if get(w:, 'quickfix_title') !~# '\<TOC$' || &syntax != 'qf'
return
endif
let list = getloclist(0)
if empty(list)
return
endif
let bufnr = list[0].bufnr
setlocal modifiable
silent %delete _
call setline(1, map(list, 'v:val.text'))
setlocal nomodifiable nomodified
let &syntax = getbufvar(bufnr, '&syntax')
FUNCTION <SNR>60_SetupAutoCommands()
Defined: C:\Work\Temp\Neovim\data\LunarVim\site\pack\packer\start\vim-better-whitespace\plugin\better-whitespace.vim:340
Called 47 times
Total time: 0.018551
Self time: 0.010289
count total (s) self (s)
47 0.000141 augroup better_whitespace
" Reset all auto commands in group
47 0.002303 autocmd!
47 0.002862 0.001490 if <SID>ShouldHighlight()
40 0.000081 if s:better_whitespace_initialized == 0
call <SID>WhitespaceInit()
40 0.000026 endif
" Highlight extraneous whitespace at the end of lines, but not the current line in insert mode.
40 0.007056 0.001295 call <SID>HighlightEOLWhitespace()
40 0.000733 autocmd CursorMovedI,InsertEnter * call <SID>HighlightEOLWhitespaceExceptCurrentLine()
40 0.000562 autocmd InsertLeave,BufReadPost * call <SID>HighlightEOLWhitespace()
40 0.000086 if g:current_line_whitespace_disabled_soft == 0
" Using syntax: clear whitespace highlighting when leaving buffer
40 0.000338 autocmd BufWinLeave * if expand("<afile>") == expand("%") | call <SID>ClearHighlighting() | endif
" Do not highlight whitespace on current line in insert mode
40 0.000260 autocmd CursorMovedI * call <SID>HighlightEOLWhitespaceExceptCurrentLine()
" Do not highlight whitespace on current line in normal mode?
40 0.000066 if g:current_line_whitespace_disabled_hard == 1
autocmd CursorMoved * call <SID>HighlightEOLWhitespaceExceptCurrentLine()
40 0.000021 endif
40 0.000017 endif
7 0.000012 elseif s:better_whitespace_initialized == 1
" Clear highlighting if it disabled, as it might have just been toggled
7 0.000406 0.000151 call <SID>ClearHighlighting()
47 0.000028 endif
" Strip whitespace on save if enabled.
47 0.002518 0.001642 if <SID>ShouldStripWhitespaceOnSave()
autocmd BufWritePre * call <SID>StripWhitespaceOnSave(v:cmdbang)
47 0.000019 endif
47 0.000067 augroup END
FUNCTION <SNR>60_HighlightEOLWhitespace()
Defined: C:\Work\Temp\Neovim\data\LunarVim\site\pack\packer\start\vim-better-whitespace\plugin\better-whitespace.vim:172
Called 42 times
Total time: 0.005942
Self time: 0.003510
count total (s) self (s)
42 0.002753 0.001125 call <SID>ClearHighlighting()
42 0.001870 0.001066 if <SID>ShouldHighlight()
42 0.001230 let s:match_id = matchadd('ExtraWhitespace', s:eol_whitespace_pattern, 10, get(s:, 'match_id', -1))
42 0.000026 endif
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
5 0.113866 0.112961 <SNR>1_LoadFTPlugin()
5 0.062757 <SNR>11_SynSet()
5 0.030490 <SNR>2_LoadIndent()
32 0.018744 0.018509 <SNR>61_display_annotation()
47 0.018551 0.010289 <SNR>60_SetupAutoCommands()
71 0.008575 0.007703 <SNR>16_Highlight_Matching_Pair()
42 0.005942 0.003510 <SNR>60_HighlightEOLWhitespace()
86 0.002365 <SNR>60_ClearHighlighting()
89 0.002176 <SNR>60_ShouldHighlight()
75 0.000915 <SNR>16_Remove_Matches()
47 0.000876 <SNR>60_ShouldStripWhitespaceOnSave()
30 0.000236 bm#has_bookmark_at_line()
4 0.000014 <SNR>36_dopopd()
<SNR>111_setup_toc()
<SNR>80_try_cmd()
9()
provider#clipboard#Call()
FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
5 0.113866 0.112961 <SNR>1_LoadFTPlugin()
5 0.062757 <SNR>11_SynSet()
5 0.030490 <SNR>2_LoadIndent()
32 0.018744 0.018509 <SNR>61_display_annotation()
47 0.018551 0.010289 <SNR>60_SetupAutoCommands()
71 0.008575 0.007703 <SNR>16_Highlight_Matching_Pair()
42 0.005942 0.003510 <SNR>60_HighlightEOLWhitespace()
86 0.002365 <SNR>60_ClearHighlighting()
89 0.002176 <SNR>60_ShouldHighlight()
75 0.000915 <SNR>16_Remove_Matches()
47 0.000876 <SNR>60_ShouldStripWhitespaceOnSave()
30 0.000236 bm#has_bookmark_at_line()
4 0.000014 <SNR>36_dopopd()
<SNR>80_try_cmd()
9()
provider#clipboard#Call()
<SNR>111_setup_toc()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment