diff --git a/README.md b/README.md index fa41df4..4955204 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,9 @@ Plugin 'thoughtbot/vim-rspec' If using zsh on OS X it may be necessary to move `/etc/zshenv` to `/etc/zshrc`. +If using fish shell it is necessary to set the `$SHELL` environment variable if not set. +eg: `set -Ux SHELL /usr/bin/fish` + ## Configuration ### Key mappings diff --git a/plugin/rspec.vim b/plugin/rspec.vim index 34f7372..08a02a9 100644 --- a/plugin/rspec.vim +++ b/plugin/rspec.vim @@ -1,5 +1,7 @@ let s:plugin_path = expand(":p:h:h") let s:default_command = "rspec {spec}" +let s:fish_and = "; and " +let s:bash_and = " && " let s:force_gui = 0 if !exists("g:rspec_runner") @@ -69,7 +71,11 @@ function! s:RspecCommandProvided() endfunction function! s:DefaultTerminalCommand() - return "!" . s:ClearCommand() . " && echo " . s:default_command . " && " . s:default_command + if $SHELL =~ "fish" + return "!" . s:ClearCommand() . s:fish_and . "echo " . s:default_command . s:fish_and . s:default_command + else + return "!" . s:ClearCommand() . s:bash_and . "echo " . s:default_command . s:bash_and . s:default_command + endif endfunction function! s:CurrentFilePath()