A Neovim plugin for controlling MPV media player directly from your editor. Perfect for developers who enjoy background music while coding, especially designed for macOS users.
A personal project to explore Neovim plugin development, inspired by tools like lazygit.
- Control MPV player directly from Neovim
- Manage and play YouTube playlists
- Persistent playlist storage
- Simple and intuitive keybindings
- Seamless integration with your coding workflow
- macOS (plugin is currently tested only on macOS)
- mpv player (
brew install mpv
) - socat (
brew install socat
) - Neovim
Using lazy.nvim:
{
"plsdev89/lazympv.nvim",
lazy = false,
config = function()
require("lazympv").setup()
end,
}
Using packer.nvim:
use {
'plsdev89/lazympv.nvim',
config = function()
require('lazympv').setup()
end
}
<leader>pp
- Toggle MPV player UI<leader>pq
- Quit MPV player<leader>pn
- Play next track<leader>pN
- Play previous track
The plugin stores its configuration in ~/.config/lazympv/
directory, including:
playlists.txt
- Stores your playlist informationlast_played_index.txt
- Remembers your last played track
Default playlist includes:
- "3 AM Coding Session - Lofi Hip Hop Mix [Study & Coding Beats]"
You can modify the playlists by editing the configuration file or through the plugin's interface.
lua/lazympv/ ├── init.lua # Plugin initialization and setup ├── config.lua # Configuration management ├── mpv.lua # MPV player control ├── ui.lua # User interface components └── util.lua # Utility functions
- Install the plugin using your preferred package manager
- Use the keybindings to control MPV player:
- Toggle the player with
<leader>pp
- Navigate through tracks with
<leader>pn
and<leader>pN
- Quit the player with
<leader>pq
- Toggle the player with
- Add new playlist entries by editing
~/.config/lazympv/playlists.txt
and adding lines in the format "title"="url".
- This plugin is currently tested only on macOS
- Requires both
mpv
andsocat
to be installed - Playlist state is persisted between sessions
Contributions are welcome! Please feel free to submit a Pull Request.