-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhighlight-annotate.txt
127 lines (86 loc) · 3.72 KB
/
highlight-annotate.txt
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
================================================================================
INTRODUCTION *highlight-annotate.txt*
Highlight-annotate.nvim is a plugin for aiding reading and analyzing text files
such as logs or program sources.
The highlights and annotations are not persistent and last only for the current
editing session.
highlight_annotate.setup({}) *highlight_annotate.setup()*
Setup function to initialize the plugin and configure |:HA| command.
>
require('highlight-annotate').setup({})
<
Replace {} with your options. See |highlight-annotate-opts| for details.
opts *highlight-annotate-opts*
>
opts = {
-- create the default colors/styles, see |highlight-annotate-colors|
create_default_colors = true,
mappings = {
-- mapping to jump to the next annotation, set to false to diable
next_annotation = "]n",
-- mapping to jump to the previous annotation, set to false to diable
prev_annotation = "[n",
},
}
<
================================================================================
COLORS *highlight-annotate-colors*
This plugin defines the following colors/styles based on the solarized palette:
- magenta
- violet
- green
- red
- orange
- blue
- yellow
- cyan
- white
- black
Those can be overwritten by defining your own `HighlightAnnotateHl`-prefixed
and `HighlightAnnotateA`-prefixed highlights. See |:highlight|.
The plugin automatically picks up any definitions using the mentioned prefixes.
================================================================================
COMMAND *highlight-annotate-command*
:HA [op] ... *:HA*
:HA a [color] [text]
Add an annotation to the current line. Tab-completes colors. If color is
not provided defaults to magenta (see |highlight-annotate-colors|). If no
text is provided it only adds the "■" symbol.
Uses virtual text, see |nvim_buf_set_extmark()|.
NOTE: annotations are attached to a buffer.
:HA del-a [number]
Delete annotation on the current line. All arguments after the number are
ignored. Number is optional and when not provided the more recent
annotation is removed. Tab-completion provided.
:HA hl color [/pattern]
:HA hl [/pattern] color
Highlights pattern using selected background color (see
|highlight-annotate-colors|). If no pattern is provided the last used
search pattern is used.
Pattern must start with a slash ("/").
NOTE: annotations are attached to a |window|.
:HA list
Lists all the highlighted patterns.
:HA del-hl [number]
Deletes the selected highlight. All arguments after the number are ignored.
Number is optional and when not provided the more recent highlight is
removed. Tab-completion provided.
================================================================================
TELESCOPE EXTENSION *highlight-annotate-telescope*
Requires |telescope.nvim| plugin.
The extension can be loaded after telescope setup:
>
local telescope = require 'telescope'
-- regular telescope setup goes here
telescope.load_extension('highlight-annotate')
<
There's currently only one command that searches the annotations. It can be
invoked via the :Telescope command:
>
:Telescope highlight-annotate annotations
<
or a mapping can be created:
>
vim.keymap.set('n', '<Leader>fa', telescope.extensions["highlight-annotate"].annotations)
<
================================================================================