aboutsummaryrefslogtreecommitdiff
path: root/dwim
AgeCommit message (Collapse)Author
2021-06-15Open directories in ROX FilerJohn Ankarström
2021-06-08Handle function(callJohn Ankarström
2021-06-07stuffJohn Ankarström
2021-06-06Support ~home directoriesJohn Ankarstr\xf6m
2021-06-06Dynamically search include directories for header filesJohn Ankarstr\xf6m
2021-06-01Fix missing dirname function, handle 'manpage.section'John Ankarstr\xf6m
2019-10-23xbps package supportJohn
2019-06-08change names of handlersJohn
2019-06-08add handler for <header.h> notationJohn
2019-06-08disallow spaces in urls and e-mail addressesJohn
Technically, spaces are permitted in e-mail addresses if quoted, but this is very uncommon.
2019-06-08allow trailing , or . in manpage(section) regexJohn
2019-06-08allow more trailing characters in file:line regexJohn
2019-06-06add handler for man(section) notationJohn
2019-06-04run() subroutineJohn
`run` is basically an alias for `exec`, except it prints the command being executed to STDERR when the -d option is specified.
2019-06-04rename handlersJohn
2019-06-04fix http/mailto regexesJohn
2019-06-04formattingJohn
2019-06-03rename dwim.pl to dwimJohn
2019-06-03delete dwim symlinkJohn
2019-06-01dwim.plJohn
This is the Perl version of dwim. It is much easier to work with and extend, thanks to Perl's excellent regex support. The "phrase" (either $ARGV[0] or the primary X selection) is matched against regular expressions in the for loop (a primitive switch statement). This is the place to add handlers. Options are specified through environment variables, defined with default values in the section before the handlers. The `path` subroutine transforms a relative path to an absolute path based on the title of the current window. It depends on the `xtitle` program, and for it to work, you must instruct your shell (or editor) to set the terminal's title to the current directory (or currently edited file). (As such, `path` doesn't work with other programs than terminals and editors.)