rephp.nvim is a python3 plugin for neovim, which reads different regions of your code, evaluates it and echo (if there are any outputs). The idea is inspired by great REPLs like Clojures Cider. This plugin tries to deliver a similar feeling, but in a far more basic fashion.
✓ Evaluate current line
✓ Evaluate all selected lines
✘ Evaluate the current buffer
Neovim needs to be installed with if_python3. If :echo has("python3")
returns 1, then you're good to go.
Otherwise you can enable the python3 interface with pip:
pip3 install neovim
Plug 'snowiow/rephp.nvim', {'do': ':UpdateRemotePlugins'}
The best way to use this plugin, is to create two new keybindings for the normal and visual mode calls:
nnoremap <leader>l :call RePhp('n')<CR>
vnoremap <leader>l :<C-u>call RePhp('v')<CR>
Here you can set <leader>l
to any other shortcut you like.
If the PHP executable is not in your path, you also need to give the real path to the plugin
let g:rephp_executable = '/usr/bin/php'
Where the string after the equal sign should be the full path to your php executable.