-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathteamtype.txt
More file actions
99 lines (79 loc) · 4.3 KB
/
teamtype.txt
File metadata and controls
99 lines (79 loc) · 4.3 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
*teamtype.txt* Editor-agnostic collaborative editing *teamtype*
This plugin adds real-time collaborative editing functionality to Neovim.
You can use it for pair programming or note-taking, for example. It is mainly
meant to be used with Teamtype, but can also be configured to work with other
collaborative software speaking the same protocol.
==============================================================================
INSTALLATION *teamtype-installation*
See main README at |https://github.com/teamtype/teamtype-nvim|.
==============================================================================
CONFIGURATION *teamtype-configuration*
This plugin allows you to configure multiple collaboration servers.
A configuration for connecting to Teamtype daemons is provided and enabled by
default.
config({name}, {cfg}) *teamtype.config()*
Set or update the configuration for a client.
Examples:
• Attempt to connect Teamtype in directories that have a `.teamtype`
directory (this is configured by default): >lua
teamtype.config("teamtype", {
cmd = { "teamtype", "client" },
root_markers = ".teamtype",
})
<
• Use the `teamtype-http` command to sync buffers that are https URLs. The
directory name might not be important: >lua
teamtype.config("http", {
cmd = { "teamtype-http" },
root_dir = function(bufnr, on_dir)
local name = vim.api.nvim_buf_get_name(bufnr)
if string.find(name, "https://") == 1 then
on_dir("/tmp")
end
end,
})
<
Parameters: ~
• {name} (`string`)
• {cfg} A configuration (see |teamtype.Config|)
enable({name}, {enable}) *teamtype.enable()*
Connects to the collaboration server when a buffer is opened, based on the
`root_markers` and `root_dir` fields of the configuration.
The `"teamtype"` configuration is enabled by default.
Examples: >lua
teamtype.enable('teamtype-http')
teamtype.disable('teamtype')
<
Parameters: ~
• {name} (`string`) Name of the client to enable.
• {enable} (`boolean`) `true|nil` to enable, `false` to disable.
*teamtype.Config*
Inspired by |vim.lsp.Config|, but with fewer options.
Fields: ~
• {cmd} (`string[]`) Command to start the collaboration server.
• {root_markers}? (`string`) Filename used to find the root of the
collaborative project. The plugin will search upwards
(from the buffer file), and stop in the first
directory with that marker. Typical values might be
`'.git'` or `'.teamtype'`. Unused if `root_dir` is
defined.
• {root_dir}? (`fun(bufnr: integer, on_dir:fun(root_dir?:string))`)
Called to decide the root of the collaborative
project. The provided function must call `on_dir`
with the root directory if the configuration should
be activated. You can use this function to
conditionally activate (or skip) collaboration. See
example at `teamtype.config` for an example.
==============================================================================
USAGE *teamtype-usage*
:TeamtypeInfo *:TeamtypeInfo*
Shows the active collaboration clients and cursor positions.
:TeamtypeJumpToCursor *:TeamtypeJumpToCursor*
Jumps to the cursor of another peer. If multiple cursors are present,
gives you a selection menu.
Tip: Create an easily accessible mapping for this command!
:TeamtypeFollow *:TeamtypeFollow*
Follows another peer, keeping their cursor in view. If multiple cursors
are present, gives you a selection menu.
It will automatically unfollow as soon as a key is pressed.
vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl: