From 5959b63a2410c7b492519e37f2c2621002208019 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Sat, 6 Mar 2021 14:03:58 +0100 Subject: vim: latex binds --- .vim/vimrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to '.vim/vimrc') diff --git a/.vim/vimrc b/.vim/vimrc index adc58e9..19e4a82 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -74,6 +74,8 @@ vnoremap zf au filetype c* nmap :Make au filetype sh nmap :Runbuffer au filetype python nmap :Runbuffer +au filetype *tex nmap :Makelatex +au filetype *tex nmap :Openpdf nmap :Newterm @@ -107,9 +109,12 @@ command! MakeTags !ctags -R . command -bar Newterm call Run_in_terminal("") command -bar Runbuffer call Run_in_terminal(expand("%:p")) -command -bar Make call Run_in_terminal("make") +command -bar Make call Run_in_terminal("make run") command -bar Fileheader call Insert_Header(expand("%")) +command -bar Makelatex silent! execute "!pdflatex % > /dev/null 2>&1 &" | redraw! +command Openpdf silent! execute "!mupdf " . (join(split(expand("%"), '\.')[:-2], ".") . ".pdf") . " > /dev/null 2>&1 &" | redraw! + " =========== " FUNCTIONS " =========== @@ -117,7 +122,7 @@ command -bar Fileheader call Insert_Header(expand("%")) function Insert_Header(name) let l:name=systemlist("git config --global --get user.name")[0] let l:mail=systemlist("git config --global --get user.email")[0] - call append("0", ["/*", " * ".a:name, " * (c) ".strftime("%Y")." ".l:name." <".l:mail.">", " * License: ", " */"]) + call append("0", ["/*", " * ".a:name, " * (c) ".strftime("%Y")." ".l:name." <".l:mail.">", " * License: All rights reserved.", " */"]) startinsert endfunction -- cgit v1.2.3