aboutsummaryrefslogtreecommitdiff
path: root/doc/colorizer.txt
blob: 0dfbf63e5d7a1148d50d520da0c68f86fc5fb0c2 (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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
*colorizer*    Requires Neovim >= 0.7.0 and `set termguicolors`

Highlights terminal CSI ANSI color codes.

Author: Ashkan Kiani <from-nvim-colorizer.lua@kiani.io>

==============================================================================
USAGE                                                          *colorizer-usage*

 Establish the autocmd to highlight all filetypes.

       `lua require 'colorizer'.setup()`

 Highlight using all css highlight modes in every filetype

       `lua require 'colorizer'.setup(user_default_options = { css = true; })`

==============================================================================
USE WITH COMMANDS                                          *colorizer-commands*

   *:ColorizerAttachToBuffer*

       Attach to the current buffer and start highlighting with the settings as
       specified in setup (or the defaults).

       If the buffer was already attached(i.e. being highlighted), the
       settings will be reloaded with the ones from setup.
       This is useful for reloading settings for just one buffer.

   *:ColorizerDetachFromBuffer*

       Stop highlighting the current buffer (detach).

   *:ColorizerReloadAllBuffers*

       Reload all buffers that are being highlighted currently.
       Shortcut for ColorizerAttachToBuffer on every buffer.

   *:ColorizerToggle*
       Toggle highlighting of the current buffer.

USE WITH LUA

       All options that can be passed to user_default_options in `setup`
       can be passed here. Can be empty too.
       `0` is the buffer number here

       Attach to current buffer >
	   require("colorizer").attach_to_buffer(0, {
	     mode = "background",
	     css = false,
	   })
<
       Detach from buffer >
	   require("colorizer").detach_from_buffer(0, {
	     mode = "background",
	     css = false,
	   })
<

    See:~
	|colorizer.setup|
	|colorizer.attach_to_buffer|
	|colorizer.detach_from_buffer|

==============================================================================
LUA API                                                      *colorizer-lua-api*

Functions: ~
    |highlight_buffer| - Highlight the buffer region

    |is_buffer_attached| - Check if attached to a buffer.

    |detach_from_buffer| - Stop highlighting the current buffer.

    |attach_to_buffer| - Attach to a buffer and continuously highlight changes.

    |setup| - Easy to use function if you want the full setup without fine
    grained control.

    |get_buffer_options| - Return the currently active buffer options.

    |reload_all_buffers| - Reload all of the currently active highlighted
    buffers.

    |clear_highlight_cache| - Clear the highlight cache and reload all buffers.

Tables: ~
    |user_default_options| - defaults options.

Fields: ~
    |DEFAULT_NAMESPACE| - Default namespace used in `colorizer.buffer.highlight`
    and `attach_to_buffer`.


highlight_buffer()                                  *colorizer.highlight_buffer*
    Highlight the buffer region

    See also:~
	|colorizer.buffer.highlight|



is_buffer_attached({buf})                         *colorizer.is_buffer_attached*
    Check if attached to a buffer.

    Parameters: ~
	{buf} -  number|nil: A value of 0 implies the current buffer.

    returns:~
	number or nil: if attached to the buffer, false otherwise.

    See also:~
	|colorizer.buffer.highlight|



detach_from_buffer({buf}, {ns})                   *colorizer.detach_from_buffer*
    Stop highlighting the current buffer.

    Parameters: ~
	{buf} -  number|nil: buf A value of 0 or nil implies the current buffer.
	{ns} -  number|nil: ns the namespace id, if not given DEFAULT_NAMESPACE
	is used



attach_to_buffer({buf}, {options}, {typ})           *colorizer.attach_to_buffer*
    Attach to a buffer and continuously highlight changes.

    Parameters: ~
	{buf} -  integer: A value of 0 implies the current buffer.
	{options} -  table|nil: Configuration options as described in `setup`
	{typ} -  string|nil: "buf" or "file" - The type of buffer option



setup({config})                                                *colorizer.setup*
    Easy to use function if you want the full setup without fine grained
    control.

    Setup an autocmd which enables colorizing for the filetypes and options
    specified.

    By default highlights all FileTypes.

    Example config:~
>
      { filetypes = { "css", "html" }, user_default_options = { names = true } }
<
    Setup with all the default options:~
>
	require("colorizer").setup {
	  filetypes = { "*" },
	  user_default_options,
	  -- all the sub-options of filetypes apply to buftypes
	  buftypes = {},
	}
<
    For all user_default_options, see |user_default_options|


    Parameters: ~
	{config} -  table: Config containing above parameters.

    Usage:~
	`require'colorizer'.setup()`



get_buffer_options({buf})                         *colorizer.get_buffer_options*
    Return the currently active buffer options.

    Parameters: ~
	{buf} -  number|nil: Buffer number

    returns:~
	table or nil



reload_all_buffers()                              *colorizer.reload_all_buffers*
    Reload all of the currently active highlighted buffers.



clear_highlight_cache()                        *colorizer.clear_highlight_cache*
    Clear the highlight cache and reload all buffers.



user_default_options                            *colorizer.user_default_options*
    defaults options.

    In `user_default_options`, there are 2 types of options

    1. Individual options - `names`, `RGB`, `RRGGBB`, `RRGGBBAA`, `hsl_fn`,
       `rgb_fn` , `RRGGBBAA`, `AARRGGBB`, `tailwind`, `sass`

    1. Alias options - `css`, `css_fn`

    If `css_fn` is true, then `hsl_fn`, `rgb_fn` becomes `true`

    If `css` is true, then `names`, `RGB`, `RRGGBB`, `RRGGBBAA`, `hsl_fn`,
    `rgb_fn` becomes `true`

    These options have a priority, Individual options have the highest priority,
    then alias options

    For alias, `css_fn` has more priority over `css`

    e.g: Here `RGB`, `RRGGBB`, `RRGGBBAA`, `hsl_fn`, `rgb_fn` is enabled but not
    `names`

>
      require 'colorizer'.setup { user_default_options = { names = false, css =
      true } }
<

    e.g: Here `names`, `RGB`, `RRGGBB`, `RRGGBBAA` is enabled but not `rgb_fn`
    and `hsl_fn`

>
      require 'colorizer'.setup { user_default_options = { css_fn = false, css =
      true } }
<

>
      user_default_options = {
	  RGB = true, -- #RGB hex codes
	  RRGGBB = true, -- #RRGGBB hex codes
	  names = true, -- "Name" codes like Blue or blue
	  RRGGBBAA = false, -- #RRGGBBAA hex codes
	  AARRGGBB = false, -- 0xAARRGGBB hex codes
	  rgb_fn = false, -- CSS rgb() and rgba() functions
	  hsl_fn = false, -- CSS hsl() and hsla() functions
	  css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB,
	  RRGGBB
	  css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
	  -- Available modes for `mode`: foreground, background,  virtualtext
	  mode = "background", -- Set the display mode.
	  -- Available methods are false / true / "normal" / "lsp" / "both"
	  -- True is same as normal
	  tailwind = false, -- Enable tailwind colors
	  -- parsers can contain values used in |user_default_options|
	  sass = { enable = false, parsers = { css }, }, -- Enable sass colors
	  virtualtext = "■",
      }
<


    Fields: ~
	{RGB} -  boolean
	{RRGGBB} -  boolean
	{names} -  boolean
	{RRGGBBAA} -  boolean
	{AARRGGBB} -  boolean
	{rgb_fn} -  boolean
	{hsl_fn} -  boolean
	{css} -  boolean
	{css_fn} -  boolean
	{mode} -  string
	{tailwind} -  boolean|string
	{sass} -  table
	{virtualtext} -  string



DEFAULT_NAMESPACE                                  *colorizer.DEFAULT_NAMESPACE*
    Default namespace used in `colorizer.buffer.highlight` and
    `attach_to_buffer`.

    See also:~
	|colorizer.buffer.highlight|
	|attach_to_buffer|



==============================================================================
BUFFER                                           *colorizer.buffer-introduction*

Helper functions to highlight buffer smartly


==============================================================================
LUA API                                               *colorizer.buffer-lua-api*

Functions: ~
    |clear_hl_cache| - Clean the highlight cache

    |add_highlight| - Create highlight and set highlights

    |highlight| - Highlight the buffer region.

    |parse_lines| - Parse the given lines for colors and return a table
    containing
 rgb_hex and range per line

    |rehighlight| - Rehighlight the buffer if colorizer is active

Tables: ~
    |highlight_mode_names| - Highlight mode which will be use to render the
    colour

Fields: ~
    |default_namespace| - Default namespace used in `highlight` and
    `colorizer.attach_to_buffer`.


clear_hl_cache()                               *colorizer.buffer.clear_hl_cache*
    Clean the highlight cache




						*colorizer.buffer.add_highlight*
add_highlight({buf}, {ns}, {line_start}, {line_end}, {data}, {options})
    Create highlight and set highlights

    Parameters: ~
	{buf} -  number
	{ns} -  number
	{line_start} -  number
	{line_end} -  number
	{data} -  table: table output of `parse_lines`
	{options} -  table: Passed in setup, mainly for `user_default_options`




						    *colorizer.buffer.highlight*
highlight({buf}, {ns}, {line_start}, {line_end}, {options}, {options_local})
    Highlight the buffer region.

     Highlight starting from `line_start` (0-indexed) for each line described by
     `lines` in the
     buffer `buf` and attach it to the namespace `ns`.


    Parameters: ~
	{buf} -  number: buffer id
	{ns} -  number: The namespace id. Default is DEFAULT_NAMESPACE. Create
	it with `vim.api.nvim_create_namespace`
	{line_start} -  number: line_start should be 0-indexed
	{line_end} -  number: Last line to highlight
	{options} -  table: Configuration options as described in `setup`
	{options_local} -  table: Buffer local variables

    returns:~
	nil or boolean or number,table




						  *colorizer.buffer.parse_lines*
parse_lines({buf}, {lines}, {line_start}, {options})
    Parse the given lines for colors and return a table containing
     rgb_hex and range per line

    Parameters: ~
	{buf} -  number
	{lines} -  table
	{line_start} -  number: This is the buffer line number, from where to
	start highlighting
	{options} -  table: Passed in `colorizer.setup`, Only uses
	`user_default_options`

    returns:~
	table or nil




						  *colorizer.buffer.rehighlight*
rehighlight({buf}, {options}, {options_local}, {use_local_lines})
    Rehighlight the buffer if colorizer is active

    Parameters: ~
	{buf} -  number: Buffer number
	{options} -  table: Buffer options
	{options_local} -  table|nil: Buffer local variables
	{use_local_lines} -  boolean|nil Whether to use lines num range from
	options_local

    returns:~
	nil or boolean or number,table



highlight_mode_names                     *colorizer.buffer.highlight_mode_names*
    Highlight mode which will be use to render the colour

    Fields: ~
	{background} -
	{foreground} -
	{virtualtext} -



default_namespace                           *colorizer.buffer.default_namespace*
    Default namespace used in `highlight` and `colorizer.attach_to_buffer`.

    See also:~
	|highlight|
	|colorizer.attach_to_buffer|



==============================================================================
COLOR                                             *colorizer.color-introduction*

Helper functions to parse different colour formats


==============================================================================
LUA API                                                *colorizer.color-lua-api*

Functions: ~
    |argb_hex_parser| - parse for 0xaarrggbb and return rgb hex.

    |hsl_to_rgb| - Converts an HSL color value to RGB.

    |hsl_function_parser| - Parse for hsl() hsla() css function and return rgb
    hex.

    |hue_to_rgb| - Convert hsl colour values to rgb.

    |is_bright| - Determine whether to use black or white text.

    |name_parser| - Grab all the colour values from `vim.api.nvim_get_color_map`
    and create a lookup table.

    |rgb_function_parser| - Parse for rgb() css function and return rgb hex.

    |rgba_function_parser| - Parse for rgba() css function and return rgb hex.

    |rgba_hex_parser| - parse for #rrggbbaa and return rgb hex.


argb_hex_parser({line}, {i})                   *colorizer.color.argb_hex_parser*
    parse for 0xaarrggbb and return rgb hex.

     a format used in android apps


    Parameters: ~
	{line} -  string: line to parse
	{i} -  number: index of line from where to start parsing

    returns:~
	number or nil: index of line where the hex value ended
	string or nil: rgb hex value



hsl_to_rgb({h}, {s}, {l})                           *colorizer.color.hsl_to_rgb*
    Converts an HSL color value to RGB.

    Parameters: ~
	{h} -  number: Hue
	{s} -  number: Saturation
	{l} -  number: Lightness

    returns:~
	number or nil,number or nil,number or nil



hsl_function_parser({line}, {i}, {opts})   *colorizer.color.hsl_function_parser*
    Parse for hsl() hsla() css function and return rgb hex.

     For more info:
     https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hsl


    Parameters: ~
	{line} -  string: Line to parse
	{i} -  number: Index of line from where to start parsing
	{opts} -  table: Values passed from matchers like prefix

    returns:~
	number or nil: Index of line where the hsla/hsl function ended
	string or nil: rgb hex value



hue_to_rgb({p}, {q}, {t})                           *colorizer.color.hue_to_rgb*
    Convert hsl colour values to rgb.

     Source: https://gist.github.com/mjackson/5311256


    Parameters: ~
	{p} -  number
	{q} -  number
	{t} -  number

    returns:~
	number



is_bright({r}, {g}, {b})                             *colorizer.color.is_bright*
    Determine whether to use black or white text.


     ref: https://stackoverflow.com/a/1855903/837964
     https://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color


    Parameters: ~
	{r} -  number: Red
	{g} -  number: Green
	{b} -  number: Blue



name_parser({line}, {i}, {opts})                   *colorizer.color.name_parser*
    Grab all the colour values from `vim.api.nvim_get_color_map` and create a
    lookup table.

     COLOR_MAP is used to store the colour values


    Parameters: ~
	{line} -  string: Line to parse
	{i} -  number: Index of line from where to start parsing
	{opts} -  table: Currently contains whether tailwind is enabled or not



rgb_function_parser({line}, {i})           *colorizer.color.rgb_function_parser*
    Parse for rgb() css function and return rgb hex.

    Parameters: ~
	{line} -  string: Line to parse
	{i} -  number: Index of line from where to start parsing

    returns:~
	number or nil: Index of line where the rgb function ended
	string or nil: rgb hex value



rgba_function_parser({line}, {i})         *colorizer.color.rgba_function_parser*
    Parse for rgba() css function and return rgb hex.

     Todo consider removing the regexes here
     Todo this might not be the best approach to alpha channel.
     Things like pumblend might be useful here.


    Parameters: ~
	{line} -  string: Line to parse
	{i} -  number: Index of line from where to start parsing

    returns:~
	number or nil: Index of line where the rgba function ended
	string or nil: rgb hex value



rgba_hex_parser({line}, {i}, {opts})           *colorizer.color.rgba_hex_parser*
    parse for #rrggbbaa and return rgb hex.

     a format used in android apps


    Parameters: ~
	{line} -  string: line to parse
	{i} -  number: index of line from where to start parsing
	{opts} -  table: Containing minlen, maxlen, valid_lengths

    returns:~
	number or nil: index of line where the hex value ended
	string or nil: rgb hex value



==============================================================================
MATCHER                                         *colorizer.matcher-introduction*

Helper functions for colorizer to enable required parsers


==============================================================================
LUA API                                              *colorizer.matcher-lua-api*

Functions: ~
    |compile| - Form a trie stuct with the given prefixes

    |make| - Parse the given options and return a function with enabled parsers.


compile({matchers}, {matchers_trie})                 *colorizer.matcher.compile*
    Form a trie stuct with the given prefixes

    Parameters: ~
	{matchers} -  table: List of prefixes, {"rgb", "hsl"}
	{matchers_trie} -  table: Table containing information regarding
	non-trie based parsers

    returns:~
	function: function which will just parse the line for enabled parsers



make({options})                                         *colorizer.matcher.make*
    Parse the given options and return a function with enabled parsers.

    if no parsers enabled then return false
    Do not try make the function again if it is present in the cache


    Parameters: ~
	{options} -  table: options created in `colorizer.setup`

    returns:~
	function or boolean: function which will just parse the line for enabled
	parsers



==============================================================================
SASS                                               *colorizer.sass-introduction*

Helper functions to parse sass color variables


==============================================================================
LUA API                                                 *colorizer.sass-lua-api*

Functions: ~
    |cleanup| - Cleanup sass variables and watch handlers

    |name_parser| - Parse the given line for sass color names
 check for value in SASS[buf].DEFINITIONS_ALL

    |update_variables| - Parse the given lines for sass variabled and add to
    `SASS[buf].DEFINITIONS_ALL`.


cleanup({buf})                                          *colorizer.sass.cleanup*
    Cleanup sass variables and watch handlers

    Parameters: ~
	{buf} -  number



name_parser({line}, {i}, {buf})                     *colorizer.sass.name_parser*
    Parse the given line for sass color names
     check for value in SASS[buf].DEFINITIONS_ALL

    Parameters: ~
	{line} -  string: Line to parse
	{i} -  number: Index of line from where to start parsing
	{buf} -  number

    returns:~
	number or nil, string or nil




					       *colorizer.sass.update_variables*
update_variables({buf}, {line_start}, {line_end}, {lines}, {color_parser},
{options}, {options_local})
    Parse the given lines for sass variabled and add to
    `SASS[buf].DEFINITIONS_ALL`.

     which is then used in |sass_name_parser|
     If lines are not given, then fetch the lines with line_start and line_end


    Parameters: ~
	{buf} -  number
	{line_start} -  number
	{line_end} -  number
	{lines} -  table|nil
	{color_parser} -  function|boolean
	{options} -  table: Buffer options
	{options_local} -  table|nil: Buffer local variables



==============================================================================
TAILWIND                                       *colorizer.tailwind-introduction*

Helper functions to parse tailwind color variables


==============================================================================
LUA API                                             *colorizer.tailwind-lua-api*

Functions: ~
    |cleanup| - Cleanup tailwind variables and autocmd

    |setup_lsp_colors| - highlight buffer using values returned by tailwindcss
 To see these table information, see |colorizer.buffer|


cleanup({buf})                                      *colorizer.tailwind.cleanup*
    Cleanup tailwind variables and autocmd

    Parameters: ~
	{buf} -  number




					   *colorizer.tailwind.setup_lsp_colors*
setup_lsp_colors({buf}, {options}, {options_local}, {add_highlight})
    highlight buffer using values returned by tailwindcss
     To see these table information, see |colorizer.buffer|

    Parameters: ~
	{buf} -  number
	{options} -  table
	{options_local} -  table
	{add_highlight} -  function



==============================================================================
TRIE                                               *colorizer.trie-introduction*

Trie implementation in luajit.

todo: write documentation


==============================================================================
UTILS                                             *colorizer.utils-introduction*

Helper utils


==============================================================================
LUA API                                                *colorizer.utils-lua-api*

Functions: ~
    |byte_is_alphanumeric| - Obvious.

    |byte_is_hex| - Obvious.

    |byte_is_valid_colorchar| - Valid colorchars are alphanumeric and - (
    tailwind colors )

    |get_last_modified| - Get last modified time of a file

    |merge| - Merge two tables.

    |parse_hex| - Obvious.

    |percent_or_hex| - Obvious.

    |watch_file| - Watch a file for changes and execute callback


byte_is_alphanumeric({byte})              *colorizer.utils.byte_is_alphanumeric*
    Obvious.

    Parameters: ~
	{byte} -  number

    returns:~
	boolean



byte_is_hex({byte})                                *colorizer.utils.byte_is_hex*
    Obvious.

    Parameters: ~
	{byte} -  number

    returns:~
	boolean



byte_is_valid_colorchar({byte})        *colorizer.utils.byte_is_valid_colorchar*
    Valid colorchars are alphanumeric and - ( tailwind colors )

    Parameters: ~
	{byte} -  number

    returns:~
	boolean



get_last_modified({path})                    *colorizer.utils.get_last_modified*
    Get last modified time of a file

    Parameters: ~
	{path} -  string: file path

    returns:~
	number or nil: modified time



merge({...})                                             *colorizer.utils.merge*
    Merge two tables.


     todo: Remove this and use `vim.tbl_deep_extend`


    Parameters: ~
	{...} -

    returns:~
	table



parse_hex({byte})                                    *colorizer.utils.parse_hex*
    Obvious.

    Parameters: ~
	{byte} -  number

    returns:~
	number



percent_or_hex({v})                             *colorizer.utils.percent_or_hex*
    Obvious.

    Parameters: ~
	{v} -  string

    returns:~
	number or nil



watch_file({path}, {callback}, {...})               *colorizer.utils.watch_file*
    Watch a file for changes and execute callback

    Parameters: ~
	{path} -  string: File path
	{callback} -  function: Callback to execute
	{...} -  array: params for callback

    returns:~
	function or nil



vim:tw=80:ts=8:noet:ft=help:norl: