boysetsfrog / vimpc

Official repository for vimpc a vi/vim inspired client for the Music Player Daemon (mpd). Pull requests are welcome.
GNU General Public License v3.0
269 stars 34 forks source link

Add command to overwrite playlist. #51

Closed 0xtobit closed 9 years ago

0xtobit commented 9 years ago

MPD, tragically, does not have good functionality for updating/editing an existing saved playlist. To update a playlist, what is actually done is that the playlist is deleted and then recreated with the edits.

I originally tried to rework the :w and :write to allow for updating an existing playlist. First I tried to always delete the playlist before creating it (see #40). However, if you wanted to make a new playlist, this removal would error, confusing the user. I wanted to only remove an existing playlist if it existed but could not, for the life of me could not figure out a way to do that.

Hopefully this works for now.

connermcd commented 9 years ago

Hi @0xtobit and thanks for your efforts. I will look into this more closely.

connermcd commented 9 years ago

I've incorporated your basic idea with a few modifications in f0b6a0bd9c52cb0350a76b49461de72d700b67f6 which will allow to us to tackle the other issue of a default parameter.

connermcd commented 9 years ago

Maybe the second part of that sentence was a little premature, but I'll take a look into that too.

0xtobit commented 9 years ago

Thanks so much, this is awesome.