|DWIM(1)||General Commands Manual||DWIM(1)|
dwim — do what I
mean with a given phrase (file, URL etc.)
dwim is a program similar to Plan 9's
plumber. It takes a string (phrase) and matches it
against a number of regular expressions, which are connected to handlers,
specifying what to do with the phrase.
If no phrase is given, the current X
selection is retrieved from xsel(1). This is surprisingly
useful. If you assign a shortcut key to invoke
in your window manager, you can select a string of text, press the shortcut
dwim will act on the selected text.
xtitle program is installed on the
dwim will try to figure out the current
working directory from the window title. The following title formats are
Tilde expansion is supported.
Open Makefile in the configured text editor:
$ ls LICENSE Makefile README.md repl repl.1 repl.c $ dwim Makefile
If we represent the current X selection with bold text, the following procedure opens message-window.lisp on line 164 in the configured text editor:
$ grep -n 'def.*indicator ' *.lisp message-window.lisp:164:(defun show-frame-indicator (group &optional force) $ dwim
dwim is configured by editing the source
code. It is a simple Perl script, which uses regular expressions to parse
phrases. Default programs are defined at the top of the script. The
following associations are defined by default:
OPENER is only used if the
-o flag is specified.
John Ankarström <john (at) ankarstrom.se>
|July 4, 2022||OpenBSD 7.0|