summaryrefslogtreecommitdiff
path: root/blobs/stitch/0.0.3/stitch.1
blob: 85bbcd95f7f19c82dd2ef131186f025ac849d910 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
.\" Pipe this output to groff -m man -K utf8 -T utf8 | less -R
.\"
.mso an.tmac
.TH "STITCH" 1 "" "Stitch 0.0.3 ALPHA" "Stitch Manual"
.\" Disable hyphenation and ragged-right
.nh
.ad l
.SH NAME
.P
stitch \N'45' write notes separately and compose
.SH SYNOPSIS
.P
\fBstitch\fR [\fB\N'45'\N'45'tag\fR=\fITAG\fR] [\fIOPTION\fR]…
.SH DESCRIPTION
.P
Stitch is a minimal note and todo composing tool inspired by Howm for Emacs\N'46' It works with any CLI editor and file format\N'46'
.P
Stitch comes preconfigured to handle an org\N'45'esque file format, but can be reconfigured to handle any file format you want (SEE ENVIRONMENT)\N'46' 
.P
To set up, you will need to set STITCH_DIRECTORY (SEE ENVIRONMENT) at minimum\N'46' Stitch does not come with any built\N'45'in note\N'45'capturing tool, but you can easily set one up on your own (SEE EXAMPLES)\N'46'
.P
Stitch currently only works with a system where you have one file per note\N'46'
.P
When you enter the program for the first time, press \N'39'?\N'39' to see the list of keybindings\N'46'
.SH COMMANDS
.P

.P
You can run arbitrary commands in Stitch\N'46' These commands can make use of the variable substitutions below\N'46'
.TP 4
%(file)
Currently selected file
.TP 4
%(line)
Currently selected content
.SH OPTIONS
.TP 4
\fB\N'45't\fR \fITAG\fR, \fB\N'45'\N'45'tag\fR=\fITAG\fR
Search entries for a given tag\N'46'
.SH COMMON OPTIONS
.TP 4
\fB\N'45'\N'45'help\fR[=\fIFMT\fR] (default=\fBauto\fR)
Show this help in format \fIFMT\fR\N'46' The value \fIFMT\fR must be one of \fBauto\fR, \fBpager\fR, \fBgroff\fR or \fBplain\fR\N'46' With \fBauto\fR, the format is \fBpager\fR or \fBplain\fR whenever the \fBTERM\fR env var is \fBdumb\fR or undefined\N'46'
.TP 4
\fB\N'45'\N'45'version\fR
Show version information\N'46'
.SH EXIT STATUS
.P
\fBstitch\fR exits with:
.TP 4
0
on success\N'46'
.TP 4
123
on indiscriminate errors reported on standard error\N'46'
.TP 4
124
on command line parsing errors\N'46'
.TP 4
125
on unexpected internal errors (bugs)\N'46'
.SH ENVIRONMENT
.P
These environment variables affect the execution of \fBstitch\fR:
.TP 4
\fBSTITCH_DIRECTORY\fR
Directory where Stitch should search for notes\N'46' Needs to be set in order for the program to work\N'46' Must be absolute path, I\N'46'E /home/bob/notes
.TP 4
\fBSTITCH_DONE\fR
Pattern for DONE items\N'46' Used for substitution\N'46' (Default "* DONE")
.TP 4
\fBSTITCH_DONE_REGEXP\fR
Regexp used by grep to find DONE items\N'46' Needs to be double escaped for OCaml\N'46' (Default "^\N'92'* DONE")
.TP 4
\fBSTITCH_GREP_CMD\fR
Grep command to use (defaults to "grep")\N'46' Stitch also works well with ugrep, which greatly speeds up the program\N'46'
.TP 4
\fBSTITCH_HEADLINE_PATTERN\fR
Pattern to use for headlines\N'46' (Default "* ")
.TP 4
\fBSTITCH_HEADLINE_PATTERN_REGEXP\fR
Pattern to use by grep to fetch headlines\N'46' Needs to be double escaped for OCaml\N'46' (Default "^\N'92'* ")
.TP 4
\fBSTITCH_TAG_PATTERN\fR
Pattern used by grep to find tags\N'46' (Default ":[a\N'45'z\N'45']+:", matches :a\N'45'tag:
.TP 4
\fBSTITCH_TODO\fR
Pattern for TODOS\N'46' Used for substitution\N'46' (Default "* TODO")
.TP 4
\fBSTITCH_TODO_REGEXP\fR
Regexp used by grep to find TODO items\N'46' Needs to be double escaped for OCaml\N'46' (Default "^\N'92'* TODO")
.SH EXAMPLES
.P
To get started, start by setting up a note directory in your shell profile
.P
.nf
export STITCH_DIRECTORY=/home/bob/notes
.fi
.P
Stitch does not specify anything on how to capture your notes, but you can add the following in your profile to have a basic note capturing system\N'46'
.P
.nf
function capture {
  JRNL="$STITCH_DIRECTORY/$(date +\N'39'%y\N'45'%m\N'45'%d\N'46'%H:%M\N'46'%S\N'39')\N'46'org"
  echo \N'39'*  \N'39' > /tmp/capture  
  $EDITOR /tmp/capture +1
  if grep \N'45'q \N'39'^\N'92'*\N'92's*$\N'39' /tmp/capture 
  then 
     echo "Empty capture; ignoring"
  else 
     echo "Storing capture in $JRNL"
     cat /tmp/capture > $JRNL
  fi
}
.fi
.P
Now you can run capture in your terminal and it will prompt you to write your note and store it in your notes with a timestamp\N'46'
.P
With that, you can begin to capture your notes and they will be displayed in reverse chronological order in stitch\N'46' You can add tags, for example :journal: and :work:\N'46'
.P
Once added, you can start viewing your notes in Stitch\N'46' So if you added a few journal notes, you can view them with
.P
.nf
stitch \N'45't :journal:
.fi
.P
If you press s, you will see toggle to see all notes stitched together\N'46' You can see all commands with \N'39'?\N'39'
.P
You can also launch stitch without arguments to see all\N'46'
.P
To set up TODO capturing, you can add a command to your shell profile to capture TODO items
.P
.nf
function todo {
  TODO_BASE=\N'39'* TODO  \N'39'
  JRNL="$STITCH_DIRECTORY/$(date +\N'39'%y\N'45'%m\N'45'%d\N'46'%H:%M\N'46'%S\N'39')\N'46'org"
  echo \N'39'* TODO  \N'39' > /tmp/capture
  $EDITOR /tmp/capture +1"
  if grep \N'45'q \N'39'^\N'92'* TODO\N'92's*$\N'39' /tmp/capture 
  then 
     echo "Empty capture"
  else 
     echo "Storing capture in $JRNL"
     cat /tmp/capture > $JRNL
  fi
}
.fi
.P
After that, you can capture a few TODO items, and you will be able to view them if you press 2\N'46' You can see done items if you press 3\N'46' Press \N'39'?\N'39' to see how to toggle the todo items\N'46'
.SH BUGS
.P
Email bug reports to ~marcc/stitch\N'45'general@lists\N'46'sr\N'46'ht\N'46'
.SH AUTHORS
.P
Marc Coquand (mccd\N'46'space)
.SH CREDIT
.P
Stitch was inspired by the note\N'45'taking tool Howm for EMacs by HIRAOKA Kazuyuki\N'46'