dots/.vim/ftplugin/pandoc/wiki.vim

26 lines
693 B
VimL
Raw Normal View History

2022-08-21 10:57:03 +02:00
set cc=81
set cocu=""
2023-05-15 13:41:06 +02:00
func! GetContext()
" https://stackoverflow.com/questions/9464844/how-to-get-group-name-of-highlighting-under-cursor-in-vim
if !exists("*synstack")
return
endif
let matches = map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
if index(matches, 'pandocLaTeXInlineMath') >= 0
echo 'math_inline'
elseif index(matches, 'pandocLaTeXMathBlock') >= 0
echo 'math_block'
2024-10-08 20:35:12 +02:00
elseif !empty(matches)
echo matches[0]
2023-05-15 13:41:06 +02:00
else
echo ''
endif
endfunc
com! -nargs=0 GetContext :call GetContext()
2024-10-08 20:34:26 +02:00
function! Put(str)
put = a:str
endfunction
com! -nargs=0 AnkiDeck call fzf#run(fzf#wrap({'source': 'get-anki-decks', 'sink': function('Put')}))