![]() |
![]()
| ![]() |
![]()
NAME
SYNOPSIS
DESCRIPTION
If the optional Makefile argument is not given, the Makefile will be read from stdin. This can be useful for editor integration where you might want to only format portions of your Makefile. The following options are available:
EDITOR INTEGRATIONYou can integrate Portfmt into your editor to conveniently run it only on parts of the port, e.g., to reformat USES after adding a new item to it. EmacsAdd this to ~/.emacs.d/init.el to format the current region with C-c p: (defun portfmt (&optional b e) "PORTFMT(1) on region" (interactive "r") (shell-command-on-region b e "portfmt " (current-buffer) t "*portfmt errors*" t)) (with-eval-after-load 'make-mode (define-key makefile-bsdmake-mode-map (kbd "C-c p") 'portfmt)) KakouneAdd this to ~/.config/kak/kakrc for
filtering the current selection through map global user 1 '|portfmt<ret>;' \ -docstring "portfmt on selection" VimAdd this to ~/.vimrc for filtering the
current selection through xnoremap <leader>1 <esc>:'<,'>!portfmt<CR> ENVIRONMENTThe following environment variables affect the execution of
EXIT STATUS
EXAMPLESIn-place format /usr/ports/audio/sndio/Makefile: portfmt -i /usr/ports/audio/sndio/Makefile SEE ALSOAUTHORSTobias Kortkamp <tobik@FreeBSD.org>
|