utils.vim (620B)
1 " Last Change: 2020 Nov 22 2 function! IsRealFile() abort 3 return bufname("%") !=? "" 4 endfunction 5 6 function! GenerateTagsAsync(path) abort 7 if empty(tagfiles()) 8 let l:cmd_str = "ctags -R " . a:path 9 else 10 let l:cmd_str = "ctags -f ". tagfiles()[0] . " -R " . a:path 11 endif 12 return jobstart(l:cmd_str) 13 endfunction 14 15 function! SetAsTitle(type) "{{{ 16 execute 'normal yypVr' . a:type 17 endfunction "}}} 18 19 nmap <leader>sp :call <SID>SynStack()<CR> 20 function! <SID>SynStack() 21 if !exists("*synstack") 22 return 23 endif 24 echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') 25 endfunc 26