Question: I've started using vim a couple of months ago and I'm loving it. I mostly code on a vim pane (using iTerm2 on OS X) and I keep an ipython console running inside a screen session on another pane. I've managed to find a way to send lines of code or even the whole script from vim to execute on the ipython console, but I don't know if this is possible with tmux. Everyone else is telling me to change from screen to tmux (which actually seems like good advice, in light of tmux's features) but before taking the leap I wanted to make sure this is possible.

Answer: 
Yes it is possible to send commands to an already open tmux session.
i recommend you use this plugin  [vim-tmux-runner](https://github.com/christoomey/vim-tmux-runner)  . you can see this  [Vim & Tmux](https://vimeo.com/126420226)  video for a demo of the plugin by Jack Franklin
Based on the answer/tip by byaruhaf, I've managed to send commands to an already open tmux session. I thought I'll add here a small how-to so that everyone else can take advantage of this. 

I installed [vim-tmux-runner](https://github.com/christoomey/vim-tmux-runner) and edited my .vimrc file in the following way:

```
let g:vtr_filteype_runner_overrides = {
    \ 'python': '%run {file}' }
augroup Pythonic
    autocmd!
    autocmd FileType python nmap <leader>l :VtrSendFile<CR>
    autocmd Filetype python xmap <leader>l :VtrSendLinesToRunner<CR>
augroup END

```

Let me explain this a bit. The first `autocmd` line allows one to hit `<leader>l` in NORMAL mode and have vim-tmux-runner send `'%run {filename}'` to a tmux session in which an ipython session is running (this is my workflow). Note that the `'let'` line on top is the one which sets the command to be run by `VtrSendFile` to be `'%run'`. (On that same line, please note that "filteype" is not a typo, it works like this and not with "filetype"). 

The second `autocmd` line allows one to select a few lines in vim and, while in VISUAL MODE hit `<leader>l` and send those lines to a tmux ipython session. 
As pasting code in ipython can be tricky, there are other options that might be of use in this case, just check the docs on vim-tmux-runner for more info.

Thanks byaruhaf for the great tip.