" File: wizardfuncs.vim " Author: Mikolaj Machowski " Description: " " Installation: " History: pluginized by Srinath Avadhanula "============================================================================= if exists('s:doneOnce') finish endif let s:doneOnce = 1 let s:mapleader = exists('mapleader') ? mapleader : "\\" " ============================================================================== " Specialized functions for handling sections from command line " ============================================================================== com! -nargs=? TSection call Tex_section() com! -nargs=? TSectionAdvanced call Tex_section_adv() " Tex_VisSecAdv: handles visual selection for sections {{{ function! Tex_VisSecAdv(section) let shorttitle = input("Short title? ") let toc = input("Include in table of contents [y]/n ? ") let sstructure = "\\".a:section if ( toc == "" || toc == "y" ) let toc = "" else let toc = "*" endif if shorttitle != "" let shorttitle = '['.shorttitle.']' endif exe "normal! `>a}\\` 6 let curr_section_value = 6 endif return curr_section_value endfunction "}}} function! s:Tex_section_name(section_value) "{{{ if a:section_value == 0 let section_name = "part" elseif a:section_value == 1 let section_name = "chapter" elseif a:section_value == 2 let section_name = "section" elseif a:section_value == 3 let section_name = "subsection" elseif a:section_value == 4 let section_name = "subsubsection" elseif a:section_value == 5 let section_name = "paragraph" elseif a:section_value == 6 let section_name = "subparagraph" endif return section_name endfunction "}}} function! s:Tex_section_call(section_name) "{{{ exe "normal! i\\".a:section_name."{<++>}<++>\0\" " let ret_section = "\\".a:section_name."{<++>}<++>" " exe "normal! i\=IMAP_PutTextWithMovement(ret_section)\" " normal! f}i endfunction "}}} " ============================================================================== " Tables of shortcuts " ============================================================================== " command! -nargs=? Tshortcuts call Tex_shortcuts() " Tex_shortcuts: Show shortcuts in terminal after : command {{{ function! Tex_shortcuts(...) if a:0 == 0 let shorts = input(" Allowed arguments are:" \."\n g General" \."\n e Environments" \."\n f Fonts" \."\n s Sections" \."\n m Math" \."\n a All" \."\n Enter your choice ( quits) : ") call Tex_shortcuts(shorts) elseif a:1 == 'g' echo g:generalshortcuts elseif a:1 == 'e' echo g:environmentshortcuts elseif a:1 == 'f' echo g:fontshortcuts elseif a:1 == 's' echo g:sectionshortcuts elseif a:1 == 'm' echo g:mathshortcuts elseif a:1 == 'a' echo g:generalshortcuts echo g:environmentshortcuts echo g:fontshortcuts echo g:sectionshortcuts echo g:mathshortcuts endif endfunction " }}} " General shortcuts {{{ let g:generalshortcuts = '' \."\n General shortcuts" \."\n is a value of " \."\n ".s:mapleader.'ll compile whole document' \."\n ".s:mapleader.'lv view compiled document' \."\n ".s:mapleader.'ls forward searching (if possible)' \."\n ".s:mapleader.'rf refresh folds' " }}} " Environment shortcuts {{{ let g:environmentshortcuts = '' \."\n Environment shortcuts" \."\n is a value of g:Tex_Leader2" \."\n I v&V I v&V" \."\n ELI ".g:Tex_Leader2."li list EQN ".g:Tex_Leader2."qn quotation" \."\n EDE ".g:Tex_Leader2."de description ESP ".g:Tex_Leader2."sb sloppypar" \."\n EEN ".g:Tex_Leader2."en enumerate ETI ".g:Tex_Leader2."ti theindex" \."\n EIT ".g:Tex_Leader2."it itemize ETP ".g:Tex_Leader2."tp titlepage" \."\n ETI ".g:Tex_Leader2."ti theindex EVM ".g:Tex_Leader2."vm verbatim" \."\n ETL ".g:Tex_Leader2."tl trivlist EVE ".g:Tex_Leader2."ve verse" \."\n ETE ".g:Tex_Leader2."te table ETB ".g:Tex_Leader2."tb thebibliography" \."\n ETG ".g:Tex_Leader2."tg tabbing ENO ".g:Tex_Leader2."no note" \."\n ETR ".g:Tex_Leader2."tr tabular EOV ".g:Tex_Leader2."ov overlay" \."\n EAR ".g:Tex_Leader2."ar array ESL ".g:Tex_Leader2."sl slide" \."\n EDM ".g:Tex_Leader2."dm displaymath EAB ".g:Tex_Leader2."ab abstract" \."\n EAL ".g:Tex_Leader2."al align EAP ".g:Tex_Leader2."ap appendix" \."\n EEQ ".g:Tex_Leader2."eq equation ECE ".g:Tex_Leader2."ce center" \."\n EDO ".g:Tex_Leader2."do document EFI ".g:Tex_Leader2."fi figure" \."\n EFC ".g:Tex_Leader2."fc filecontents ELR ".g:Tex_Leader2."lr lrbox" \."\n EFL ".g:Tex_Leader2."fl flushleft EMP ".g:Tex_Leader2."mp minipage" \."\n EFR ".g:Tex_Leader2."fr flushright EPI ".g:Tex_Leader2."pi picture" \."\n EMA ".g:Tex_Leader2."ma math EQE ".g:Tex_Leader2."qe quote" " }}} " Font shortcuts {{{ let g:fontshortcuts = '' \."\n Font shortcuts" \."\n is a value of g:Tex_Leader" \."\n Shortcuts Effects" \."\n I v&V I&v V" \."\n FBF ".g:Tex_Leader."bf \\textbf{} {\\bfseries }" \."\n FMD ".g:Tex_Leader."md \\textmd{} {\\mdseries }" \."\n" \."\n FTT ".g:Tex_Leader."tt \\texttt{} {\\ttfamily }" \."\n FSF ".g:Tex_Leader."sf \\textsf{} {\\sffamily }" \."\n FRM ".g:Tex_Leader."rm \\textrm{} {\\rmfamily }" \."\n" \."\n FUP ".g:Tex_Leader."up \\textup{} {\\upshape }" \."\n FSL ".g:Tex_Leader."sl \\textsl{} {\\slshape }" \."\n FSC ".g:Tex_Leader."sc \\textsc{} {\\scshape }" \."\n FIT ".g:Tex_Leader."it \\textit{} {\\itshape }" " }}} " Section shortcuts {{{ let g:sectionshortcuts = '' \."\n Section shortcuts" \."\n is a value of g:Tex_Leader2" \."\n I v&V" \."\n SPA ".g:Tex_Leader2."pa part" \."\n SCH ".g:Tex_Leader2."ch chapter" \."\n SSE ".g:Tex_Leader2."se section" \."\n SSS ".g:Tex_Leader2."ss subsection" \."\n SS2 ".g:Tex_Leader2."s2 subsubsection" \."\n SPG ".g:Tex_Leader2."pg paragraph" \."\n SSP ".g:Tex_Leader2."sp subparagraph" " }}} " Math shortcuts {{{ let g:mathshortcuts = '' \."\n Math shortcuts - Insert mode" \."\n `a \\alpha `b \\beta" \."\n `g \\gamma `d \\delta" \."\n `e \\varepsilon `z \\zeta" \."\n `h \\eta `q \\theta" \."\n `i \\iota `k \\kappa" \."\n `l \\lambda `m \\mu" \."\n `n \\nu `x \\xi" \."\n `p \\pi `r \\rho" \."\n `s \\sigma `v \\varsigma" \."\n `t \\tau `u \\upsilon" \."\n `f \\varphi `c \\chi" \."\n `y \\psi `w \\omega" \."\n `A \\Alpha `B \\Beta" \."\n `G \\Gamma `D \\Delta" \."\n `E \\Epsilon `Z \\mathrm{Z}" \."\n `H \\Eta `K \\Kappa" \."\n `L \\Lambda `M \\Mu" \."\n `N \\Nu `X \\Xi" \."\n `P \\Pi `R \\Rho" \."\n `S \\Sigma `T \\Tau" \."\n `U \\Upsilon `C \\Chi" \."\n `Y \\Psi `W \\Omega" \."\n `( \\subset `) \\Subset" \."\n `= \\equiv =~ \\approx" \."\n `- \\bigcap `+ \\bigcup" \."\n `. \\cdot `* \\times" \."\n `\\ \\setminus `@ \\circ" \."\n `& \\wedge `, \\nonumber" \."\n `8 \\infty `_ \\bar{}" \."\n `: \\ddot{} `; \\dot{}" \."\n `^ \\hat{} `~ \\tilde{}" \."\n `6 \\partial" " }}} " vim:fdm=marker:ff=unix:noet:ts=4:sw=4