/vim-pets

Put small animals in your text editor.

Primary LanguageVim ScriptMIT LicenseMIT

vim-pets

Put small animals in your text editor.
(As you know, this plugin is strongly inspired by vscode-pets)

Pets

PetsWithYou

extension pack sample -> vim-pets-ocean

Usage

Put pets in the Vim window

Create garden with pets.

Pets [animal_name [nickname]]

After you create a garden of pets, you can add and remove pet as following.

PetsJoin animal_name [nickname]
PetsLeave [animal_name(nickname)]

You also can throw a ball

PetsThrowBall

To Close the garden, please do

PetsClose

Put pets around the cursor

PetsWithYou animal_name

You can call this command repeatedly. e.g.)

PetsWithYou dog
PetsWithYou dog
PetsWithYou cat
PetsWithYou rabbit

To clear pets,

PetsWithYouClear

Requirements

  • rand()
echo exists('*rand') "=1
  • popupwin or nvim
echo has('popupwin') "=1
" or
echo has('nvim') "=1

Installation

For vim-plug plugin manager:

Plug 'MeF0504/vim-pets'

Options

  • g:pets_default_pet (string): The pet name joinning when :Pets command called without specify the pet name. default: 'dog'
  • g:pets_lifetime_enable (number): Enable the 'lifetime' system. If set 1, pets will go about 10 minutes after join the garden. default: 1
  • g:pets_birth_enable (number): Enable the 'birth' system. If set 1, new pet will born. default: 1
  • g:pets_garden_width (number): Width of the garden. default: &columns/2
  • g:pets_garden_height (number): Height of the garden. default: &lines/3
  • g:pets_garden_pos (list): Setting of the position of the garden. This list contains three parameters, [line(number), collum(number), position(string)].
    • The Available argument of position is 'topleft', 'topright', 'botleft' and 'botright'.
    • In Vim, these values are assigned to the line, col, and pos parameters of popup_create-arguments.
    • In Neovim, these values are assigned to the row, col, and anchor parameters of nvim_open_win-config. The position argument is converted to fit the nvim_open_win function.
    • default: [&lines-&cmdheight-1, &columns-1, 'botright']

Future Contents

  • Plan to support showing image files
  • sample

NOTE: This is a very challenging function. This is still limited and not stable.

Requirements

  • libsixel supported terminal emulator.
  • img2sixel command

License

MIT

Author

MeF0504