christoomey / vim-tmux-runner

Vim and tmux, sittin' in a tree...
MIT License
291 stars 37 forks source link

Add SendFile command proper #30

Closed christoomey closed 9 years ago

christoomey commented 9 years ago

Bring SendFile functionality into the plugin. Support overriding / setting the runner via extend() vimscript function. Switch to filename interpolation rather then straight concatenation.

let g:tmux_filetype_runners = {
        \ 'haskell': 'ghci',
        \ 'ruby': 'ruby',
        \ 'javascript': 'node',
        \ 'python': 'python',
        \ 'sh': 'sh'
        \ }

function! SendFileViaVtr()
  if has_key(g:vtr_filetype_runners, &filetype)
    let runner = runners[&filetype]
    let local_file_path = expand('%')
    execute join(['VtrSendCommandToRunner', runner, local_file_path])
  else
    echoerr 'Unable to determine runner'
  endif
endfunction