forked from chomosuke/typst-preview.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypst-preview.nvim.txt
144 lines (91 loc) · 4.32 KB
/
typst-preview.nvim.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
*typst-preview.nvim.txt* Preview your typst documents.
Author: Richard Li <a13323600@gmail.com>
==============================================================================
CONTENTS *typst-preview*
1. Usage
2. Configuration
==============================================================================
1. Usage
==============================================================================
1.1 Commands *typst-preview-commands*
*:TypstPreviewUpdate*
Download the necessary binaries to
`vim.fn.fnamemodify(vim.fn.stdpath 'data' .. '/typst-preview/', ':p')`.
This must be run before any other commands can be run.
If you followed the installation instructions, your package manager should
automatically run this for you.
Calls: `require 'typst-preview'.update()`
*:TypstPreview*
Start the preview.
*:TypstPreviewStop*
Stop the preview.
*:TypstPreviewToggle*
Toggle the preview.
*:TypstPreviewFollowCursor*
Scroll preview as cursor moves. This is the default.
Calls: `require 'typst-preview'.set_follow_cursor(true)`
*:TypstPreviewNoFollowCursor*
Don't scroll preview as cursor moves.
Calls: `require 'typst-preview'.set_follow_cursor(false)`:
*:TypstPreviewFollowCursorToggle*
Start or stop scrolling preview as cursor moves.
Calls: `require 'typst-preview'.set_follow_cursor(not init.get_follow_cursor())`.
*:TypstPreviewSyncCursor*
Scroll preview to the current cursor position. This can be used in
combination with |:TypstPreviewNoFollowCursor| so that the preview only
scroll to the current cursor position when you want it to.
Calls: `require 'typst-preview.sync_with_cursor()`
==============================================================================
1.2 Lua Functions *typst-preview-lua*
*typst-preview.update()*
Download the necessary binaries to
`vim.fn.fnamemodify(vim.fn.stdpath 'data' .. '/typst-preview/', ':p')`.
This must be run before any other commands can be run.
If you followed the installation instructions, your package manager should
automatically run this for you.
*typst-preview.set_follow_cursor({bool})*
Calling `require 'typst-preview'.set_follow_cursor(true)` will make preview
scroll when cursor moves.
Calling `require 'typst-preview'.set_follow_cursor(false)` will stop preview
from scrolling when cursor moves
Default: `true`
Parameters: ~
- {follow_cursor} (boolean) whether to scroll preview when cursor moves.
*typst-preview.get_follow_cursor()*
Returns whether the preview is currently following cursor or not.
Return: ~
(boolean) whether preview is currently following cursor.
*typst-preview.sync_with_cursor()*
Scroll preview to the current cursor position. This can be used in
combination with |:TypstPreviewNoFollowCursor| so that the preview only
scroll to the current cursor position when you want it to.
==============================================================================
2. Configuration *typst-preview-configuration*
*typst-preview.debug*
Set this to true to enable debug print. Use `:mes` to view printed messages.
Type: `boolean`, Default: `false`
*typst-preview.open_cmd*
Provide a custom format string to open the output link in `%s`.
Example value for open_cmd: `'firefox %s -P typst-preview --class typst-preview'`.
Type: `string`, Default: `nil`
*typst-preview.dependencies_bin*
Provide the path to binaries for dependencies.
Setting this will skip the download of the binary by the plugin.
Warning: Be aware that your version might be older than the one
required.
Type: `table`, Default: `{['typst-preview'] = nil, ['websocat'] = nil}`
*typst-preview.invert_colors*
Can be used to invert colors in preview.
Set to `'never'` to disable.
Set to `'always'` to enable.
Set to `'auto'` to enable if environment (usually browser) has enabled darkmode.
Type: `string`, Default: `'never'`
*typst-preview.get_root*
This function will be called to determine the root of the typst project
Parameters: ~
- {bufnr} (integer) The bufnr of the typst file that being previewed.
Return: ~
(string) The path to the root of the typst project.
Type: `function`,
Default: `function(bufnr_of_typst_buffer) return vim.fn.getcwd() end`
vim:tw=78:ts=2:sw=2:et:ft=help:norl: