A Neovim plugin that provides a whiteboard functionality for drawing with your mouse and saving/loading drawings.
- 🎨 Draw on a floating whiteboard canvas
- 🖱️ Multiple drawing methods:
- Click and drag with mouse (when supported)
- Visual mode selection drawing
- Continuous drawing mode with Space toggle
- 💾 Save drawings to JSON files
- 📂 Load previously saved drawings
- 🗑️ Clear canvas
- 🎯 Easy-to-use commands and keybindings
use {
'your-username/nvim-whiteboard',
config = function()
require('whiteboard').setup()
end
}{
'your-username/nvim-whiteboard',
config = function()
require('whiteboard').setup()
end
}Clone this repository into your Neovim config:
git clone https://github.com/your-username/nvim-whiteboard ~/.config/nvim/pack/plugins/start/nvim-whiteboard:Whiteboardor:WhiteboardNew- Open a new whiteboard:WhiteboardSave- Save the current whiteboard:WhiteboardLoad- Load a saved whiteboard:WhiteboardList- List all saved whiteboards
- Open whiteboard with
:Whiteboard - Press
vto enter visual mode - Move your cursor to draw
- Press
Escto stop drawing
- Open whiteboard with
:Whiteboard - Press
Spaceto start continuous drawing - Move your cursor to draw
- Press
Spaceagain to stop
- Open whiteboard with
:Whiteboard - Click and drag with your mouse (when supported by your terminal)
qorEsc- Close whiteboards- Save whiteboardl- Load whiteboardc- Clear canvasv- Enter visual mode for drawingSpace- Toggle continuous drawing mode
Drawings are saved as JSON files in ~/.local/share/nvim/whiteboard/ with the following structure:
{
"version": "1.0",
"strokes": [
[
{"row": 5, "col": 10},
{"row": 5, "col": 11},
{"row": 6, "col": 12}
]
],
"buffer_lines": ["..."],
"created": "2024-01-01 12:00:00"
}Currently, the plugin uses default settings. Future versions may support:
- Custom canvas size
- Drawing color/character
- Save directory location
- Keybinding customization
- Neovim 0.7.0 or higher
- Terminal with mouse support (for mouse drawing)
- Mouse drawing support depends on your terminal's mouse event handling
- Drawing is done using text characters (█) overlaid on the buffer
- Large drawings may impact performance
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License