kevinhwang91 / rnvimr

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

Please set $XDG_CONFIG_HOME/ranger as confdir #123

Closed sagsai closed 2 years ago

sagsai commented 2 years ago

The following code in the autoload/rnvimr.vim file sets the config dir relative to the code file.

let s:rnvimr_path = expand('<sfile>:h:h')
let s:confdir = s:rnvimr_path . '/ranger'

As a result, the ranger plugins are not loaded and the keymap modifications don't work.

I think $XDG_CONFIG_HOME if set should be used as the config base by default with an option given to override that. e.g.

let g:rnvimr_relative_conf_dir = get(g:, 'rnvimr_relative_conf_dir', 0)
if g:rnvimr_relative_conf_dir == 0 && isdirectory($XDG_CONFIG_HOME)
    let s:confdir = $XDG_CONFIG_HOME . '/ranger'
else
    let s:rnvimr_path = expand('<sfile>:h:h')
    let s:confdir = s:rnvimr_path . '/ranger'
endif

I considered making changes my changes to the /usr/lib/python3/dist-packages/ranger/config/rc.conf file but that is ugly and updating ranger will probably overwrite that.

I have made the above change at the beginning of the autoload/rnvimr.vim file but future plugin changes may overwrite that when synced by the neovim package manager.

kevinhwang91 commented 2 years ago

I think you misunderstand how rnvimr works. s:confdir is the config of rnvimr and rnvimr will load the user's config later.

sagsai commented 2 years ago

I think you misunderstand how rnvimr works. s:confdir is the config of rnvimr and rnvimr will load the user's config later.

Yes, I did actunally misunderstand. pynvim was not accessible from inside the plugin because there are multiple versions of python3 in my system and which one to use was not specified in the init file. As a result the plugin was not fully working. Fixing the python issue fixed the plugin as well.

Thanks for a great plugin.