Skip to content

Latest commit

 

History

History
66 lines (44 loc) · 1.61 KB

README.md

File metadata and controls

66 lines (44 loc) · 1.61 KB

flashy.vim

A vim plugin that parses a VimL file into flashcards and displays them.

Installing

This plugin requires the use of Junegunn's Goyo. I personally use his plugin manager, vim-plug, as well. Here is the subsequent code for installing this using vim-plug.

Plug 'junegunn/goyo.vim'
Plug 'parmort/vim-flashy'

What is it?!?!

Okay, okay, calm down. Here we go.

The commands

:Flash Opens the viewer. Once you're there, hitting j or k will flip the card over, h goes to the previous card, and l goes to the next one. q quits the viewer

:Exit Quits the viewer.

:FlashList Gets the list of cards and puts them into the quickfix.

The file

Your flashcards will live in a VimL file (*.vim). Here is the format:

let g:flashy = [
  [ 'Side 1', 'Side 2' ],
  [ 'Side 1', 'Side 2' ],
]

The flashcards are stored in a list called g:flashy. Each sublist is an individual card. This list is unlet and let (see :h let and :h unlet) each time :Flash or :FlashList is run.

Some more notes...

If you hook into Goyo's autocommands, the changes you make in there will be set in Flashy. If you want to gate some of the settings, use the following if statement:

if !exists('g:loaded_flashy') || !g:inFlashy
  " Flashy isn't loaded
endif

if exists('g:loaded_flashy') && g:inFlashy
  " Flashy is loaded
endif

Legal Stuff

This piece of software is licensed under the MIT license (see LICENSE).

This plugin copyright (c) 2018–2020 N. Prochnau. Some rights reserved.