From aab38f32e0a02e43565a554d0a76ff65636499b8 Mon Sep 17 00:00:00 2001 From: Michal Hanus Date: Sat, 2 Mar 2024 18:49:55 +0100 Subject: crazyshit --- plugin/command.vim | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 plugin/command.vim (limited to 'plugin/command.vim') diff --git a/plugin/command.vim b/plugin/command.vim deleted file mode 100644 index 68b11f4..0000000 --- a/plugin/command.vim +++ /dev/null @@ -1,50 +0,0 @@ -" Capture output from a command to register @m, to paste, press "mp -command! -nargs=1 -complete=command Redir call utils#CaptureCommandOutput() - -command! -bar -bang -nargs=+ -complete=file Edit call utils#MultiEdit([]) -call utils#Cabbrev('edit', 'Edit') - -call utils#Cabbrev('man', 'Man') - -" show current date and time in human readable format -command! -nargs=? Datetime echo utils#iso_time() - -" Convert Markdown file to PDF -command! ToPDF call s:md_to_pdf() - -function! s:md_to_pdf() abort - " check if pandoc is installed - if executable('pandoc') != 1 - echoerr "pandoc not found" - return - endif - - let l:md_path = expand("%:p") - let l:pdf_path = fnamemodify(l:md_path, ":r") .. ".pdf" - - let l:header_path = stdpath('config') . '/resources/head.tex' - - let l:cmd = "pandoc --pdf-engine=xelatex --highlight-style=zenburn --table-of-content " . - \ "--include-in-header=" . l:header_path . " -V fontsize=10pt -V colorlinks -V toccolor=NavyBlue " . - \ "-V linkcolor=red -V urlcolor=teal -V filecolor=magenta -s " . - \ l:md_path . " -o " . l:pdf_path - - if g:is_mac - let l:cmd = l:cmd . '&& open ' . l:pdf_path - endif - - if g:is_win - let l:cmd = l:cmd . '&& start ' . l:pdf_path - endif - - " echomsg l:cmd - - let l:id = jobstart(l:cmd) - - if l:id == 0 || l:id == -1 - echoerr "Error running command" - endif -endfunction - -" json format -command! -range JSONFormat ,!python -m json.tool -- cgit v1.2.3