Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jw4/jot
Open a date/time formatted file with default editor
https://github.com/jw4/jot
Last synced: 5 days ago
JSON representation
Open a date/time formatted file with default editor
- Host: GitHub
- URL: https://github.com/jw4/jot
- Owner: jw4
- Created: 2023-11-18T01:48:42.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-04-12T18:34:00.000Z (7 months ago)
- Last Synced: 2024-04-13T02:30:21.225Z (7 months ago)
- Language: C
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jot
Helper utility to open a (possibly new) file in $EDITOR.
The default will be to open a file named with todays date: `.md`, but there
are several configuration options, to use date, time, or an iso-8601 format datetime.Suffixes, prefixes, and root directories are also configurable.
## Config
The following environment variables can be used to override the defaults, and there
are command line flags that override the environment variables:### Environment Variables
#### `EDITOR`
Setting `EDITOR` (`export EDITOR=vim` for example), will specify which command will be used to open the file.
The command line flag `-e ` will override the environment.
#### `JOT_PREFIX`
Setting `JOT_PREFIX` will prepend the value to the generated base file name.
The flag `-p ` overrides the environment variable.
#### `JOT_SUFFIX`
Setting `JOT_PREFIX` will change the default `.md` to whatever is specified.
Any leading `.` will be stripped, and the final value of the prefix will be appended after the base file name as dot extension.The flag `-s ` overrides the env.
#### `JOT_ROOT`
`JOT_ROOT` can be set to specify a root directory for the file, overriding the default of the current working directory.
No path validation is performed, so if it doesn't exist, or is invalid the results are undetermined.The flag `-r ` overrides the env.
### Command line flags
#### `-d` (default)
Specifies the root filename pattern as an ISO date: ``
#### `-t`
Specifies the root filename pattern as a time: ``
#### `-i`
Specifies the root filename pattern as an ISO 8601 date time: ``
#### `-e `
Specifies which program to use to open the generated filename.
See `$EDITOR`.#### `-p `
Specifies a prefix value for the filename.
See `$JOT_PREFIX`.#### `-s `
Specifies the file suffix value for the filename.
See `$JOT_SUFFIX`.#### `-r `
Specifies the root directory for the filename.
See `$JOT_ROOT`.