Based on Ben Klein's book The VimL Primer: Edit Like a Pro with Vim Plugins and Scripts I started to write this plugin and I want to go through it, explain it, what future plans he has and how it was tested.
Vimscript is called nowadays VimL is a dynamic imperative language: variables, expressions, control structures, built-in functions, user-defined functions, data structures, File I/O, regex pattern matching
append, line append(line, text) … appends the text to a buffer after a certain line in the file line(number) … takes the file position and returns the line number of that position in the current file
bufexists, bufnr bufexists({expr}) … result is a number, which is non-zero if the buffer exists bufnr({expr}) … result is the number of a buffer (displayed by the :ls command
command command[!] [{attr}…] {cmd} {rep} … define a user command. The name of the command is {cmd} and its replacement text is {rep}. The ! can be used to overwrite any preexisting commands.
Isolated test environment #!/bin/bash banshee --play-enqued fixtures/crystals.mp3 fixtures/focus.mp3 & vim -Nu filetype off set rtp+=~/.vim/plugged/vader.vim set rtp+=~/.vim/plugged/vim-banshee filetype plugin indent on syntax enable EOF) +Vader*
Test results Starting Vader: 1 suite(s), 10 case(s) Starting Vader: /home/wm/.vim/plugged/vim-banshee/test/banshee.vader ( 1/10) [EXECUTE] BansheeInfo display title, artist and album ( 2/10) [EXECUTE] :BansheeNext play the next song ( 3/10) [EXECUTE] :BansheePrevious play the previous song ( 4/10) [EXECUTE] :BansheeRestart, :BansheePlay, :BansheeStop, :BansheeSetPosition, :BansheeDuration ( 5/10) [EXECUTE] :BansheePause stop playing the current song ( 6/10) [EXECUTE] :BansheeToggle pauses and plays a song ( 7/10) [EXECUTE] :BansheeStop stop playing a song and when it's played again, it will start from the beginning ( 8/10) [EXECUTE] :BansheeSetRating and :BansheeSetVolume ( 9/10) [EXECUTE] Existance of commands :BansheeShow, :BansheeFullscreen, :BansheeHide, :BansheeStopWhenFinished (10/10) [EXECUTE] Existance of dialog commands: :BansheeImportMedia, :BansheeOpenLocation, :BansheePreferences Success/Total: 10/10 Success/Total: 10/10 (assertions: 26/26) Elapsed time: 17.128639 sec.