vim-stream icon indicating copy to clipboard operation
vim-stream copied to clipboard

Adding NeoVim support

Open klaxalk opened this issue 7 years ago • 4 comments
trafficstars

Hello, I would like to update vim-stream to support NeoVim. It would be almost straightforward, except the nvim's pipe mode does not print the "Vim: Reading from stdin..." message, thus the tail is not necessary.

I am not sure whether the use of whereis and awk to detect the path to Vim/NeoVim binary is correct. Please correct me, if there is a better way. In this case the $VIM/$NVIM variables are empty when Vim or NeoVim is not installed.

klaxalk avatar Aug 11 '18 11:08 klaxalk

Codecov Report

Merging #2 into master will decrease coverage by 5%. The diff coverage is 71.42%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #2   +/-   ##
=======================================
- Coverage   91.66%   86.66%   -5%     
=======================================
  Files           1        1           
  Lines          24       30    +6     
=======================================
+ Hits           22       26    +4     
- Misses          2        4    +2
Impacted Files Coverage Δ
vims 86.66% <71.42%> (-5%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update acb9f08...0083c41. Read the comment docs.

codecov-io avatar Aug 11 '18 11:08 codecov-io

Hi @klaxalk, thanks for adding this! Looks good to me. I'm going to add nvim support to the test suite, see if I can remove the use of awk, and then merge.

MilesCranmer avatar Aug 12 '18 01:08 MilesCranmer

So the command "$(which nvim)" is enough to replace the command with awk.

By the way, I'm having issues getting neovim to work at all - have you seen good results? Perhaps (macOS) brew installed an older version. For instance, the command (using the basics - without vims):

 echo 'HELLO!' | nvim - -nes -c ':exe "norm ggAHELLO2"' -c :%p -c ':q!'

Only prints HELLO2 at the output.

MilesCranmer avatar Aug 12 '18 01:08 MilesCranmer

Hi, $(which nvim) might be problematic when nvim is aliased (I have both vim and nvim aliased to add some launch parameters automatically). Neovim worked out of the box for me. I installed it from repositories on Ubuntu, currently on 0.3.2-dev. I found just a handful of incompatibilities between vim and nvim, this was one of them. The other was that to achieve headless mode, nvim requires --headless and that colors in tmux can be fixed like:

if !has("nvim")
  set term=screen-256color
else 

It looks like that you are required to use the improved Ex mode for that command. That is what I use most of the time. Thus -nEs.

Sincerely, Tomas

klaxalk avatar Aug 18 '18 16:08 klaxalk