Browse Source

folding adjusted for use with origami.el

Jaromil 4 years ago
parent
commit
9df91767f8
1 changed files with 27 additions and 1 deletions
  1. 27 1
      zuper

+ 27 - 1
zuper

@@ -1,4 +1,5 @@
1 1
 #!/usr/bin/env zsh
2
+## -*- origami-fold-style: triple-braces -*-
2 3
 #
3 4
 # Zuper - Zsh Ultimate Programmer's Extensions Refurbished
4 5
 #
@@ -32,6 +33,8 @@ arrs=(req freq)
32 33
 vars+=(zuper_version)
33 34
 zuper_version=0.2
34 35
 
36
+# {{{ Messaging
37
+
35 38
 # Messaging function with pretty coloring
36 39
 autoload colors
37 40
 colors
@@ -128,6 +131,9 @@ function _print() {
128 131
     return 0
129 132
 }
130 133
 
134
+# }}} Messaging
135
+
136
+# {{{ Debugging
131 137
 
132 138
 fn() {
133 139
     fun="$@"
@@ -236,6 +242,10 @@ endgame() {
236 242
 # unlike TRAPEXIT, the zshexit() hook is not called when functions exit.
237 243
 zshexit() { endgame EXIT; return $? }
238 244
 
245
+# }}} Debugging
246
+
247
+# {{{ Tempfiles
248
+
239 249
 ##########################
240 250
 # Temp file handling
241 251
 
@@ -262,6 +272,10 @@ _ztmp_destructor() {
262 272
 arrs+=(tmpfiles)
263 273
 destruens+=(_ztmp_destructor)
264 274
 
275
+# }}} Tempfiles
276
+
277
+# {{{ Strings
278
+
265 279
 # tokenizer, works only with one char length delimiters
266 280
 # saves everything in global array tok=()
267 281
 arrs+=(tok)
@@ -289,6 +303,12 @@ strtok() {
289 303
     [[ "$t" == "" ]] || tok+=($t)
290 304
 }
291 305
 
306
+# TODO: move in here some helpers
307
+
308
+# }}} Strings
309
+
310
+# {{{ Key/Value filesave
311
+
292 312
 # optional: define zkv=1 on source
293 313
 
294 314
 [[ "$zkv" = "" ]] || {
@@ -358,6 +378,10 @@ EOF
358 378
 
359 379
 }
360 380
 
381
+# }}} Key/Value filesave
382
+
383
+# {{{ Get/Set REST API
384
+
361 385
 # optional: define restful=1 on source
362 386
 
363 387
 [[ "$restful" = "" ]] || {
@@ -471,6 +495,8 @@ EOF
471 495
 
472 496
 }
473 497
 
498
+# }}} Get/Set REST API
499
+
474 500
 # {{{ Helpers
475 501
 [[ "$helpers" = "" ]] || {
476 502
 
@@ -700,4 +726,4 @@ BEGIN { found=0 }
700 726
 
701 727
 }
702 728
 
703
-# }}}
729
+# }}} Config