Created
August 27, 2014 14:32
-
-
Save bdtomlin/813e779c647978fc27e3 to your computer and use it in GitHub Desktop.
Vimux and Turbux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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