Have you ever wanted an easy shortcut for running your tests or launching a REPL for a specific language? When writing Clojure code, for instance, I often want to run 'lein midje'. When writing Ruby code, I want to run 'rake test'. In both cases, I want my normal mode keybinding to be:
One easy solution is to add a couple Vim filetype plugins:
mkdir -p ~/.vim/ftplugin/clojure ~/.vim/ftplugin/ruby cat <<EOF > ~/.vim/ftplugin/clojure/testbind.vim nmap <leader>;; :!lein midje<cr> EOF cat <<EOF > ~/.vim/ftplugin/ruby/testbind.vim nmap <leader>;; :!rake test<cr> EOF
Now my custom keybinding will run Rake when I edit Ruby files and Leiningen when I edit Clojure.