Saverio976/music.nvim

github github
mediautility
stars 6
issues 0
subscribers 1
forks 0
CREATED

2022-06-28

UPDATED

2 months ago


music.nvim

[!IMPORTANT]
I don't take time to update this, give a look at https://github.com/tamton-aquib/mpv.nvim

play music/video in neovim using mpv

Installation

  • require
  1. mpv

this plugin require mpv executable installed and discoverable in your PATH

  • pacman -S mpv
  • apt install mpv
  • ...
  1. socat (interraction with mpv while playing playlist/music)
  • pacman -S socat
  • apt install socat
  • ...
  1. voldikss/vim-floaterm (to run mpv)

see its github readme for how to install it on your neovim config (voldikss/vim-floaterm)

  1. bonus
  1. and, the plugin:
  • with packer
use {
    'Saverio976/music.nvim',
    run = ':MusicInstall',
    requires = { 'voldikss/vim-floaterm' }
}

Command

  • PlayMusic (path of file/folder)|(url link)|(keywords search)
command! -nargs=1 -complete=file PlayMusic lua require('music_nvim').PlayMusicUrl([[<args>]])

open a terminal and run mpv to play only the sound

  • MusicPlay (path of file/folder)|(url link)|(keywords search)
command! -nargs=1 -complete=file MusicPlay lua require('music_nvim').PlayMusicUrl([[<args>]])

open a terminal and run mpv to play only the sound

  • MusicPlayVideo (path of file/folder)|(url link)|(keywords search)
command! -nargs=1 -complete=file MusicPlayVideo lua require('music_nvim').PlayMusicVideoUrl([[<args>]])

open a terminal and run mpv to play the sound + video

  • MusicNext
command! MusicNext lua require('music_nvim').next_music()

pass to the next music (or stop it if not a playlist)

  • MusicPrev
command! MusicPrev lua require('music_nvim').next_music()

pass to the previous music (if playlist)

  • MusicShuffle
command! MusicUnShuffle lua require('music_nvim').unshuffle_music()

shuffle the playlist

  • MusicUnShuffle
command! MusicUnShuffle lua require('music_nvim').unshuffle_music()

unshuffle the playlist

  • MusicQueue
command! MusicQueue lua require('music_nvim').queue_music()

show queue

  • MusicAllPlaylist
command! MusicAllPlaylist lua require('music_nvim').allplaylist_music()

show all the play list

Mpv Interraction (in the splited terminal) (man mpv for better info)

  • p

pause music

(same as )

  • <Space>

pause music

(same as p)

  • Left and Right arrow

go backaward/forward a little

  • Down and Up arrow

go backaward/forward

  • <Enter>

pass to the next music (or stop music if not a playlist)

  • >

go to next music

  • <

go to last music

Thanks