Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/espacio-root/pyplotter
PyPlotter is a Neovim plugin designed to streamline Python plotting and code execution directly within the Neovim editor. It offers commands for creating temporary Python buffers, executing code, and saving output plots as PNG files.
https://github.com/espacio-root/pyplotter
graphing latex lua matplotlib-pyplot neovim neovim-plugin plotter python
Last synced: 14 days ago
JSON representation
PyPlotter is a Neovim plugin designed to streamline Python plotting and code execution directly within the Neovim editor. It offers commands for creating temporary Python buffers, executing code, and saving output plots as PNG files.
- Host: GitHub
- URL: https://github.com/espacio-root/pyplotter
- Owner: Espacio-root
- License: other
- Created: 2024-07-20T17:11:20.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-07-21T15:49:06.000Z (6 months ago)
- Last Synced: 2024-12-15T15:53:19.146Z (19 days ago)
- Topics: graphing, latex, lua, matplotlib-pyplot, neovim, neovim-plugin, plotter, python
- Language: Lua
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyPlotter
PyPlotter is a Neovim plugin designed to streamline Python plotting and code execution directly within the Neovim editor. It offers commands for creating temporary Python buffers, executing code, and saving output plots as PNG files.
## Features
- **Create Temporary Buffer**: Open a new temporary buffer with Python syntax highlighting.
- **Execute Python Code**: Run Python code from the current buffer and save the resulting plot as a PNG file.
- **Automatic Buffer Deletion**: Temporary buffers are automatically deleted when you leave them.
- **Customizable Output Filename**: Option to specify the output filename for generated plots.## Installation
To install PyPlotter, you can use a plugin manager like `packer.nvim` or install it manually.
### Using `packer.nvim`
Add the following to your `packer.nvim` configuration:
```lua
use {
'espacio-root/pyplotter',
config = function()
require('PyPlotter').setup({
run_code_on_buf_leave = true,
paste_on_buf_leave = true,
destroy_on_buf_leave = true,
})
end
}
```### Using `lazy`
Add the following to your `lazy` configuration:
```lua
{
'espacio-root/pyplotter',
config = function()
require('PyPlotter').setup({
run_code_on_buf_leave = true,
paste_on_buf_leave = true,
destroy_on_buf_leave = true,
})
end
}
```## Usage
### Open Temporary Buffer
Open a new temporary buffer with Python syntax highlighting:
```vim
:OpenTempBuffer
```This command will create a new buffer with Python syntax highlighting and pre-fill it with import matplotlib.pyplot as plt. The buffer will be automatically deleted when you leave it.
### Run Python Code
Run Python Code
Execute the Python code from the current buffer and save the output plot:```vim
:RunPythonCode
```