/mpv.nvim

Music player with mpv.

Primary LanguageLua

mpv.nvim

A music player inside neovim that uses mpv.

Extracted from stuff.nvim.

Note This is an experimental plugin without any proper testing.

Showcase

2022-12-27_19-00-31.mp4

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_widgets to true inside setup()

-- 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