Skip to content

Instantly share code, notes, and snippets.

@bdtomlin
Created August 27, 2014 14:32
Show Gist options
  • Save bdtomlin/813e779c647978fc27e3 to your computer and use it in GitHub Desktop.
Save bdtomlin/813e779c647978fc27e3 to your computer and use it in GitHub Desktop.
Vimux and Turbux
" for vim to interact with tmux
Bundle 'benmills/vimux'
" for awesome ruby testing
Bundle 'jgdavey/vim-turbux'
" My settings
"use closest pane already open (don't create split if there already is one)
let VimuxUseNearestPane = 1
" Create vertical split, no naturally use "h" for vertical :)
let g:VimuxOrientation = "h"
"what percentage to use in split (affects h and v splits, so height is a little misleading)
let g:VimuxHeight = "50"
"modify the vmux command to use spring
let g:turbux_command_prefix = 'spring'
"and here is some of my custom vimux stuff that is very helpful
" so I can run all tests using the parallel test gem
map <leader>a :call VimuxRunCommand("rake parallel:spec")<cr>
" I use this function to 'run' the file dependend on the few filetypes here
function! RunFile()
w
let fname = @%
if (&filetype == 'ruby')
let command = "ruby "
elseif (&filetype == 'scala')
let command = "scala "
elseif (&filetype == 'javascript')
let command = "node "
elseif (&filetype == 'go')
let command = "go run "
endif
call VimuxRunCommand(command.fname)
endfunction
map <leader>r :call RunFile()<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment