aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: d1cca775e03d57996e38d54e3ce4af26e64cda7b (plain) (blame)
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
# weechat-edit

This simple [weechat](https://weechat.org/) plugin allows you to
compose messages in your `$EDITOR`, optionally with a file type.

# Usage

- Markdown message (it's the default, same as `/edit md`)
  ```sh
  /edit
  # Type some stuff
  # Save and quit
  ```
- Plain text message
  ```sh
  /edit txt
  # Type some stuff
  # Save and quit
  ```
- Code message with fences added automatically
  ```sh
  /fenced cpp
  # Type some code
  # Save and quit
  ```

# Configuration

If you'd like to customize the editor you use outside of the `$EDITOR`
environment variable, you can set it in weechat.

```sh
/set plugins.var.python.edit.editor "vim -f"
```

# Installation

Copy the script to `$XDG_DATA_HOME/weechat/python/autoload`,
`~/.local/share/weechat/python/autoload`, or `~/.weechat/python/autoload`

```sh
mkdir -p "$XDG_DATA_HOME/weechat/python/autoload"
wget https://gitlab.farzat.xyz/plugins/weechat/weechat-edit/-/raw/master/edit.py "$XDG_DATA_HOME/weechat/python/autoload"
```