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

Opening a file, it stays inside the small window? #23

Closed
thepenguinthatwants opened this issue May 6, 2020 · 11 comments
Closed

Opening a file, it stays inside the small window? #23

thepenguinthatwants opened this issue May 6, 2020 · 11 comments
Labels
question Further information is requested

Comments

@thepenguinthatwants
Copy link

thepenguinthatwants commented May 6, 2020

Hi!

I've tried your plugin ranger and neovim is nice, but the problem is that it doesnt open the file into the buffer instead it opens up inside the floating window.

Any way to open it in nvim instead of staiying inside the floating window?

@kevinhwang91
Copy link
Owner

kevinhwang91 commented May 6, 2020

Rnvimr will automatically make ranger to open the file in neovim. I think this is your installation issue.

  1. What's the :checkhealth rnvimr output in Neovim console?

  2. What's the message output in ranger when input :eval os.getenv('VISUAL') in console inside Ranger?

@thepenguinthatwants
Copy link
Author

Hi sorry! It seems to work.

Seems like its not possible to make it work like tpope vinegar plugin that it start it closes the window when I've opened a file?

@kevinhwang91
Copy link
Owner

:h rnvimr

g:rnvimr_pick_enable
    Default: 0

    Enable Ranger to be hidden after picking a file.
    It will automatically attach file in next |:RnvimrToggle|.

@thepenguinthatwants
Copy link
Author

Hi!

Now I get it.. sorry I usually just create new empty files in ranger.

Seems like this works right if the files are not empty. Tho its a bug in that part that it opens up empty files inside the small window.

@kevinhwang91
Copy link
Owner

ranger open file using rifle. Already stated in the readme.

Q: Couldn't open some special type of files by using Enter or l in Ranger.
A: Please follow below steps to solve this issue:
The behavior of openning the file in Ranger depends on rifle.conf. Press r to make sure that the ${VISUAL:-$EDITOR} -- "$@" is the best candidate in Ranger.
If the case 1 is false, change the code in rifle.conf like that:
-!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
+!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php|your_file_type = ${VISUAL:-$EDITOR} -- "$@"
execute:RnvimrSync to synchronize the rifle.conf just modified with Rnvimr.

If you want to open an empty file using ${VISUAL:-$EDITOR} -- "$@", you should change your rule of rifle.

@thepenguinthatwants
Copy link
Author

OOh thanks. Sorry I somehow didnt get that earlier.

Is there also a way if I have multiple buffer in same window and open a file by rnvimr, is it possible to leave other buffer untouched and only change the current one?

@kevinhwang91
Copy link
Owner

Sorry for my inability to understand what you mean. Please explain clearly to me.

@thepenguinthatwants
Copy link
Author

When I make a buffer split with and open rnvimr to choose a file to open. It open up in the whole window instead of the chosen buffer.

@kevinhwang91
Copy link
Owner

Do you mean all buffers in nvim' window open the same file chose by ranger? If yes, I can't reproduce your issue.
Please try a mini.vim like this:

call plug#begin('~/.config/nvim/plugged')
Plug 'kevinhwang91/rnvimr'
tnoremap <silent> <M-i> <C-\><C-n>:RnvimrResize<CR>
nnoremap <silent> <M-o> :RnvimrToggle<CR>
tnoremap <silent> <M-o> <C-\><C-n>:RnvimrToggle<CR>
call plug#end()

@keevee09
Copy link

keevee09 commented Jun 3, 2020

Hi, I have the same issue. When I run rnvimr within nvim and try to open the file in nvim,
it opens an instance of nvim in the rnvimr floating window rather than the running instance of nvim.
I am on xubuntu 18.04 with the latest neovim and ranger and a pyenv version of python3.7 in my shell.
When I run :checkhealth, health#rnvimr#check throws an error:
`ERROR: Failed to run healthcheck for "rnvimr" plugin. Exception: function health#check[21]..health#rnvimr#check[2]..154_check_python_ranger, line 7
Vim(let) :E688: More targets than List items.

OK, I have answered the problem as it pertains to myself:
rnvimr finds the apt installed (old) version of ranger and tries to use it. I uninstalled this and installed the python package with pip instead.
I have cloned your git repository and linked to ranger.py to run ranger from the shell (because the Ubuntu Repository ranger is outdated).
Within nvim, the rnvimr looks for ranger and can't find this version --- the symlink to ranger.py is in ~/bin --- but it can find the pip install ranger-fm version which runs within nvim.

@kevinhwang91
Copy link
Owner

kevinhwang91 commented Jun 3, 2020

Hi, I have the same issue. When I run rnvimr within nvim and try to open the file in nvim,
it opens an instance of nvim in the rnvimr floating window rather than the running instance of nvim.
I am on xubuntu 18.04 with the latest neovim and ranger and a pyenv version of python3.7 in my shell.
When I run :checkhealth, health#rnvimr#check throws an error:
`ERROR: Failed to run healthcheck for "rnvimr" plugin. Exception: function health#check[21]..health#rnvimr#check[2]..154_check_python_ranger, line 7
Vim(let) :E688: More targets than List items.

OK, I have answered the problem as it pertains to myself:
rnvimr finds the apt installed (old) version of ranger and tries to use it. I uninstalled this and installed the python package with pip instead.
I have cloned your git repository and linked to ranger.py to run ranger from the shell (because the Ubuntu Repository ranger is outdated).
Within nvim, the rnvimr looks for ranger and can't find this version --- the symlink to ranger.py is in ~/bin --- but it can find the pip install ranger-fm version which runs within nvim.

@keevee09
Specify your Ranger path to g:rnvimr_ranger_cmd.

g:rnvimr_ranger_cmd
Default: 'ranger'
Use this command to run a process inside the floating window.
It can mix some command of Ranger, such as 'ranger --cmd="xxx"'.

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

No branches or pull requests

3 participants