Skip to content

Instantly share code, notes, and snippets.

@pidgeon777
Created March 1, 2023 12:49
Show Gist options
  • Save pidgeon777/3e355a42af4b9b928cb4807d2202772c to your computer and use it in GitHub Desktop.
Save pidgeon777/3e355a42af4b9b928cb4807d2202772c 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.000407
Self time: 0.000407
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.000379
Self time: 0.000379
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.002052
Self time: 0.002052
count total (s) self (s)
" Guess from the filetype if a) not locally decided, b) globally enabled, c) there is enough information
89 0.000438 if get(b:, 'better_whitespace_guess', 1) && g:better_whitespace_enabled == 1
89 0.001010 let b:better_whitespace_enabled = (empty(&buftype) || &buftype == 'acwrite') && index(g:better_whitespace_filetypes_blacklist, &ft) == -1
89 0.000059 endif
89 0.000300 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.119966
Self time: 0.118921
count total (s) self (s)
5 0.000022 if exists("b:undo_ftplugin")
exe b:undo_ftplugin
unlet! b:undo_ftplugin b:did_ftplugin
5 0.000003 endif
5 0.000112 let s = expand("<amatch>")
5 0.000008 if s != ""
5 0.000043 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.057720 exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim'
" Load lua ftplugins
5 0.061874 0.060829 exe printf('runtime! ftplugin/%s.lua ftplugin/%s_*.lua ftplugin/%s/*.lua', name, name, name)
10 0.000023 endfor
5 0.000004 endif
FUNCTION <SNR>61_display_annotation()
Defined: C:\Work\Temp\Neovim\data\LunarVim\site\pack\packer\start\vim-bookmarks\plugin\bookmark.vim:540
Called 28 times
Total time: 0.014631
Self time: 0.014461
count total (s) self (s)
28 0.012834 let file = expand("%:p")
28 0.000123 if file ==# ""
3 0.000002 return
25 0.000017 endif
25 0.000085 let current_line = line('.')
25 0.001095 0.000926 let has_bm = bm#has_bookmark_at_line(file, current_line)
25 0.000085 let bm = has_bm ? bm#get_bookmark_by_line(file, current_line) : 0
25 0.000059 let annotation = has_bm ? bm['annotation'] : ""
25 0.000033 if annotation !=# ""
echo "Bookmark annotation: ". annotation
25 0.000014 else
25 0.000088 echo
25 0.000013 endif
FUNCTION <SNR>11_SynSet()
Defined: ~\Portable\Neovim\share\nvim\runtime\syntax\synload.vim:26
Called 5 times
Total time: 0.064960
Self time: 0.064960
count total (s) self (s)
" clear syntax for :set syntax=OFF and any syntax name that doesn't exist
5 0.000018 syn clear
5 0.000011 if exists("b:current_syntax")
unlet b:current_syntax
5 0.000002 endif
5 0.000019 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.000007 elseif s == "OFF"
let s = ""
5 0.000002 endif
5 0.000004 if s != ""
" Load the syntax file(s). When there are several, separated by dots,
" load each in sequence. Skip empty entries.
10 0.000048 for name in split(s, '\.')
5 0.000009 if !empty(name)
5 0.032581 exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim"
5 0.032110 exe "runtime! syntax/" . name . ".lua syntax/" . name . "/*.lua"
5 0.000011 endif
10 0.000011 endfor
5 0.000004 endif
FUNCTION <SNR>2_LoadIndent()
Defined: ~\Portable\Neovim\share\nvim\runtime\indent.vim:13
Called 5 times
Total time: 0.028906
Self time: 0.028906
count total (s) self (s)
5 0.000021 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.000008 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.000040 for name in split(s, '\.')
5 0.014203 exe 'runtime! indent/' . name . '.vim'
5 0.014518 exe 'runtime! indent/' . name . '.lua'
10 0.000017 endfor
5 0.000003 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.000766
Self time: 0.000766
count total (s) self (s)
" Guess from local whitespace enabled-ness and global whitespace setting
47 0.000231 if get(b:, 'strip_whitespace_guess', 1) && exists('b:better_whitespace_enabled')
47 0.000291 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.000020 endif
47 0.000134 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 25 times
Total time: 0.000170
Self time: 0.000170
count total (s) self (s)
25 0.000101 if !has_key(g:line_map, a:file)
25 0.000030 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.000015
Self time: 0.000015
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 59 times
Total time: 0.006307
Self time: 0.005703
count total (s) self (s)
" Remove any previous match.
59 0.002116 0.001512 call s:Remove_Matches()
" Avoid that we remove the popup menu.
" Return when there are no colors (looks like the cursor jumps).
59 0.000250 if pumvisible() || (&t_Co < 8 && !has("gui_running"))
return
59 0.000024 endif
" Get the character under the cursor and check if it's in 'matchpairs'.
59 0.000174 let c_lnum = line('.')
59 0.000131 let c_col = col('.')
59 0.000066 let before = 0
59 0.000155 let text = getline(c_lnum)
59 0.000830 let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)')
59 0.000114 if empty(matches)
let [c_before, c] = ['', '']
59 0.000035 else
59 0.000228 let [c_before, c] = matches[1:2]
59 0.000031 endif
59 0.000726 let plist = split(&matchpairs, '.\zs[:,]')
59 0.000164 let i = index(plist, c)
59 0.000059 if i < 0
" not found, in Insert mode try character before the cursor
59 0.000180 if c_col > 1 && (mode() == 'i' || mode() == 'R')
4 0.000012 let before = strlen(c_before)
4 0.000006 let c = c_before
4 0.000009 let i = index(plist, c)
59 0.000028 endif
59 0.000046 if i < 0
" not found, nothing to do
59 0.000051 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 63 times
Total time: 0.000651
Self time: 0.000651
count total (s) self (s)
63 0.000284 if exists('w:paren_hl_on') && w:paren_hl_on
silent! call matchdelete(3)
let w:paren_hl_on = 0
63 0.000059 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.002173
Self time: 0.002173
count total (s) self (s)
86 0.002071 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>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.017287
Self time: 0.009662
count total (s) self (s)
47 0.000141 augroup better_whitespace
" Reset all auto commands in group
47 0.002183 autocmd!
47 0.002565 0.001288 if <SID>ShouldHighlight()
40 0.000077 if s:better_whitespace_initialized == 0
call <SID>WhitespaceInit()
40 0.000024 endif
" Highlight extraneous whitespace at the end of lines, but not the current line in insert mode.
40 0.006569 0.001244 call <SID>HighlightEOLWhitespace()
40 0.000670 autocmd CursorMovedI,InsertEnter * call <SID>HighlightEOLWhitespaceExceptCurrentLine()
40 0.000525 autocmd InsertLeave,BufReadPost * call <SID>HighlightEOLWhitespace()
40 0.000078 if g:current_line_whitespace_disabled_soft == 0
" Using syntax: clear whitespace highlighting when leaving buffer
40 0.000308 autocmd BufWinLeave * if expand("<afile>") == expand("%") | call <SID>ClearHighlighting() | endif
" Do not highlight whitespace on current line in insert mode
40 0.000234 autocmd CursorMovedI * call <SID>HighlightEOLWhitespaceExceptCurrentLine()
" Do not highlight whitespace on current line in normal mode?
40 0.000059 if g:current_line_whitespace_disabled_hard == 1
autocmd CursorMoved * call <SID>HighlightEOLWhitespaceExceptCurrentLine()
40 0.000019 endif
40 0.000015 endif
7 0.000012 elseif s:better_whitespace_initialized == 1
" Clear highlighting if it disabled, as it might have just been toggled
7 0.000423 0.000166 call <SID>ClearHighlighting()
47 0.000027 endif
" Strip whitespace on save if enabled.
47 0.002374 0.001608 if <SID>ShouldStripWhitespaceOnSave()
autocmd BufWritePre * call <SID>StripWhitespaceOnSave(v:cmdbang)
47 0.000019 endif
47 0.000062 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.005532
Self time: 0.003303
count total (s) self (s)
42 0.002545 0.001092 call <SID>ClearHighlighting()
42 0.001834 0.001059 if <SID>ShouldHighlight()
42 0.001066 let s:match_id = matchadd('ExtraWhitespace', s:eol_whitespace_pattern, 10, get(s:, 'match_id', -1))
42 0.000024 endif
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
5 0.119966 0.118921 <SNR>1_LoadFTPlugin()
5 0.064960 <SNR>11_SynSet()
5 0.028906 <SNR>2_LoadIndent()
47 0.017287 0.009662 <SNR>60_SetupAutoCommands()
28 0.014631 0.014461 <SNR>61_display_annotation()
59 0.006307 0.005703 <SNR>16_Highlight_Matching_Pair()
42 0.005532 0.003303 <SNR>60_HighlightEOLWhitespace()
86 0.002173 <SNR>60_ClearHighlighting()
89 0.002052 <SNR>60_ShouldHighlight()
47 0.000766 <SNR>60_ShouldStripWhitespaceOnSave()
63 0.000651 <SNR>16_Remove_Matches()
25 0.000170 bm#has_bookmark_at_line()
4 0.000015 <SNR>36_dopopd()
<SNR>80_try_cmd()
9()
provider#clipboard#Call()
FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
5 0.119966 0.118921 <SNR>1_LoadFTPlugin()
5 0.064960 <SNR>11_SynSet()
5 0.028906 <SNR>2_LoadIndent()
28 0.014631 0.014461 <SNR>61_display_annotation()
47 0.017287 0.009662 <SNR>60_SetupAutoCommands()
59 0.006307 0.005703 <SNR>16_Highlight_Matching_Pair()
42 0.005532 0.003303 <SNR>60_HighlightEOLWhitespace()
86 0.002173 <SNR>60_ClearHighlighting()
89 0.002052 <SNR>60_ShouldHighlight()
47 0.000766 <SNR>60_ShouldStripWhitespaceOnSave()
63 0.000651 <SNR>16_Remove_Matches()
25 0.000170 bm#has_bookmark_at_line()
4 0.000015 <SNR>36_dopopd()
9()
provider#clipboard#Call()
<SNR>80_try_cmd()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment