This repository has been archived by the owner on Jun 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimmpc.vim
59 lines (55 loc) · 1.82 KB
/
vimmpc.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
" File: vimmpc.vim
" About: Wrapper around basic MPD functionality
" Author: Gavin Gilmour (gavin (at) brokentrain dot net)
" Last Modified: April 10, 2007
" Prerequisites: mpdclient2
" Installation: Map :MPC to something
" Version: 20070410
"
" TODO:
" * Playlist editing
" * Other commands (update, random, seek, repeat, etc.)
" * Progressive statusbar?
" * Database view
" * Fancy playlist colour scheme
" * Alternative views for playlist, folding at albums etc.
" * Mini-queues and stuff?
" * History list?
" * Fancier search features
" * Song-info windows
" * Open the file like an archive with some tool?
" * Tag editing?
" * Make the visual selection = progress?
" * Oh, oh! Fancy database searching with :cnext & :cprev?
"
" ChangeLog:
" 10-04-07: Playlist auto-focus support.
" 27-02-07: Fixes lyrics issues, implemented remote functionality!
" 19-01-07: Lyrics window, experimental playlist folding.
" 21-12-06: Total rewrite using vim's python support.
" 05-11-06: Initial version.
if !has("python")
echomsg 'vimpc.vim: Error! Python support is not available, ' .
\ 'plugin not loaded.'
finish
endif
function TrackFoldText()
let line = getline(v:foldstart)
let tracks = v:foldend - v:foldstart - 1
let tracks = printf("%2d", tracks)
let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
return '+-' . v:folddashes . ' ' . tracks . ' tracks:' . sub
endfunction
function DatabaseFoldText()
let line = getline(v:foldstart)
let tracks = v:foldend - v:foldstart - 1
let tracks = printf("%2d", tracks)
let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
return sub
endfunction
if !exists('g:loaded_mpc')
pyfile <sfile>:p:h/vimmpc.py
command! -nargs=0 MPC python MPC_init("Playlist")
let g:loaded_mpc = 1
finish
endif