codemp-nvim/README.md

83 lines
3.4 KiB
Markdown
Raw Normal View History

2024-09-05 04:37:36 +02:00
[![codemp](https://codemp.dev/static/banner.png)](https://codemp.dev)
2024-08-17 17:04:00 +02:00
2024-09-05 04:37:36 +02:00
> `codemp` is a **collaborative** text editing solution to work remotely.
2022-09-14 12:13:48 +02:00
2024-08-17 16:57:38 +02:00
It seamlessly integrates in your editor providing remote cursors and instant text synchronization,
as well as a remote virtual workspace for you and your team.
2024-09-05 04:37:36 +02:00
# codemp-nvim
2024-08-17 16:57:38 +02:00
2024-09-05 04:37:36 +02:00
This is the reference codemp [neovim](https://neovim.io) plugin maintained by [hexedtech](https://hexed.technology)
2024-08-17 16:57:38 +02:00
# usage
2024-08-17 17:11:20 +02:00
> [!CAUTION]
> codemp-nvim is not finished nor ready for early adopters, this is a demo
2024-09-05 05:09:21 +02:00
Interact with this plugin using the `:MP` command.
2024-08-17 17:11:20 +02:00
2024-09-05 05:09:21 +02:00
Most actions can be performed from the side tree: toggle it with `:MP toggle`.
2024-08-17 16:57:38 +02:00
2024-08-17 17:04:00 +02:00
| command | description |
| --- | --- |
| `:MP toggle` | toggles the codemp sidebar |
| `:MP connect [host] [username] [password]` | to connect to server, user and pwd will be prompted if not given |
once connected, more commands become available:
| command | description |
| --- | --- |
2024-08-17 17:04:00 +02:00
| `:MP disconnect` | disconnects from server |
| `:MP id` | shows current client id |
| `:MP start <workspace>` | will create a new workspace with given name |
| `:MP invite <user> [workspace]` | invite given user to workspace |
| `:MP available` | list all workspaces available to join |
2024-08-17 17:04:00 +02:00
| `:MP join <workspace>` | will join requested workspace; starts processing cursors, users and filetree |
after a workspace is joined, more commands become available:
| command | description |
| --- | --- |
2024-08-17 17:04:00 +02:00
| `:MP leave <workspace>` | disconnect from a joined workspace |
| `:MP attach <buffer>` | will attach to requested buffer if it exists (opens a new local buffer and uses current window) |
| `:MP detach <buffer>` | detach from a buffer and stop receiving changes |
| `:MP share` | shares current file: creates a new buffer with local file's content, and attach to it |
| `:MP sync` | forces resynchronization of current buffer |
| `:MP create <bufname>` | will create a new empty buffer in workspace |
| `:MP delete <bufname>` | will delete a buffer from workspace |
2024-08-17 16:57:38 +02:00
### quick start
* first connect to server with `:MP connect`
* then join a workspace with `:MP join <workspace>`
* either attach directly to a buffer with `:MP attach <buffer>` or browse available buffers with `:MP toggle`
MP command autocompletes available options for current state, so cycle <Tab> if you forget any name
## configuration
2022-09-14 12:13:48 +02:00
# installation
2024-08-17 16:57:38 +02:00
2024-08-17 17:11:20 +02:00
> [!IMPORTANT]
> the release zip provided is a tech demo for linux, there are no official releases yet
* download the internal demo bundle from [here](https://github.com/hexedtech/codemp-nvim/releases/tag/v0.1)
* place the whole `codemp` folder under your `.config/nvim/lua` directory
* add `CODEMP = require('codemp')` at the end of your `init.lua`
`codemp-nvim` reads some global vim variables for configuration:
* `vim.g.codemp_username` will be used when connecting instead of prompting for username
* `vim.g.codemp_password` will be used when connecting instead of prompting for password
* `vim.g.codemp_neo_tree` will enable the neo-tree window, instead of the crude integrated one
2024-08-17 16:57:38 +02:00
## building
2024-08-17 16:57:38 +02:00
this plugin relies on the native codemp lua bindings: just compile the main `codemp` project with `lua` feature enabled
and place a `lua.so` or `lua.dll` together with the plugin lua files while bundling
2022-09-14 12:13:48 +02:00
```
.config/
|-nvim/
: |-lua/
: : |-codemp/
: : : |- lua.(so|dll)
: : : |- init.lua
: : : : ...
```