mpv.nvim
December 29, 2022 · View on GitHub
A music player inside neovim that uses mpv.
Extracted from stuff.nvim.
Note This is an experimental plugin without any proper testing.
Showcase
Requirements:
- neovim (0.7+)
- mpv
- youtube-dl
Installation and default setup
-- Using lazy.nvim:
{ "tamton-aquib/mpv.nvim", config=true }
Usage/Configuration
- The command:
:MpvToggle - The actual api:
require("mpv").toggle_player()
Click to view default config
require("mpv").setup { width = 50, height = 5, -- Changing these two might break the UI 😬 border = 'single', setup_widgets = false, -- to activate the widget components timer = { after = 1000, throttle = 250, -- Update time for the widgets. (lesser the faster) } }
- Keymaps:
| key | action |
|---|---|
<CR> | Input song/link |
p / <space\> | pause/play |
q | quit |
> / < | next/prev in playlist |
m | mute/unmute |
Statusline/Tabline components
make sure you set
setup_widgetstotrueinsidesetup()-- Components are: g:mpv_title, g:mpv_visualizer, g:mpv_percent require("lualine").setup { sections = { lualine_c = { { function() return ' ' end, color='green', on_click=require("mpv").toggle_player }, 'g:mpv_title' }, } }
Features
- search by keyword.
- paste links from youtube (playlists too).
- mouse support (quite buggy)
- statusline/tabline components.
Todo's
moved to todo.norg
Inspiration/Credits
- music.nvim
- vhyrro and vsedov