Neovim Twitch Chat

This plugin let's you send text to twitch chat from inside neovim!

Prerequesites

Setup twitch authentication

You will need to set the following environment variables - NVIMTWITCHTOKEN can be generated at twitchapps.com/tmi. - NVIMTWITCHNAME is your twitch name - NVIMTWITCHCHANNEL the twitch channel to join

Install the binary

bash cargo install --force neovim-twitch-chat

Install the plugin with plug

vim Plug 'hardliner66/neovim-twitch-chat'

Default Bindings

vim vnoremap <silent> <C-s>v :<C-U>TwitchChatSendSelected<CR> nnoremap <silent> <C-s>n :TwitchChatSendLine<CR> nnoremap <silent> <C-s>k :TwitchChatScratch<CR>

Settings

```vim " scratch window height in percent let g:twitchscratchheight = 0.2

" if the scratch window shows on top or at the bottom let g:twitchscratchtop = 1

" if set to 1, automatically closes the scratch window on ESC " and sends the whole buffer to twitch " " you can use to enter normal mode even if twitchscratchautosend is set to 1 let g:twitchscratchautosend = 0

" list of usernames which get excluded for autocomplete let g:twitchchatname_filter = ["username"] ```

Development Setup

  1. Install Rustup: https://www.rustup.rs/

  2. Use the stable rust compiler.

```sh rustup install stable rustup default stable

```

  1. Fetch the plugin.

sh $ git clone https://github.com/hardliner66/neovim-twitch-chat

  1. Build the binary portion of the plugin.

sh $ cd neovim-twitch-chat $ cargo build --release

  1. Test it out in a fresh instance of Neovim.

sh nvim -u ./init.vim --noplugin -c ":TwitchChatConnect"

The TwitchChatConnect command spawns the Rust plugin in a separate process and establishes a channel.