|
13 | 13 | - [When are messages marked as having been read?](#when-are-messages-marked-as-having-been-read)
|
14 | 14 | - [How do I access multiple servers?](#how-do-i-access-multiple-servers)
|
15 | 15 | - [What is autocomplete? Why is it useful?](#what-is-autocomplete-why-is-it-useful)
|
| 16 | + - [Can I compose messages in another editor?](#can-i-compose-messages-in-another-editor) |
16 | 17 | - Something is not working!
|
17 | 18 | - [Colors appear mismatched, don't change with theme, or look strange](#colors-appear-mismatched-dont-change-with-theme-or-look-strange)
|
18 | 19 | - [Symbols look different to in the provided screenshots, or just look incorrect](#symbols-look-different-to-in-the-provided-screenshots-or-just-look-incorrect)
|
@@ -373,6 +374,55 @@ through autocomplete depend upon the context automatically.
|
373 | 374 | **NOTE:** If a direct message recipient's name contains comma(s) (`,`), they
|
374 | 375 | are currently treated as comma-separated recipients.
|
375 | 376 |
|
| 377 | +## Can I compose messages in another editor? |
| 378 | + |
| 379 | +In the `main` branch of zulip-terminal, you can now use an external editor of |
| 380 | +your choice to compose your messages using the `Ctrl o` hotkey. |
| 381 | + |
| 382 | +The editor command is looked for in the `ZULIP_EDITOR_COMMAND` and `EDITOR` |
| 383 | +environment variables (in that order), or the `editor` entry of the zuliprc |
| 384 | +file (which overrides both of those). |
| 385 | + |
| 386 | +It should work directly for most terminal editors with only the program name, |
| 387 | +eg. `vim`, `nano`, `helix`, `kakoune`, `nvim`, etc. |
| 388 | + |
| 389 | +It can also be used with a desktop editor with some constraints: the program |
| 390 | +must not fork or detach from the running terminal and should open in a new |
| 391 | +window. For this reason it may be useful to use `ZULIP_EDITOR_COMMAND` (or the |
| 392 | +zuliprc setting) to avoid conflict with the more widely used `EDITOR` |
| 393 | +environment variable. Some examples include: |
| 394 | + |
| 395 | +- [lapce](https://github.com/lapce/lapce) with `lapce -n -w` |
| 396 | +- [sublime-text](https://www.sublimetext.com/) with `subl -n -w` |
| 397 | +- [marker](https://github.com/fabiocolacio/Marker) with `marker` |
| 398 | +- [vim](https://github.com/vim/vim) with `vim -g -f` or `gvim -f` |
| 399 | +- [vscode](https://github.com/microsoft/vscode) with `code -n -w` |
| 400 | + |
| 401 | +**NOTE:** Backslashing white space (`\ `) is needed when using an executable |
| 402 | +containing them, for example Sublime Text on macOS can be configured with |
| 403 | +`/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl`. |
| 404 | + |
| 405 | +This feature works by sending the message content back and forth using |
| 406 | +temporary files: |
| 407 | +- A temporary file is created, filled with any existing message content; |
| 408 | +- The editor command is run, with the filename appended (standard practice for editors); |
| 409 | +- You edit your text in the editor of your choice; |
| 410 | +- When the external editor process ends (closing the window, or quitting the terminal |
| 411 | +editor), the compose box will be updated with the new message content from |
| 412 | +the temporary file. |
| 413 | + |
| 414 | +> NOTE 1: If using a terminal-based editor, it will temporarily take over the |
| 415 | +> entire terminal and replace the application. However, upon exiting that |
| 416 | +> editor, the application should return to the terminal. |
| 417 | +
|
| 418 | +> NOTE 2: Whichever type of editor you use (terminal or desktop/graphical), the |
| 419 | +> application will temporarily pause while you are editing. The application |
| 420 | +> should resume as normal once you exit the external editor and the text you |
| 421 | +> entered appears in the compose area. |
| 422 | +
|
| 423 | +**If you have success with other editors, these examples do not work, or have |
| 424 | +other problems, please let us know!** |
| 425 | + |
376 | 426 | ## Colors appear mismatched, don't change with theme, or look strange
|
377 | 427 |
|
378 | 428 | Some terminal emulators support specifying custom colors, or custom color
|
|
0 commit comments