-
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathconfig.lua
More file actions
238 lines (197 loc) · 9.23 KB
/
Copy pathconfig.lua
File metadata and controls
238 lines (197 loc) · 9.23 KB
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
-- All the following options can be set using the `setup` function.
-- Refer to the README for more information.
--- @class SmearCursor.Config
--- @field enabled? boolean
--- @field smear_between_buffers? boolean
--- @field smear_between_neighbor_lines? boolean
--- @field min_horizontal_distance_smear? integer
--- @field min_vertical_distance_smear? integer
--- @field smear_horizontally? boolean
--- @field smear_vertically? boolean
--- @field smear_diagonally? boolean
--- @field smear_to_cmd? boolean
--- @field scroll_buffer_space? boolean
--- @field legacy_computing_symbols_support? boolean
--- @field legacy_computing_symbols_support_vertical_bars? boolean
--- @field use_diagonal_blocks? boolean
--- @field vertical_bar_cursor? boolean
--- @field smear_insert_mode? boolean
--- @field vertical_bar_cursor_insert_mode? boolean
--- @field smear_replace_mode? boolean
--- @field smear_terminal_mode? boolean
--- @field horizontal_bar_cursor_replace_mode? boolean
--- @field never_draw_over_target? boolean
--- @field hide_target_hack? boolean
--- @field max_kept_windows? integer
--- @field windows_zindex? integer
--- @field filetypes_disabled? string[]
--- @field time_interval? integer
--- @field delay_disable? integer
--- @field delay_event_to_smear? integer
--- @field delay_after_key? integer
--- @field stiffness? number
--- @field trailing_stiffness? number
--- @field anticipation? number
--- @field damping? number
--- @field trailing_exponent? number
--- @field distance_stop_animating? number
--- @field stiffness_insert_mode? number
--- @field trailing_stiffness_insert_mode? number
--- @field damping_insert_mode? number
--- @field trailing_exponent_insert_mode? number
--- @field distance_stop_animating_vertical_bar? number
--- @field max_slope_horizontal? number
--- @field min_slope_vertical? number
--- @field max_angle_difference_diagonal? number
--- @field max_offset_diagonal? number
--- @field min_shade_no_diagonal? number
--- @field min_shade_no_diagonal_vertical_bar? number
--- @field color_levels? integer
--- @field gamma? number
--- @field gradient_exponent? number
--- @field max_shade_no_matrix? number
--- @field matrix_pixel_threshold? number
--- @field matrix_pixel_threshold_vertical_bar? number
--- @field matrix_pixel_min_factor? number
--- @field volume_reduction_exponent? number
--- @field minimum_volume_factor? number
--- @field max_length? number
--- @field max_length_insert_mode? number
--- @field particles_enabled? boolean
--- @field particle_max_num? integer
--- @field particle_spread? number
--- @field particles_per_second? number
--- @field particles_per_length? number
--- @field particle_max_lifetime? number
--- @field particle_lifetime_distribution_exponent? number
--- @field particle_max_initial_velocity? number
--- @field particle_velocity_from_cursor? number
--- @field particle_random_velocity? number
--- @field particle_damping? number
--- @field particle_gravity? number
--- @field min_distance_emit_particles? number
--- @field particle_switch_octant_braille? number
--- @field particles_over_text? boolean
--- @field logging_level? vim.log.levels
--- @type SmearCursor.Config
local M = {}
-- General configuration -------------------------------------------------------
-- Smear cursor when switching buffers or windows
M.smear_between_buffers = true
-- Smear cursor when moving within line or to neighbor lines
-- Use `min_horizontal_distance_smear` and `min_vertical_distance_smear` for finer control
M.smear_between_neighbor_lines = true
-- Only smear cursor when moving at least these distances
M.min_horizontal_distance_smear = 0
M.min_vertical_distance_smear = 0
-- Toggles for directions
M.smear_horizontally = true
M.smear_vertically = true
M.smear_diagonally = true -- Neither horizontal nor vertical
-- Smear cursor when entering or leaving command line mode
M.smear_to_cmd = true
-- Draw the smear in buffer space instead of screen space when scrolling
M.scroll_buffer_space = true
-- Set to `true` if your font supports legacy computing symbols (block unicode symbols).
-- Smears will blend better on all backgrounds.
M.legacy_computing_symbols_support = false
M.legacy_computing_symbols_support_vertical_bars = false
M.use_diagonal_blocks = true -- Only effective if `legacy_computing_symbols_support` is `true`
-- Set to `true` if your cursor is a vertical bar in normal mode.
M.vertical_bar_cursor = false
-- Smear cursor in insert mode.
-- See also `vertical_bar_cursor_insert_mode` and `distance_stop_animating_vertical_bar`.
M.smear_insert_mode = true
-- Set to `true` if your cursor is a vertical bar in insert mode.
M.vertical_bar_cursor_insert_mode = true
-- Smear cursor in replace mode.
M.smear_replace_mode = false
-- Smear cursor in terminal mode.
-- If the smear goes to the wrong location when enabled, try increasing `delay_after_key`.
M.smear_terminal_mode = false
-- Set to `true` if your cursor is a horizontal bar in replace mode.
M.horizontal_bar_cursor_replace_mode = true
-- Set to `true` to prevent the smear from overlapping the target character, hiding it until the animation is over.
M.never_draw_over_target = false
-- Attempt to hide the real cursor by drawing a character below it.
-- Can be useful when not using `termguicolors`
-- Do not set to `true` if `never_draw_over_target` is `false`.
M.hide_target_hack = false
-- Number of windows that stay open for rendering.
M.max_kept_windows = 50
-- Adjust to have the smear appear above or below other floating windows
M.windows_zindex = 300
-- List of filetypes where the plugin is disabled.
M.filetypes_disabled = {}
-- Sets animation framerate
M.time_interval = 17 -- milliseconds
-- Disable smear in the current buffer if the animation is stuck for at least this amount of time.
-- Set to nil to disable this feature.
M.delay_disable = nil -- milliseconds
-- Amount of time the cursor has to stay still before triggering animation.
-- Useful if the target changes and rapidly comes back to its original position.
-- E.g. when hitting a keybinding that triggers CmdlineEnter.
-- Increase if the cursor makes weird jumps when hitting keys.
M.delay_event_to_smear = 1 -- milliseconds
-- Delay for `vim.on_key` to avoid redundancy with vim events triggers.
M.delay_after_key = 5 -- milliseconds
-- Smear configuration ---------------------------------------------------------
-- How fast the smear's head moves towards the target.
-- 0: no movement, 1: instantaneous
M.stiffness = 0.6
-- How fast the smear's tail moves towards the target.
-- 0: no movement, 1: instantaneous
M.trailing_stiffness = 0.45
-- Initial velocity factor in the direction opposite to the target
M.anticipation = 0.2
-- Velocity reduction over time. O: no reduction, 1: full reduction
M.damping = 0.85
-- Controls if middle points are closer to the head or the tail.
-- < 1: closer to the tail, > 1: closer to the head
M.trailing_exponent = 3
-- Stop animating when the smear's tail is within this distance (in characters) from the target.
M.distance_stop_animating = 0.1
-- Set of parameters for insert mode
M.stiffness_insert_mode = 0.5
M.trailing_stiffness_insert_mode = 0.5
M.damping_insert_mode = 0.9
M.trailing_exponent_insert_mode = 1
M.distance_stop_animating_vertical_bar = 0.875 -- Can be decreased (e.g. to 0.1) if using legacy computing symbols
-- When to switch between rasterization methods
M.max_slope_horizontal = (1 / 3) / 1.5
M.min_slope_vertical = 2 * 1.5
M.max_angle_difference_diagonal = math.pi / 16 -- radians
M.max_offset_diagonal = 0.2 -- cell widths
M.min_shade_no_diagonal = 0.2 -- 0: less diagonal blocks, 1: more diagonal blocks
M.min_shade_no_diagonal_vertical_bar = 0.5
M.color_levels = 16 -- Minimum 1, don't set manually if using cterm_cursor_colors
M.gamma = 2.2 -- For color blending
M.gradient_exponent = 1.0 -- For longitudinal gradient. 0: no gradient, 1: linear, ...
M.max_shade_no_matrix = 0.75 -- 0: more overhangs, 1: more matrices
M.matrix_pixel_threshold = 0.7 -- 0: all pixels, 1: no pixel
M.matrix_pixel_threshold_vertical_bar = 0.25 -- 0: all pixels, 1: no pixel
M.matrix_pixel_min_factor = 0.5 -- 0: all pixels, 1: no pixel
M.volume_reduction_exponent = 0.3 -- 0: no reduction, 1: full reduction
M.minimum_volume_factor = 0.7 -- 0: no limit, 1: no reduction
M.max_length = 25 -- Maximum smear length
M.max_length_insert_mode = 1
-- Particles configuration -----------------------------------------------------
M.particles_enabled = false -- When true, better to also set `never_draw_over_target` to true
M.particle_max_num = 100
M.particle_spread = 0.5 -- 0: no spread, 1: spread over entire cursor
M.particles_per_second = 200
M.particles_per_length = 1.0 -- per character width
M.particle_max_lifetime = 300 -- milliseconds
M.particle_lifetime_distribution_exponent = 5
M.particle_max_initial_velocity = 10 -- characters width per second
M.particle_velocity_from_cursor = 0.2 -- 0: none, 1: full
M.particle_random_velocity = 100 -- characters width per second
M.particle_damping = 0.2
M.particle_gravity = 20 -- characters width per second squared
M.min_distance_emit_particles = 1.5 -- character widths
M.particle_switch_octant_braille = 0.3 -- fraction of lifetime, used if `legacy_computing_symbols_support` is true
M.particles_over_text = false
-- For debugging ---------------------------------------------------------------
M.logging_level = vim.log.levels.INFO
-- Set trailing_stiffness to 0 for debugging
return M