kevinhwang91 / rnvimr

Make Ranger running in a floating window to communicate with Neovim via RPC
BSD 3-Clause "New" or "Revised" License
804 stars 17 forks source link

[Feature request] support python3_host_prog #82

Closed laggardkernel closed 3 years ago

laggardkernel commented 3 years ago

:h python3_host_prog, I have this global variable set and installed ranger-fm, pynvim within. But this interpreter is not chosen by rnvimr without activating this very interpreter manually.

kevinhwang91 commented 3 years ago

OK, so many users complain about it. I will try to implement this feature.

kevinhwang91 commented 3 years ago

Please try below snippet which works for me.

let g:python3_host_prog = 'path/python'
let g:rnvimr_ranger_cmd = g:python3_host_prog . ' ' . fnamemodify(g:python3_host_prog,':h') . '/ranger --cmd="set draw_borders both"'
laggardkernel commented 3 years ago

Thanks. This does work for me.

let g:rnvimr_ranger_cmd = fnamemodify(g:python3_host_prog,':h') . '/ranger'

Another problem I encountered is that the bookmarks are not listed after typing ', even I specify the conf dir with -r /path/to/my/ranger/conf in g:rnvimr_ranger_cmd. No idea why the bookmarks are lost when using this plugin.

kevinhwang91 commented 3 years ago

Thanks. This does work for me.

let g:rnvimr_ranger_cmd = fnamemodify(g:python3_host_prog,':h') . '/ranger'

I suggest you run eval ranger cmd in ranger to make sure the python interpreter as you expect.

Another problem I encountered is that the bookmarks are not listed after typing ', even I specify the conf dir with -r /path/to/my/ranger/conf in g:rnvimr_ranger_cmd. No idea why the bookmarks are lost when using this plugin.

I can't reproduce this issue. Please check out your bookmarks file after ranger is exited. Here's my path ~/.local/share/ranger/bookmarks

Press q in neovim can't actually exit ranger, use Q instead.

laggardkernel commented 3 years ago

I can't reproduce this issue. Please check out your bookmarks file after ranger is exited. Here's my path ~/.local/share/ranger/bookmarks

My bookmark file is ~/.config/ranger/bookmarks. I did a search of keyword "bookmarks" in my ranger configs. Turns out this place is not a custom location defined by me. It should be a standard place supported by ranger. No idea why it's not preferred over ~/.local/share/ranger/bookmarks within rnvimr, although it takes precedence over the one in ~/.local/share/... outside neovim.

I put the bookmarks under ~/.config/ranger cause I wanna the bookmark file collected to my dotfile. Um, I'll make ~/.local/share/ranger/bookmarks as a symlink for a temp solution.

Press q in neovim can't actually exit ranger, use Q instead.

I prefer Meta-o to toggle display of ranger, cause q also quits a tab.

kevinhwang91 commented 3 years ago

My bookmark file is ~/.config/ranger/bookmarks. I did a search of keyword "bookmarks" in my ranger configs. Turns out this place is not a custom location defined by me. It should be a standard place supported by ranger. No idea why it's not preferred over ~/.local/share/ranger/bookmarks within rnvimr, although it takes precedence over the one in ~/.local/share/... outside neovim.

I put the bookmarks under ~/.config/ranger cause I wanna the bookmark file collected to my dotfile. Um, I'll make ~/.local/share/ranger/bookmarks as a symlink for a temp solution.

Please check out https://github.com/ranger/ranger/blob/905298d3dcd1fcb3f4c25d88c2584cd2cc46c838/ranger/core/fm.py#L306-L314

This plugin proxy confdir to load its library and load default confdir later, I think this is a bug for rnvimr, we should change confdir after loading default confdir. I will fix it later.

kevinhwang91 commented 3 years ago

@laggardkernel Code is updated, I think you can delete your linked file.