diff --git a/flake.nix b/flake.nix index 6234fa9..f1128b2 100644 --- a/flake.nix +++ b/flake.nix @@ -98,9 +98,8 @@ imap jj augroup autosource - autocmd! - autocmd Filetype tex source vim/generic-envs.vim - autocmd Filetype tex source vim/generic.vim + source vim/generic-envs.vim + source vim/generic.vim augroup END ''; }; diff --git a/vim/circuit.vim b/vim/circuit.vim new file mode 100644 index 0000000..42ea519 --- /dev/null +++ b/vim/circuit.vim @@ -0,0 +1,13 @@ +augroup latex_circuitikz_abbr + iabbrev ctikz i\begin{circuitikz}\end{circuitikz}ki + iabbrev tobatt ato [battery2, invert, v={$E$}]a + iabbrev tores ato [R={$R$}]a + iabbrev toslo ato [short, o-]a + iabbrev toslc ato [short, *-]a + iabbrev tosro ato [short, -o]a + iabbrev tosrc ato [short, -*]a + iabbrev ndl anode[left]{.}5hf.vc + iabbrev ndr anode[right]{.}5hf.vc + iabbrev ndc anode{.}5hf.vc + iabbrev ohm a\Omegaa +augroup END diff --git a/vim/generic-envs.vim b/vim/generic-envs.vim index e51c3c7..a47caa7 100644 --- a/vim/generic-envs.vim +++ b/vim/generic-envs.vim @@ -7,5 +7,5 @@ augroup latex_generic_envs_abbr iabbrev codelsenv i\begin{lstlisting}[language=.,title={.}]\end{lstlisting}2k0f.vc iabbrev itemenv i\begin{itemize}\end{itemize}k iabbrev enumenv i\begin{enumerate}\end{enumerate}k - iabbrev figenv i\begin{figure}[tbh]\centering\end{figure}k + iabbrev figenv i\begin{figure}[tbh]\centering\caption{}\end{figure}k augroup END diff --git a/vim/generic.vim b/vim/generic.vim index 3c0ac3e..537112e 100644 --- a/vim/generic.vim +++ b/vim/generic.vim @@ -3,10 +3,52 @@ augroup latex_generic_abbr iabbrev ttt a\texttt{}a iabbrev tbf a\textbf{}a iabbrev tit a\textit{}a + iabbrev sec a\section{.}3hf.vc + iabbrev ssec a\subsection{.}3hf.vc iabbrev inm a$$a iabbrev m/ a\frac{}{}3ha iabbrev mpl a\left(a iabbrev mpr a\right)a - iabbrev simpletexbang a\documentclass[xelatex,a4paper,11pt,ja=standard]{bxjsarticle}\usepackage{tex/preamble}\usepackage{tex/simple-title}\usepackage{tex/report-paper}\reporttitle{}\reportauthor{}\reportdate{}{}{}\turnindate{}{}{}\begin{document}\simpletitle\end{document}gg6jf{a - iabbrev detailedtexbang a\documentclass[xelatex,a4paper,11pt,ja=standard]{bxjsarticle}\usepackage{tex/preamble}\usepackage{tex/detailed-title}\usepackage{tex/report-paper}\reporttitle{}\reportauthor{}\reportdate{}{}{}\turnindate{}{}{}\schoolname{}\department{}\subject{}\professor{}\studentid{}\seatingnum{}\begin{document}\detailedtitle\end{document}gg6jf{a + iabbrev minv a\frac{1}{.}3hf.vc augroup END + +function! Simpletexbang() + let l:name = input("Name: ") + let l:title = input("Title: ") + let l:todayYear = strftime('%Y') + let l:todayMonth = strftime('%m') + let l:todayDay = strftime('%d') + execute "normal i\\documentclass[xelatex,a4paper,11pt,ja=standard]{bxjsarticle}\n\n\\usepackage{tex/preamble}\n\\usepackage{tex/simple-title}\n\n" + execute "normal i\\reportauthor{" . l:name . "}\n" + execute "normal i\\reporttitle{" . l:title . "}\n" + execute "normal i\\reportdate{" . l:todayYear . "年}{" . l:todayMonth . "月}{" . l:todayDay . "日}\n" + execute "normal i\\turnindate{年}{月}{日}\n\n\\begin{document}\\end{document}" + execute "normal 02f{bhi\n\\simpletitle\n" +endfunction + +function! Detailedtexbang() + let l:name = input("Name: ") + let l:id = input("Student ID: ") + let l:seat = input("Seating Number: ") + let l:title = input("Title: ") + let l:school = input("School: ") + let l:dep = input("Department: ") + let l:subj = input("Subject: ") + let l:prof = input("Professor Name: ") + let l:todayYear = strftime('%Y') + let l:todayMonth = strftime('%m') + let l:todayDay = strftime('%d') + execute "normal i\\documentclass[xelatex,a4paper,11pt,ja=standard]{bxjsarticle}\n\n\\usepackage{tex/preamble}\n\\usepackage{tex/detailed-title}\n\n" + execute "normal i\\reportauthor{" . l:name . "}\n" + execute "normal i\\reporttitle{" . l:title . "}\n" + execute "normal i\\reportdate{" . l:todayYear . "年}{" . l:todayMonth . "月}{" . l:todayDay . "日}\n" + execute "normal i\\turnindate{年}{月}{日}\n" + execute "normal i\\schoolname{" . l:school . "}\n" + execute "normal i\\department{" . l:dep . "}\n" + execute "normal i\\subject{" . l:subj . "}\n" + execute "normal i\\professor{" . l:prof . "}\n" + execute "normal i\\studentid{" . l:id . "}\n" + execute "normal i\\seatingnum{" . l:seat . "}\n" + execute "normal i\n\\begin{document}\\end{document}" + execute "normal 02f{bhi\n\\detailedtitle\n" +endfunction diff --git a/vim/info-proc.vim b/vim/info-proc.vim index 1a37e75..5773a78 100644 --- a/vim/info-proc.vim +++ b/vim/info-proc.vim @@ -1,3 +1,3 @@ augroup latex_info_procs_abbr - iabbrev cas i\section{.}\lstinputlisting[language=C,title={.}]{.}\subsection{実行結果}\begin{center}\includegraphics[width=12cm]{.}\end{center}10k0f.vc + iabbrev cas i\section{.}\lstinputlisting[language=C,title={.}]{.}\subsection{実行結果}\begin{figure}[tbh]\centering\includegraphics[width=12cm]{.}\caption{.}\end{figure}10k0f.vc augroup END diff --git a/vim/packages.vim b/vim/packages.vim new file mode 100644 index 0000000..68580a1 --- /dev/null +++ b/vim/packages.vim @@ -0,0 +1,5 @@ +augroup latex_packages_abbr + iabbrev amsp i\usepackage{amsmath} + iabbrev tikzp i\usepackage{pgf} + iabbrev circp i\usepackage{circuitikz} +augroup END