Add 'dots/' from commit '357b97a7692c8d5ec9666d8d7d7c98d81cb51cf0'
git-subtree-dir: dots git-subtree-mainline:2ad98cde17git-subtree-split:357b97a769
This commit is contained in:
1
dots/.vim/ftplugin/javascript.vim
Normal file
1
dots/.vim/ftplugin/javascript.vim
Normal file
@@ -0,0 +1 @@
|
||||
set mps+==:;
|
||||
22
dots/.vim/ftplugin/pandoc/anki.vim
Normal file
22
dots/.vim/ftplugin/pandoc/anki.vim
Normal file
@@ -0,0 +1,22 @@
|
||||
" Anki helper functions
|
||||
|
||||
" Convert cloze note to regular text
|
||||
"
|
||||
" * `AnkiRemoveAllClozes` all cloze notes in file
|
||||
" * `AnkiRemoveSelectedClozes` all clozes in selected range
|
||||
"
|
||||
" E.g.
|
||||
"
|
||||
" ```markdown
|
||||
" START
|
||||
" Cloze
|
||||
" In this sentence {{c1::this word}} was closed.
|
||||
" END
|
||||
" ```
|
||||
"
|
||||
" ```markdown
|
||||
" In this sentence this word was closed.
|
||||
" ```
|
||||
|
||||
au FileType pandoc com! -range AnkiRemoveAllClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
|
||||
au FileType pandoc com! -range AnkiRemoveSelectedClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
|
||||
19
dots/.vim/ftplugin/pandoc/wiki.vim
Normal file
19
dots/.vim/ftplugin/pandoc/wiki.vim
Normal file
@@ -0,0 +1,19 @@
|
||||
set cc=81
|
||||
set cocu=""
|
||||
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'
|
||||
elseif !empty(matches)
|
||||
echo matches[0]
|
||||
else
|
||||
echo ''
|
||||
endif
|
||||
endfunc
|
||||
com! -nargs=0 GetContext :call GetContext()
|
||||
25
dots/.vim/ftplugin/scheme/repl.vim
Normal file
25
dots/.vim/ftplugin/scheme/repl.vim
Normal file
@@ -0,0 +1,25 @@
|
||||
"
|
||||
" Source: https://wiki.call-cc.org/vim / Jonathan Palardy
|
||||
"
|
||||
|
||||
" Note, this is assuming you have an R5RS Scheme REPL runnning in the second
|
||||
" TMUX pane.
|
||||
|
||||
" Send `(load <current-file>)` to tmux pane
|
||||
nmap <leader>rf :call Scheme_send_sexp("(#%require xrepl)(load \"" . expand("%:p") . "\")\n")<cr>
|
||||
nmap <leader>re :call Scheme_eval_defun()<cr>
|
||||
|
||||
" Send s-expression to TMUX buffer
|
||||
fun! Scheme_send_sexp(sexp)
|
||||
let ss = escape(a:sexp, '\"')
|
||||
" Send to second tmux pane
|
||||
call system("tmux send-keys -t 1 \"" . ss . "\n\"")
|
||||
endfun
|
||||
|
||||
" Send s-expression under cursor to TMUX buffer
|
||||
fun! Scheme_eval_defun()
|
||||
let pos = getpos('.')
|
||||
silent! exec "normal! 99[(yab"
|
||||
call Scheme_send_sexp(@")
|
||||
call setpos('.', pos)
|
||||
endfun
|
||||
Reference in New Issue
Block a user