From: Lukáš Jiřiště Date: Tue, 18 Nov 2025 09:52:34 +0000 (+0100) Subject: Add a template and a function for LaTeX Makefile X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=fb8c6c67c62566096091b3ddac5d049f851e56af;p=dotfiles.git Add a template and a function for LaTeX Makefile Also remove any function tied to 42 and comment out the Plugin manager. --- diff --git a/vim/.vimrc b/vim/.vimrc index 1b75e75..7748a0e 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,23 +1,15 @@ -" Plugins will be downloaded under the specified directory. -" The Plugin manager project is on https://github.com/junegunn/vim-plug -call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged') - -" Declare the list of plugins. -" 42 Header on F1 -Plug 'https://github.com/42Paris/42header' - -Plug 'vim-latex/vim-latex' - -" List ends here. Plugins become visible to Vim after this call. -call plug#end() +"" Plugins will be downloaded under the specified directory. +"" The Plugin manager project is on https://github.com/junegunn/vim-plug +"call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged') +" +"Plug 'vim-latex/vim-latex' +" +"" List ends here. Plugins become visible to Vim after this call. +"call plug#end() " May be useful for vim-latex? let g:tex_flavor='latex' -" Defining name and email for the 42 header -let g:user42 = 'ljiriste' -let g:mail42 = 'ljiriste@student.42prague.com' - set nocompatible set tabstop=4 set shiftwidth=0 @@ -39,7 +31,7 @@ syntax on filetype plugin indent on " redundant after syntax on autocmd FileType gitcommit set spell spelllang=en_us -autocmd FileType tex set spell spelllang=en_us +autocmd FileType tex set spell spelllang=en_us,cs function Cpp_class(classname) let skel = join(readfile(glob('~/.vim/templates/class_skeleton.h')), "\n") @@ -47,3 +39,9 @@ function Cpp_class(classname) let skel = substitute(skel, 'CLASSNAME_H', toupper(a:classname) . "_H", 'g') put! =skel endfunction + +function Make_latex(target) + let skel = join(readfile(glob('~/.vim/templates/Makefile_latex')), "\n") + let skel = substitute(skel, 'target.pdf', a:target . '.pdf', 'g') + put! =skel +endfunction diff --git a/vim/templates/Makefile_latex b/vim/templates/Makefile_latex new file mode 100644 index 0000000..7d7adfc --- /dev/null +++ b/vim/templates/Makefile_latex @@ -0,0 +1,32 @@ + +TARGETS := target.pdf + +DEPS_DIR := .deps + +LATEXMK := latexmk \ + -recorder \ + -use-make \ + -deps \ + -e 'warn qq(In Makefile, turn off custion dependencies\n);' \ + -e '@cus_dep_list=();' \ + -e 'show_cus_dep()' \ + +.PHONY : clean fclean re + +all : $(TARGETS) + +$(DEPS_DIR): + mkdir $@ + +%.pdf : %.tex | $(DEPS_DIR) + $(LATEXMK) -pdf -dvi- -ps- -deps-out=$(DEPS_DIR)/$@.dep $< + +clean : + $(LATEXMK) -c + +fclean : + $(LATEXMK) -C + rm -rf $(DEPS_DIR) + +re : fclean + $(MAKE)