fuzzyworld

template / windows / files / default_config.go

Branch windows · default branch · all branches

default_config.go

8.5 KB · history · blame

1package main
2
3func defaultConfig() Config {
4 config := Config{
5 Profiles: []Profile{
6 {
7 Name: "daily",
8 Description: "Creates a MD file in ~/DailyNotes folder in the format YYYY-MM-DD[-vX].md",
9 Path: "~/DailyNotes",
10 Type: FileType,
11 NamePatterns: []ParameterizedText{"{{.Year}}-{{.Month}}-{{.Day}}.md"},
12 File: File{
13 Template: `# {{.FileNameWithoutExtension}}
14
15Today's notes for {{.Year}}-{{.Month}}-{{.Day}}.
16
17## Todo
18
191. Check email
202. Check chat
213. Check calendar
224. Check yesterday's notes
235. Have fun!
246. ADD MORE ITEMS HERE`,
25 },
26 PostScripts: []ParameterizedText{
27 "code . {{ if .FullPath }}\"{{.FullPath}}\"{{else}}(ls -t | head -n1){{ end }}",
28 },
29 RunPostscriptOnFailure: true,
30 },
31 {
32 Name: "note",
33 Description: "Creates a MD file in ~/Notes in the format YYYY-MM-DD[-ProjectName][-vVersion].md",
34 OS: "All",
35 Path: "~/Notes",
36 Type: FileType,
37 NamePatterns: []ParameterizedText{
38 "{{$version := getVersion}}" +
39 "{{.Year}}-{{.Month}}-{{.Day}}" +
40 "{{if .ProjectName}}-{{.ProjectName}}{{end}}" +
41 "{{if (gt $version 1)}}n{{$version}}{{end}}" +
42 ".md",
43 },
44 PostScripts: []ParameterizedText{
45 "code \"{{.FullPath}}\"",
46 },
47 },
48 {
49 Name: "note-here",
50 Description: "Creates a MD file in the current folder in the format YYYY-MM-DD[-HH[-MM[-SS]]][-ProjectName][-vVersion].md",
51 OS: "All",
52 Type: FileType,
53 IsDefault: true,
54 Path: ".", // current folder
55 NamePatterns: []ParameterizedText{
56 "{{$version := getVersion}}" +
57 "{{.Year}}-{{.Month}}-{{.Day}}" +
58 "{{if .ProjectName}}-{{.ProjectName}}{{end}}" +
59 "{{if (gt $version 1)}}n{{$version}}{{end}}" +
60 ".md",
61 "{{$version := getVersion}}" +
62 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}" +
63 "{{if .ProjectName}}-{{.ProjectName}}{{end}}" +
64 "{{if (gt $version 1)}}n{{$version}}{{end}}" +
65 ".md",
66 "{{$version := getVersion}}" +
67 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Second}}" +
68 "{{if .ProjectName}}-{{.ProjectName}}{{end}}" +
69 "{{if (gt $version 1)}}n{{$version}}{{end}}" +
70 ".md",
71 },
72 PostScripts: []ParameterizedText{
73 "code \"{{.FullPath}}\"",
74 },
75 },
76 {
77 Name: "blog",
78 Description: "Creates a MD file in the ~/Blog folder in the format YYYY-MM-DD[-ProjectName][-vVersion].md",
79 OS: "All",
80 Path: "~/Blog",
81 File: File{
82 Template: `# {{.ProjectName}}
83
84Created by template, on {{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}.
85
86## Spelling
87
88cspell:words nanite
89
90## Removed writing
91
92## Writing
93`,
94 },
95 Type: FileType,
96 NamePatterns: []ParameterizedText{
97 "{{$version := getVersion}}" +
98 "{{.Year}}-{{.Month}}-{{.Day}}" +
99 "{{if .ProjectName}}-{{.ProjectName}}{{end}}" +
100 "{{if (gt $version 1)}}v{{$version}}{{end}}" +
101 ".md",
102 },
103 PostScripts: []ParameterizedText{
104 "code . \"{{.FileName}}\"",
105 },
106 },
107 {
108 Name: "work-win",
109 Description: "Creates a folder in the c:/work folder in the format YYYY-MM-DD[-hh][-mm][-ss][-ProjectName]",
110 OS: "Windows",
111 Path: "C:/work",
112 Type: FolderType,
113 NamePatterns: []ParameterizedText{
114 "{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
115 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
116 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
117 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
118 },
119 PostScripts: []ParameterizedText{
120 "explorer \"{{.Path}}\"",
121 },
122 },
123 {
124 Name: "therapy",
125 Description: "Creates a MD file in the ~/Therapy folder in the format YYYY-MM-DD[-vVersion].md",
126 OS: "All",
127 Path: "~/Therapy",
128 File: File{
129 Template: `# {{if .ProjectName}}{{.ProjectName}}{{else}}Therapy notes{{end}}
130
131{{if .ProjectName}}Therapy notes on {{.ProjectName}}{{else}}Therapy notes{{end}}
132
133## Writing
134
135{{if .ProjectName}}Hello {{.ProjectName}},{{else}}Hello,{{end}}
136
137Start writing here...
138
139Sincerely, me
140`,
141 },
142 Type: FileType,
143 NamePatterns: []ParameterizedText{
144 "{{$version := getVersion}}" +
145 "{{.Year}}-{{.Month}}-{{.Day}}" +
146 "{{if (gt $version 1)}}v{{$version}}{{end}}" +
147 ".md",
148 },
149 PostScripts: []ParameterizedText{
150 "code . {{.FullPath}}",
151 },
152 },
153 {
154 Name: "work",
155 Description: "Creates a folder in the ~/Work folder in the format YYYY-MM-DD[-hh][-mm][-ss][-ProjectName]",
156 Path: "~/Work",
157 Type: FolderType,
158 NamePatterns: []ParameterizedText{
159 "{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
160 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
161 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
162 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
163 },
164 PostScripts: []ParameterizedText{
165 "code .",
166 "chmod +x repro.sh",
167 },
168 Files: []FileInFolder{
169 {
170 File: File{
171 Template: `# {{.ProjectName}}
172
173Work notes on {{.ProjectName}}
174`,
175 },
176 Name: "README.md",
177 },
178 {
179 File: File{
180 Template: `clear
181
182echo "Let's test {{.ProjectName}}!"`,
183 },
184 Name: "repro.sh",
185 },
186 {
187 File: File{
188 Template: `{
189 "version": "0.2.0",
190 "configurations": [
191 {
192 "type": "bashdb",
193 "request": "launch",
194 "name": "Debug repo.sh",
195 "cwd": "${workspaceFolder}",
196 "program": "${workspaceFolder}/repro.sh",
197 "terminalKind": "integrated"
198 }
199 ]
200}
201 `,
202 },
203 Name: ".vscode/launch.json",
204 },
205 },
206 },
207 {
208 Name: "folder",
209 Description: "Creates a folder in the current folder in the format YYYY-MM-DD[-ProjectName][-vVersion]",
210 Type: FolderType,
211 Path: ".", // current folder
212 PostScripts: []ParameterizedText{},
213 NamePatterns: []ParameterizedText{
214 "{{$version := getVersion}}" +
215 "{{.Year}}-{{.Month}}-{{.Day}}" +
216 "{{if .ProjectName}}-{{.ProjectName}}{{end}}" +
217 "{{if (gt $version 1)}}-n{{$version}}{{end}}",
218 },
219 },
220 {
221 Name: "create-react-app",
222 Type: FolderType,
223 Description: "Creates a folder in the current folder in the format create-react-app[-ProjectName][-vVersion], runs `npx create-react-app` to initialize the folder, and opens the folder in VSCode",
224 Path: ".", // current folder
225 NamePatterns: []ParameterizedText{
226 "{{$version := getVersion}}" +
227 "create-react-app" +
228 "{{if .ProjectName}}-{{.ProjectName}}{{end}}" +
229 "{{if (gt $version 1)}}-n{{$version}}{{end}}",
230 },
231 PostScripts: []ParameterizedText{
232 "npx create-react-app .",
233 "code .",
234 },
235 },
236 {
237 Name: "git",
238 Description: "Creates a folder in the ~/code folder in the format YYYY-MM-DD[-hh][-mm][-ss][-ProjectName]",
239 Path: "~/code",
240 Type: FolderType,
241 NamePatterns: []ParameterizedText{
242 "{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
243 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
244 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
245 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
246 },
247 PostScripts: []ParameterizedText{
248 "git init",
249 "code .",
250 },
251 },
252 {
253 Name: "git-clone",
254 Description: "DISABLED - Clones a repository into a new folder under ~/code in the format YYYY-MM-DD[-hh][-mm][-ss][-ProjectName]",
255 IsDisabled: true,
256 Path: "~/code",
257 Type: FolderType,
258 NamePatterns: []ParameterizedText{
259 "{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
260 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
261 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
262 "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}",
263 },
264 PostScripts: []ParameterizedText{
265 "git clone {{.Url}} .",
266 "code .",
267 },
268 },
269 },
270 }
271
272 return config
273}