Re: Ranger, a textbased filemanager

Yes forgot sorry, your configuration is in ~/.config/ranger, all the files should be there if not you can run command 'ranger --copy-config=all' and it will put them there. The main one called apps.py has what you are looking for. Look for a method called ranger "CustomApplications" around line 175 you will find a statement 'def app_editor' in there is a statement that looks like this 'return self.either(c, 'vim', 'emacs', 'nano')' arrange your editors in the priority that you like. remember to backup the file before making code changes. Now on the off chance you got a very new version then the info your looking for will be in a file called rifle.conf. rifle.conf handles this all by env Variables, so you have to make sure that your $EDITOR variable carries vim as it's value. If not set it in your .bashrc or .bash_profile 'export EDITOR=vim' then it should pick it up.

Re: Ranger, a textbased filemanager

jk121960 wrote:

Yes forgot sorry, your configuration is in ~/.config/ranger, all the files should be there if not you can run command 'ranger --copy-config=all' and it will put them there. The main one called apps.py has what you are looking for. Look for a method called ranger "CustomApplications" around line 175 you will find a statement 'def app_editor' in there is a statement that looks like this 'return self.either(c, 'vim', 'emacs', 'nano')' arrange your editors in the priority that you like. remember to backup the file before making code changes. Now on the off chance you got a very new version then the info your looking for will be in a file called rifle.conf. rifle.conf handles this all by env Variables, so you have to make sure that your $EDITOR variable carries vim as it's value. If not set it in your .bashrc or .bash_profile 'export EDITOR=vim' then it should pick it up.

I don't have apps.py but do have rifle.conf but don't see any $EDITOR variable there. The file is not in ~/.config/ranger btw, but in ~/bin/ranger-master/ranger/defaults.In .bashrc there's no $EDITOR variable either and I don't see any .bash_profile at all.

Re: Ranger, a textbased filemanager

catch22 wrote:

jk121960 wrote:

Yes forgot sorry, your configuration is in ~/.config/ranger, all the files should be there if not you can run command 'ranger --copy-config=all' and it will put them there. The main one called apps.py has what you are looking for. Look for a method called ranger "CustomApplications" around line 175 you will find a statement 'def app_editor' in there is a statement that looks like this 'return self.either(c, 'vim', 'emacs', 'nano')' arrange your editors in the priority that you like. remember to backup the file before making code changes. Now on the off chance you got a very new version then the info your looking for will be in a file called rifle.conf. rifle.conf handles this all by env Variables, so you have to make sure that your $EDITOR variable carries vim as it's value. If not set it in your .bashrc or .bash_profile 'export EDITOR=vim' then it should pick it up.

I don't have apps.py but do have rifle.conf but don't see any $EDITOR variable there. The file is not in ~/.config/ranger btw, but in ~/bin/ranger-master/ranger/defaults.In .bashrc there's no $EDITOR variable either and I don't see any .bash_profile at all.

OK well you need to do 2 things migrate your config files per the instructions on the arch wiki

ranger --copy-config=all

and then in your .bashrc place the statement

export EDITOR=vim

I went back and looked and you are using gvim? I don't know if that will open any other way but seperately. One is GUI the other is ncurses. but change the above code to suit your taste. This will set that variable on boot.

Re: Ranger, a textbased filemanager

edit: Ok, the stuff I wrote doesn't work, because now I saw that there is no ranger executable in your ~/bin/ranger-master/ranger (according to your ls command of which you posted the output). Still, looks like there's something really messed up on your system. Read the recommendations at the end of my post!

Re: Ranger, a textbased filemanager

Army wrote:

... now I saw that there is no ranger executable in your ~/bin/ranger-master/ranger (according to your ls command of which you posted the output). Still, looks like there's something really messed up on your system. Read the recommendations at the end of my post!...snipped...I recommend to use ranger-git from the AUR or ranger from the repos, if you use those, you won't run into those issues!

The AUR is for Arch-users, right? I'm on Crunchbang though :-)The problem is not that ranger doesn't work, it does.ranger.py is in this path: /home/ludo/bin/ranger-master and it's even in my autostart starting up in screen.

Problem is that I want vim (or gvim) to work as editor in ranger, and not nano.On an older machine I have ranger working (the version without rifle) with vim no problem

Maybe I should indeed reinstall.Is there a good command I can use to remove the old ranger-stuff? Something with "purge" I remember vaguely?Or is simply deleting all ranger-related files I can find sufficient?

Re: Ranger, a textbased filemanager

catch22 wrote:

Army wrote:

... now I saw that there is no ranger executable in your ~/bin/ranger-master/ranger (according to your ls command of which you posted the output). Still, looks like there's something really messed up on your system. Read the recommendations at the end of my post!...snipped...I recommend to use ranger-git from the AUR or ranger from the repos, if you use those, you won't run into those issues!

The AUR is for Arch-users, right? I'm on Crunchbang though :-)The problem is not that ranger doesn't work, it does.ranger.py is in this path: /home/ludo/bin/ranger-master and it's even in my autostart starting up in screen.

Problem is that I want vim (or gvim) to work as editor in ranger, and not nano.On an older machine I have ranger working (the version without rifle) with vim no problem

Maybe I should indeed reinstall.Is there a good command I can use to remove the old ranger-stuff? Something with "purge" I remember vaguely?Or is simply deleting all ranger-related files I can find sufficient?

Thanks for all the help btw :-)

Cruchbang is debian based, so use aptitude to uinstall, then go to 'http://ranger.nongnu.org/download.html' and download the source and follow the instructions. If you have never done source it's not that difficult just folow the instructions. But I have to think that debian has a reasonable install, if not raid the ubuntu packages and grab a deb file from there. They will probably be newer then debian. If you follow the instructions on my earlier post, it should open vim.

this is in rifle.conf about line 81 or so probably sooner because I added a lot of lines to mine above that. This is looking for that variable that I told you to add to .bashrc if you add that variable this should work, if not then replace the line as follows

Re: Ranger, a textbased filemanager

hi all, ty hut for awesome file manager

Can someone help me with configuring ranger to open txt files in current vim remote server.I have:alias vimremote='vim --servername xx --remote-silent'and when I'm in ranger and do :open_with vimremote %s ranger just opens new vim session insted of sending file to existing server.same happens with :shell

Re: Ranger, a textbased filemanager

notphunny wrote:

hi all, ty hut for awesome file manager

Can someone help me with configuring ranger to open txt files in current vim remote server.I have:alias vimremote='vim --servername xx --remote-silent'and when I'm in ranger and do :open_with vimremote %s ranger just opens new vim session insted of sending file to existing server.same happens with :shell

Should I define some function in commands? I'm not good with python

Ranger doesn't read your .bashrc, so it does not know about your aliases. You could make a shell script and put it somewhere in your $PATH, or add this to the file opening rules (either the apps.py or rifle.conf configuration file, depending on your ranger version)

Re: Ranger, a textbased filemanager

Hello all!

I've recently discovered a way to make the root flag work with pipes, courtesy of a friend Ashley:

if 'r' in flags:
action = "sudo su -c '{}'".format(action)

ranger.ext.shell_escape seems to be immune to working with this, but I've seen no problems with quotations in my very low-intensity testing so far.EDIT: Probably best to implement proper escaping anyway, I think

If you're wondering, hut, if I've been implementing my suggestions - I've not had access to linux for a while, so sorry, not yet.

Re: Ranger, a textbased filemanager

So does anyone know why having ranger running inside a tmux session would prevent any shell commands in the tmux statusbar from running more than once? The other tmux statusbar commands work fine and update (host, time, etc.), but not any shell command output.My .tmux.conf is here. Notice the line:

The date and host update just fine, but the loadavg only prints once when the session is opened, but never updates again after that. And it works fine normally...unless ranger happens to be running in that session!

Re: Ranger, a textbased filemanager

Hut, Hi I am launching feh from ranger with various parameters using the lists you can create in "rifle" but ranger seems to capture keystrokes even in full screen mode. Is there away to let feh take over in full screen mode like vim does?

Re: Ranger, a textbased filemanager

I've recently discovered a way to make the root flag work with pipes, courtesy of a friend Ashley:

if 'r' in flags:
action = "sudo su -c '{}'".format(action)

Cool, thanks. I'll add this after I test it some more.

Veedrac wrote:

EDIT: Probably best to implement proper escaping anyway, I think

What do you mean?

jk121960 wrote:

Hut, Hi I am launching feh from ranger with various parameters using the lists you can create in "rifle" but ranger seems to capture keystrokes even in full screen mode. Is there away to let feh take over in full screen mode like vim does?

Re: Ranger, a textbased filemanager

jk121960 wrote:

Hut, Hi I am launching feh from ranger with various parameters using the lists you can create in "rifle" but ranger seems to capture keystrokes even in full screen mode. Is there away to let feh take over in full screen mode like vim does?

added the --magick-timeout -1 to disable image magick conversion attempts when it hits an video or image it can't handle and just put a "." for this directory it works but you have to have an image to start it unless you put it in a map command. Also some camera's have uppercase ext's #$@$##@ what's that about. I suppose I could write a script to fix it, anyway the recursive works this way. Cool thanks again