Open thewatts opened 8 years ago
It could be good to encourage constraining this change to just nvim so that we can go back & forth between vim and nvim e.g.
if has("nvim")
let g:rspec_command = "term bundle exec rspec {spec}"
endif
The problem with using term is that if you're using splits, closing the terminal will also kill the split so it's not as simple as that.
I ended up with running the command in a new tab
if has("nvim")
let g:rspec_command = "tabnew | term bundle exec rspec {spec}"
endif
Hey guys, in case anyone is still interested, here is my solution with a horizontal split:
let g:rspec_command = ':call RunMySpecs("{spec}")'
function! RunMySpecs(specs)
execute 'split | terminal bundle exec rspec ' . a:specs
execute feedkeys("\<c-\>\<c-n>")
endfunction
I added execute feedkeys("\<c-\>\<c-n>")
to prevent split from auto-closing on keypress, which is the default behavior since neovim 0.2
.
I've been making the switch over to Neovim (just to see if it's a viable option).
So far so good, but I found out that Neovim doesn't use bang commands the same as Vim. As such - the runner has to be adjusted to use the new format for terminal commands.
Using the default configuration doesn't output colors, because the bang command is used to open a pipe, read output and display to the user
The
term
command has to be used instead:Adding documentation here so that others making the switch will know about the needed adjustment! Thanks for an excellent plugin!