Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Neovim details in README #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thewatts
Copy link

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
screen shot 2016-02-14 at 12 17 49 am

The term command has to be used instead:

let g:rspec_command = "term rspec #{spec}"

screen shot 2016-02-14 at 12 22 13 am

Adding documentation here so that others making the switch will know about the needed adjustment!
Thanks for an excellent plugin!

@eoinkelly
Copy link

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

@tpbowden
Copy link

tpbowden commented Mar 3, 2016

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.

@jastkand
Copy link

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

@letmein
Copy link

letmein commented May 19, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants