Git Product home page Git Product logo

music-controls.nvim's Introduction

Music Controls

Control you favorite music players with ease from within Neovim.

preview

Description

Music Controls is a Neovim plugin that allows you to easily control your favorite music players from within Neovim. The plugin uses playerctl to control the music players, so it is required that playerctl is installed on your system in order to use the plugin. Additionally, the music players you want to control (such as Spotify, VLC, etc.) must also be installed on your system.

I created Music Controls to make it more convenient and efficient to control my music player while working within Neovim. Instead of constantly switching workspaces or opening a terminal to control my music player, I can use this plugin to do it all within Neovim. You might say that I'm lazy, some say I'm not ๐Ÿ˜‰! I hope that others who have similar needs will find Music Controls useful as well.

Installation

Dependencies

Music Controls requires playerctl and of corse Spotify to be installed in order to work properly.

Using Packer

  1. Add this to your Neovim config:
use {
    'AntonVanAssche/music-controls.nvim',
    requires = {
        'rcarriga/nvim-notify'
    }
}
  1. Run :PackerSync to install the plugin on your machine.

Using Vim-Plug

  1. Add the following to your Neovim config:
Plug 'rcarriga/nvim-notify'
Plug 'AntonVanAssche/music-controls.nvim'
  1. Run :PlugInstall to install the plugin on your machine.

Manually

  1. Clone this repository into your Neovim ~/.config/nvim/pack/plugins/start/directory.
  2. Clone the nvim-notify repository into you Neovim ~/.config/nvim/pack/plugins/start/directory.

Usage

Once the plugin is installed, you can use the following commands followed by the player of your choice from within Neovim.

  • :MusicPlay - Play the current track.
  • :MusicPause - Pause the current track.
  • :MusicNext - Skip to the next track.
  • :MusicPrev - Go back to the previous track.
  • :MusicCurrent - Display the current track.
  • :MusicShuffle - Toggle shuffle mode.
  • :MusicLoop - Toggle repeat mode, or set a specify mode.
  • :MusicListPlayers - List all players available to control.

Examples

Here are some examples of how you can use the commands mentioned above:

:MusicPlay spotify          # Toggle play.
:MusicNext spotify          # Skip to the next track.
:MusicPrev spotify 4        # Skip the 4 next tracks.
:MusicPause spotfy          # Pause the current track.
:MusicListPlayers           # List out all players available.
:MusicLoop Track            # Keep repeating the current track.
:MusicLoop                  # Set the repeate mode to None or Track, depending on the current mode.
:MusicShuffle spotify       # Toggle shuffle mode.

Specifying a Default Player

You can specify a default music player by adding the following code to your init.lua file:

_G.music_controls_default_player = 'spotify'

This will set Spotify as the default music player for Music Controls. You can substitute spotify with the name of any other music player you want to set as the default.

With a default player set, you can use Music Controls commands without specifying a player each time. For example, :MusicPlay will automatically use the default player instead of requiring you to enter :MusicPlay spotify. After setting a default player, you can still control all other players by specifying it as the argument.

For more information, refer to the documentation by typing :h MusicControls.

License

Music Controls is licensed under the MIT License. See the LICENSE.md file for more information.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests.

TODO

Features I plan on adding in the foreseeable future:

  • Add loop functionality.
    • 'None', 'Track' and 'Playlist'
  • Add shuffle functionality.
    • 'toggle'
  • To be continued...

music-controls.nvim's People

Contributors

antonvanassche avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.