http://qs1969.pair.com?node_id=1160757

Sorry for slightly misusing this section as this is not something deep - just a little productivity hack...

As a vim-user for many years I would edit my script in the one true editor and then run it (again and again for development) either in another terminal altogether or would background vim via Ctrl-Z.

But now I have found something more convenient.

If you run vim inside tmux and install the vimux-plugin you can send tmux-commands from within vim.

Now add this to your .vimrc:

let mapleader=" " map <Leader><space> :VimuxRunCommand("perl " . bufname('%'))
If you now open your perl-script in vim within a tmux-session and hit <space> twice (tweak the key-binding to your liking), a new tmux-pane opens and runs your script - without loosing focus in vim - so much nicer...