From 30396f438af8eda2873ae3b20d7e4a18d6fd34fe Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Mon, 11 Oct 2021 14:07:45 +0200 Subject: [PATCH] Adds :Format --- bin/compress-pdf | 9 +++++++++ init.vim | 3 +++ 2 files changed, 12 insertions(+) create mode 100755 bin/compress-pdf diff --git a/bin/compress-pdf b/bin/compress-pdf new file mode 100755 index 0000000..bd194b4 --- /dev/null +++ b/bin/compress-pdf @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +if [ $# -ne 2 ]; then + echo >&2 "errror: wrong number of arguments" + echo >&2 "usage: compress-pdf " + exit 1 +fi + +gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=$2 $1 diff --git a/init.vim b/init.vim index 0fdb498..e0de819 100644 --- a/init.vim +++ b/init.vim @@ -159,6 +159,9 @@ nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) +" Add `:Format` command to format current buffer. +command! -nargs=0 Format :call CocAction('format') + " Use K to show documentation in preview window. nnoremap K :call show_documentation()