francoiscabrol / ranger.vim Goto Github PK
View Code? Open in Web Editor NEWRanger integration in vim and neovim
Ranger integration in vim and neovim
If you quit ranger without opening a file, jumping to the previous buffer (:b#<CR>
) does not wor; it errors with:
E86: Buffer XX does not exist
I assume ranger creates a buffer, which is wiped on close. Do you have any idea how to fix this?
Hey, thx for the awesome plugin!
It really gave me a boost.
I am mostly using RangerCurrentFileNewTab as trigger.
Sometimes it happens, that the new file i am opening is already open in another tab.
The current behavior of RangerCurrentFileNewTab is, that it opens a new tab despite the fact, that the file is already open, so that i have two tabs for the same file.
I would prefer to let RangerCurrentFileNewTab trigger a jump to the already open tab.
Is that somehow possible with the current state of the plugin?
thx again!
Hi, I have the following config
let g:ranger_replace_netrw = 1 " open ranger when vim open a directory
let g:NERDTreeHijackNetrw = 0
however when I do :e .
or :e my_dir
I get a new buffer and the status message: "my_dir" is a directory
.
When opening vim from the command line with nvim my_dir
, I get the same thing but it also puts me in insert mode.
I am using neovim v0.2.2, python 2.7.14 and python 3.6.4, :Checkhealth
is all Ok. Using macOS 10.13.2.
Relevant PR: #36
The error swishes by so fast that I can't see what it says exactly, but when I choose a file in ranger to be opened in vim and the filename has one or more spaces in it, it errors out going back to vim without opening up a new buffer with the chosen file.
When trying to open PDF I get a new buffer with what seems to be a textual representation of all the data/metadata in the PDF. My desired behavior is that it would open the PDF using the appropriate program as ranger does normally (when called from command line).
I seem to be unable to perform a bulkrename. After selecting the desired files and :bulkrename %s
the files are opened in regular buffers. Is it possible to perform this from within Vim -> Ranger?
Would be nice to be able to disable netrw and have ranger handle opening directories.
After pressing leader+F, ranger opens nicely, moving between folders works nicely, but opening the file failes:
My output below powershell:
TERMINAL term://.//8234:ranger --choosefiles=/tmp/chosenfile --selectfile=""[-] [unix] 100% ☰ 56/56 ㏑ : 1
Error detected while processing function 10:
line 4:
E492: Not an editor command: ^[[36mfish config loaded^@
Press ENTER or type command to continue
^[[36m... is my welcome message in the shell, shell displays it when I open a new terminal, or when in tmux I create new terminals
How can I remap copy/paste in Ranger?
The default is :
map yy copy
map pp paste
I would like to change it to Ctrl-C and Ctrl-v:
map <C-c> copy
map <C-v> paste
However, it does not work. Do you know why and how I can get it to work?
When launching vim with vim .
, selecting two files with space, and then pressing enter to open them (great feature btw), my up arrow keybindings (scroll the view up) is stolen, and it just takes me back to the empty buffer that I guess was temporarily meant for ranger. It has the name of the directory as a file name, and in the status line (the one where the :commands go) it says "~/blabla/dir" is a directory
. This weirdness does not happen if I open ranger from within vim, let's say for example with a :RangerCurrentFile
command - so only when :e
ing a directory. Maybe you know Franco, or maybe I can look into it myself.
PS I'm working from an iTerm2 terminal with tmux on OSX.
edit: just arrow <up>
key, not down.
I've noticed that it takes about 1-2 seconds from the moment you select a file in ranger and press <CR>
to the moment when vim actually opens that file.
I'm running Neovim and I tried also running it without any plugin (nvim -u NONE
) and sourcing ranger plugin manually (:so ranger.vim
) but I still get the same behavior.
I get no delay when opening files using :edit
or other methods (such as other plugins to find and open files).
Is that normal?
If not, have you got any suggestion to fix this problem?
On a clean install of Ubuntu 18.04 (vim version 8.0), I'm getting
E118: Too many arguments for function: OpenRangerIn
When trying to run :Ranger or f
ranger.vim is the only plugin installed, after vim-plug.
Hi,
after loosing focus, ranger is just a text buffer. Can you reproduce this?
NVIM v0.2.0-dev
Optional features included (+) or not (-): +acl +iconv +jemalloc +tui
For differences from Vim, see :help vim-differences
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
The only reason i am using my own custom implementation of this functionality is because i really like the option of 1. opening ranger in the current working directory or 2. opening the current file's directory (and selecting the current file) using the --selectfile argument to ranger.
Would you perhaps be open to implementing this?
I did not create a PR because i do not know how you would like to implement it. I have done it like so (original code copied from http://ornicar.github.io/2011/02/12/ranger-as-vim-file-manager.html which does not exist anymore):
nmap <leader>r :call Ranger(1)<cr>
nmap <leader>R :call Ranger(0)<cr>
function! Ranger(cwd)
let currentFile = expand("%:p")
let rangerCallback = { 'name': 'ranger' }
function! rangerCallback.on_exit(id, code)
Bclose!
try
if filereadable('/tmp/chosenfile')
exec system('sed -ie "s/ /\\\ /g" /tmp/chosenfile')
exec 'argadd ' . system('cat /tmp/chosenfile | tr "\\n" " "')
exec 'edit ' . system('head -n1 /tmp/chosenfile')
call system('rm /tmp/chosenfile')
endif
endtry
endfunction
enew
if a:cwd
call termopen('ranger --choosefiles=/tmp/chosenfile', rangerCallback)
else
call termopen('ranger --choosefiles=/tmp/chosenfile --selectfile=' . currentFile, rangerCallback)
endif
startinsert
endfunction
I use <leader>f
already for another binding, would make sense to have a customizable mapping here instead of "hijacking" it globally.
MX Linux 17
NVIM v0.3.0-1029-g48967695c Build type: RelWithDebInfo
.It will, instead, send me to the last buffer.
The same as in nerdtree
is should a shortcut to open a file in a new tab or a space.
Thank you.
In some systems like Android, users don't have permission to access /tmp
directory. So, an option to change that would be good. Even better, determinate that if /tmp
isn't readable prefer ~/.local/ranger.vim/chosenfile
or ~/.cache/ranger.vim/chosenfile
as workaround.
MX Linux 17
NVIM v0.3.0-1029-g48967695c Build type: RelWithDebInfo
.I have tested with all the provided commands (except the ones for new tabs, because I don't use those), and every time I open a file that Nvim opened through a symlink, it defaults the some "~/auto" that I don't remember creating. I want it to open in the current file or in the current working directory, like it does with all the other files.****
Having ranger.vim installed breaks netrw, the built in file explorer.
Running :Explore
results in E492: Not an editor command: Explore
.
See this stack overflow question.
Also, I have bclose.vim installed and set this in my vimrc:
let g:ranger_replace_netrw = 0
Issue still occurs.
It would be great to have the ranger functionality but still be able to do a quick :Explore
, :Vexplore
, or especially :Sex
.
This seems not to work with files/dirs with whitespaces in the name.
$ mkdir "FOO BAR"
$ vim FOO\ BAR/file
# in vim, do :Ranger
# It won't work
# now quit
# the following output has appeared:
File or directory doesn't exist: /home/elvis/FOO
Running :Ranger or similar just leaves vim hanging untill i press 'q', unable to get ranger to show
hi, could you add the bang attribute to the command definition at the following line please? vim is complaining when I update.
https://github.com/francoiscabrol/ranger.vim/blob/master/plugin/ranger.vim#L66
thanks!
With the default command :Ranger
, instead of Ranger opening, I get the following message instead:
Warning: Using ranger as a file launcher is deprecated.
Please use the standalone file launcher 'rifle' instead.
Interestingly enough, other commands like :RangerNewTab
work just fine.
Ranger version: ranger-stable 1.8.1
when i run :bd
in the ranger term buffer it closes the ranger buffer and then it runs :bd
again on another buffer
https://github.com/francoiscabrol/ranger.vim/blob/master/plugin/ranger.vim#L31
I Can't understand why the shortcut doesn't work when I run the ranger in NeoVim. Shortcut is binded to showing hidden files in ranger .
when I open a file from ranger use neovim, how can I go back to ranger like \q
?
if use :q
, it will all exit.
I know we can use a map :Ranger
but I am not sure my vim is open whether from ranger or shell,
If I open my vim from shell, \q
to ranger make not sense.
I found out that when I had opened buffers, I moved files from one directory to another.
Vim was unaware of this and buffers of deleted files were still there. And this produced confusion.
Is there a way that after deleting or moving files buffers will be deleted aswell ?
It would be perfec also if fugitive will also know that files were deleted or moved.
Is that possible to implement this ? Ranger is just brilliant to manipulating files. It would be perfect to implement this well with vim
After upgrading to Neovim 0.2 it appears this plugin has broken.
After either exiting ranger or trying to open a file with it exits with an error.
E118: Too many arguments for function: 16
The 16 increases by 1 on subsequent calls.
I am running Arch Linux, Neovim 0.2.0-1 from the official repos and ranger:
ranger-stable 1.8.1
Python 3.6.1 (default, Mar 27 2017, 00:27:06)
[GCC 6.3.1 20170306]
When opening a new file, I get the following error:
Error detected while processing function 101..<SNR>30_Bclose:
line 45:
E516: No buffers were deleted: bdelete! 6
The file is successfully loaded afterwards. In that case, don't you think that the error message must be suppressed if everything went fine? I'm using Neovim 0.1.2.
hi, the last commit break : RangerWorkingDirectoryNewTab
with :
in the normal Ranger project there's image previews, is there a way to support that in this vim plugin?
Hi I just can't figure it out how I can open another file that will be open vertically or horizontally in new window ? I checked ranger tab methond and that is working fine. But still could not find the way how to open file in new window without closing original file where ranger method was triggered. Maybe this was just not coded ?
Thanks !
Running it with MacVim does not work. It stays frozen and never gets to open "ranger".
I have to :set rnu
every time I opened a file from ranger. Any idea why?
Thanks in advance :)
Hi, is it possible to enable Neovim-like search (incsearch) in Ranger? Basically It's a "search as you type", so the cursor automatically jumps to the best match while searching. Or, even better, maybe there is a way to make Ranger respect Vim seach options (incsearch, smartcase etc)?
I want to modify command, that open ranger to open it with custom SHELL (to load .zshrc before ranger for aliases) and custom theme (because default theme look ugly in my vim) like this
SHELL=/home/bjorn/.config/ranger/rshell ranger --cmd "set colorscheme snow"
Hi,
It seems that my ranger is constantly having problems rendering in alignment. This does not happen when I open it up outside of neovim. I will provide a screenshot below:
The plugin that I am using from you has not been changed at all and I still get the same error when I try to call it without the functions you have created. Thank you!
Versions:
Arch Version: 4.16.13-2
NVIM version: v0.3.0
Ranger Version: 1.9.1
Python Version: 3.6.5
Terminal Emulator: Termite v13
With the new argument for ranger "--selectfile" when I try open current directory it opens the parent directory.
For example this is the current directory:
When I open ranger.vim with the current directory command it opens the parent dir.
I have a fix for this on NVIM but I need to know if I'm not the only one with the problem to make a PR.
NVIM 0.2.0 - Custom Release Build
ranger-stable 1.8.1
I use Yggdroot/indentLine
Plug 'Yggdroot/indentLine'
let g:indentLine_char='┆'
let g:indentLine_enabled = 1
so ranger.vim
show '┆' in indent blank.
Currently, when ranger exits (on file choose, or pressing q), neovim hangs in terminal mode. doesn't work, nor can I get it to return to normal mode at all. After some debugging, it seems that nvim somehow isn't aware that ranger is closed (or at least the rangerCallback.on_exit function is never being run), and I've no idea why. Is this an issue with my configuration? A blank init.vim with just this plugin has the same problem, so I'm totally stumped.
Caveat -- I am running ranger directly via a symlink to the ranger.py script, not from a system install.
Currently it opens full screen, I believe it will be nice to open it somewhere bellow, so you can still see you working code, and navigate into a new file.
Honestly, I am not sure this is an issue with the plugin. The only please I cannot get it to reproduce is inside of vim8. But in neovim the plugin looks like this:
I've tried removing all of ranger configurations, neovim configurations and nothing. Any ideas would be great!
Thanks for a great plugin!
Hi,
Thank you for your work, I love using ranger inside Vim 👍
When I want to open ranger from a terminal in NeoVim (:te), I can't open it because the path is corrupted like this :
Inaccessible paths: ['/my/current/folder/term:/3653:/bin']
I guess it's not a wanted behavior... Any thought ?
When I try to :Ranger MacVim just hangs.
version 8.0 (124)
I'm using the plugin alexanderjeurissen/ranger_devicons
for Ranger.
But when it comes to the Ranger.vim
, icons are not showing properly.
Probably it's the NerdFont
issue but I have no idea where to work on.
When I launch ranger from within Vim 8
it honours my spacemacs theme (iterm is set to use spacemacs as is vim itself):
When I launch ranger from within neovim
it doesn't:
I'm not sure why this is happening :/ Launching ranger from the command line also honors my spacemacs colorscheme. (both vim/nvim use the same vim config)
Thanks for this extension.
When I try to open a file from ranger.vim
in neovim
I get this error:
Error detected while processing function 328:
line 4:
E492: Not an editor command: stty: stdin isn't a terminal^@
Is there any workaround for it? I wonder why it doesn't happen for you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.