You are not logged in.

#1401 2012-07-11 07:52:51

Veedrac
Member
Registered: 2011-07-19
Posts: 81

Re: Ranger, a textbased filemanager

MadCatMk2 wrote:
pablox wrote:

Hi! One of the coolest features I found in ranger is the "f" command (quick navigation)... though I was wondering if it was possible to instead of just jumping, start hiding the files that doesn't match the query (something like a fuzzy search), it seems to me that is a bit clearer than insert characters and suddenly jump.

DId I explain myself?

PS.- Great job, this little app rocks smile

You're looking for :filter / 'zf'
'/' and then 'n' is more practical for me in most cases though

:filter, if I remember correctly (I'm not on linux atm), dosn't let you navigate during the filtering. While :filter is definately close, a hypothetical :filter_search would be nicer, no?

I believe I posted a version a lot earlier in this thread, I'll look for it, and if not I'll post it once I've had access to my home computer.

EDIT: Hyar it is, I think. This isn't from my working ranger, so I might (probably) have updated it since, but I don't have ranger on me.
No, the code on this forum is old. I'll post the new version once I can if :filter isn't all you're looking for.
If you want it now and know how to make custom commands, you want to put a "def tab(self): self.fm.move(down=1)" clause in a copy of the default filter command [or summin], but that doesn't wrap searches, per se.

Last edited by Veedrac (2012-07-11 08:20:21)

Offline

#1402 2012-07-12 08:34:25

xtremyst
Member
Registered: 2011-11-21
Posts: 14

Re: Ranger, a textbased filemanager

hello, i recently tried ranger and i'm realy impressed, there's one thing that's troubling me though
i have installed vlc for video files and deadbeef for audio files and ranger uses vlc as the default application for both.
i tried to edit apps.py and add a new entry for mp3 and flac extensions or separate video from audio
in order to use different applications for those but didn't have any luck with that, anyone can explain what do i have to do?
thanx in advance...

Offline

#1403 2012-07-12 10:27:15

mentat
Member
From: France
Registered: 2009-01-13
Posts: 138
Website

Re: Ranger, a textbased filemanager

xtremyst wrote:

...i tried to edit apps.py and add a new entry for mp3 and flac extensions or separate video from audio
...

Hi
you need to edit

~/.config/ranger/rifle.conf

Read the header to config

# This is the configuration file of "rifle", ranger's file executor/opener.
# Each line consists of conditions and a command.  For each line the conditions
# are checked and if they are met, the respective command is run.

For the same condition, order of lines give a priority to excution.
Other lines goes to the menu when you press 'r' key.

edit: typo

Last edited by mentat (2012-07-12 10:28:06)

Offline

#1404 2012-07-12 12:39:20

xtremyst
Member
Registered: 2011-11-21
Posts: 14

Re: Ranger, a textbased filemanager

ok, i did it, thank  you very very much, have a great day...

Offline

#1405 2012-07-17 08:20:18

starstuff
Member
Registered: 2012-07-17
Posts: 4

Re: Ranger, a textbased filemanager

hello ranger community,

im new to using ranger and a new user to linux, i found the vim shortcuts to be what i was looking for, thus i found ranger.

i would like to ask if its possible/how to copy/moves files using both shortcuts and the console.

e.g. i like to move files "a","b","c" located in home/user/Old to folder "New" in home/user/New

i would like to be able to [da] files "a","b","c"  but i don't want to go to home/user/New to [pp], after [da]  files "a","b","c", i would like to just type :move copy_buffer "home/user/New", then it would move the files

also, the :delete command destroys the data completely instead of moving it to the trash. i think it would better for the delete to move to trash first

thanks

Last edited by starstuff (2012-07-17 08:30:31)

Offline

#1406 2012-07-17 08:27:35

MadCatMk2
Member
Registered: 2010-05-10
Posts: 84

Re: Ranger, a textbased filemanager

starstuff wrote:

hello ranger community,

im new to using ranger and a new user to linux, i found the vim shortcuts to be what i was looking for, thus i found ranger.

i would like to ask if its possible/how to copy/moves files using both shortcuts and the console.

e.g. i like to move files "a","b","c" located in home/user/Old to folder "New" in home/user/New

i would like to be able to [da] files "a","b","c"  but i don't want to go to home/user/New to [pp], after [da]  files "a","b","c", i would like to just type :move copy_buffer "home/user/New", then it would move the files

thanks

Mark the files you want, then type @mv^E and type in the destination. Read up on ! and # too if you want.

Offline

#1407 2012-07-17 08:50:35

starstuff
Member
Registered: 2012-07-17
Posts: 4

Re: Ranger, a textbased filemanager

@MadCatMk2

thanks MadCatMk2 for you quick reply, i tried your suggestion but i can't seem to make it work.

i tried marking the files with [space/da] click shift+2 for the [@] it goes to :shell type in mvE [shift+e] typed the new location, doesn't work.

i assume mv is move in bash?

sorry if i didn't quite follow you,

where can i read up on ! and #?

thanks

Last edited by starstuff (2012-07-17 08:54:34)

Offline

#1408 2012-07-17 08:56:14

MadCatMk2
Member
Registered: 2010-05-10
Posts: 84

Re: Ranger, a textbased filemanager

Yes this is a shell line youre typing in. ^e is ctrl+e which simply takes you to the end of the line. %s is the marked (not cut) files.

The rest should be in thr manpage accessible via F1

Last edited by MadCatMk2 (2012-07-17 08:56:59)

Offline

#1409 2012-07-17 09:17:18

starstuff
Member
Registered: 2012-07-17
Posts: 4

Re: Ranger, a textbased filemanager

@MadCatMk2

thanks a lot MadCatMk2!!! i was able to move it at last! smile

i've been reading the man but i've skipped some parts like the macro and such, they are pretty new to me. thanks for the help MadCatMk2!

btw, do you use the :alias command? how do you use it?

thanks

Offline

#1410 2012-07-17 10:23:45

MadCatMk2
Member
Registered: 2010-05-10
Posts: 84

Re: Ranger, a textbased filemanager

starstuff wrote:

btw, do you use the :alias command? how do you use it?

If you simply type in :alias you'll get usage information. It's used to bind a new custom command.
For example:
:alias bye quit

You'll find more information in the commands.py file.

Last edited by MadCatMk2 (2012-07-17 10:24:42)

Offline

#1411 2012-07-17 23:55:48

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

Re: Ranger, a textbased filemanager

You can use this command to copy the copied files to some place:

shell cp %c /home/user/new

%c is replaced by the files you have previously copied with dd/da/yy/ya.
Aliases can take no arguments (yet), so if you want to do this for a "send to trash" command, it will suffice to use

alias trash shell mv /home/user/trash

but if you want a variable target directory, I'd make a shortcut like this

map x console shell cp %c 

There is a space at the end. This opens the console with "shell cp %c " and you only have to insert the directory.


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#1412 2012-07-18 00:41:42

starstuff
Member
Registered: 2012-07-17
Posts: 4

Re: Ranger, a textbased filemanager

@MadCatMk2

thanks for the explanation, will check out commands.py

@hut

thanks for the solutions! will use the alias and map command to make life easier.
thank you sir hut for ranger! this is a very wonderful app, i don't even miss windows explorer anymore.

btw, why is your owl have only one foot?

Offline

#1413 2012-07-28 22:52:25

darkfeline
Member
Registered: 2012-02-14
Posts: 94

Re: Ranger, a textbased filemanager

Hi!  I really like ranger, but there's one thing that's bugging me.  When you open a file, e.g. :open_with, how can you make the process fork?  If I open an .odt, for example, if I quit ranger, it kills libreoffice as well.  It's annoying to have to :shell libreoffce %f & each time

Edit: :shell libreoffice %f & doesn't work either.  I remember there was a way to do it, but can't recall.  Anyway, it's annoying smile

Last edited by darkfeline (2012-07-28 22:54:03)

Offline

#1414 2012-07-28 22:58:49

MadCatMk2
Member
Registered: 2010-05-10
Posts: 84

Re: Ranger, a textbased filemanager

darkfeline wrote:

Hi!  I really like ranger, but there's one thing that's bugging me.  When you open a file, e.g. :open_with, how can you make the process fork?  If I open an .odt, for example, if I quit ranger, it kills libreoffice as well.  It's annoying to have to :shell libreoffce %f & each time

Edit: :shell libreoffice %f & doesn't work either.  I remember there was a way to do it, but can't recall.  Anyway, it's annoying smile

FLAGS section under CONCEPTS in the manpage tells you how to detach.
Doesn't always work right for me though. Could be a misconfiguration but it works with ":open_with 2 d" for me but not with ":open_with gimp d" at the moment. Give it a try.

Offline

#1415 2012-07-28 23:18:04

darkfeline
Member
Registered: 2012-02-14
Posts: 94

Re: Ranger, a textbased filemanager

Nope, 'd' flag doesn't work for me either.

Offline

#1416 2012-07-29 07:30:21

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: Ranger, a textbased filemanager

starstuff wrote:

btw, why is your owl have only one foot?

It's a Hoothoot, never played Pokémon Silver/Gold ? tongue
Anyway, yesterday I copied an huge amount of data between disks and it was painful not having an indication of the progress.
I'd say to use rsync or cp with -v switch and parsing the output to be shown in the task window, maybe as a progressbar.

Offline

#1417 2012-07-29 08:45:18

mentat
Member
From: France
Registered: 2009-01-13
Posts: 138
Website

Re: Ranger, a textbased filemanager

TheLemonMan wrote:

...I'd say to use rsync or cp with -v switch and parsing the output to be shown in the task window, maybe as a progressbar.

This is the only thing I miss as well. This would be a great evolution for a wonderful piece of art.

Edit: May be the indicator could be at the tasks view screen ?

Last edited by mentat (2012-07-29 08:47:42)

Offline

#1418 2012-07-29 15:53:32

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: Ranger, a textbased filemanager

+1 for an indicator when moving (big) files!


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#1419 2012-07-29 16:47:40

jk121960
Member
From: Palos Hills, Illinois
Registered: 2011-12-09
Posts: 254

Re: Ranger, a textbased filemanager

MadCatMk2 wrote:
darkfeline wrote:

Hi!  I really like ranger, but there's one thing that's bugging me.  When you open a file, e.g. :open_with, how can you make the process fork?  If I open an .odt, for example, if I quit ranger, it kills libreoffice as well.  It's annoying to have to :shell libreoffce %f & each time

Edit: :shell libreoffice %f & doesn't work either.  I remember there was a way to do it, but can't recall.  Anyway, it's annoying smile

FLAGS section under CONCEPTS in the manpage tells you how to detach.
Doesn't always work right for me though. Could be a misconfiguration but it works with ":open_with 2 d" for me but not with ":open_with gimp d" at the moment. Give it a try.

Hi, I read this yesterday and it didn't click, but I don't have this problem. I don't know what the difference is but I use AWESOME DE and Ranger git, I checked some office files and some pdf's and closed ranger and they stayed.

--jerry

PS: Libreoffice and evince for the pdf's

Last edited by jk121960 (2012-07-29 16:48:40)


Arch Awesome, Ranger & Vim the coding triple threat.

Offline

#1420 2012-08-02 00:40:03

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

Re: Ranger, a textbased filemanager

About the progressbar:
The problem is that nobody is willing to write progressbar support for ranger. If I had a program that works like cp and periodically prints the status to the stdout, that would be great.

But honestly, I wouldn't copy large amounts of data with ranger because I want to see the logs.

jk121960 wrote:
MadCatMk2 wrote:
darkfeline wrote:

Hi!  I really like ranger, but there's one thing that's bugging me.  When you open a file, e.g. :open_with, how can you make the process fork?  If I open an .odt, for example, if I quit ranger, it kills libreoffice as well.  It's annoying to have to :shell libreoffce %f & each time

Edit: :shell libreoffice %f & doesn't work either.  I remember there was a way to do it, but can't recall.  Anyway, it's annoying smile

FLAGS section under CONCEPTS in the manpage tells you how to detach.
Doesn't always work right for me though. Could be a misconfiguration but it works with ":open_with 2 d" for me but not with ":open_with gimp d" at the moment. Give it a try.

Hi, I read this yesterday and it didn't click, but I don't have this problem. I don't know what the difference is but I use AWESOME DE and Ranger git, I checked some office files and some pdf's and closed ranger and they stayed.

--jerry

PS: Libreoffice and evince for the pdf's

You'll need to use the program "setsid" for that, it ensures that the program will stay unharmed no matter how badly you torture the ranger.

If you run ranger 1.5.4 (stable):

1. run "ranger --copy-config=apps" to get the current apps.py config file.
2. add this to the class CustomApplications in your newly created ~/.config/ranger/apps.py:

	@depends_on('gimp', 'X')
	def app_gimp(self, c):
		return "setsid", "gimp", c

3. remove the 'gimp' entry at the very bottom of the file, in case it overrides your setting:

CustomApplications.generic(
[...]
	'eog', 'mirage', 'gimp',

(remove 'gimp' there.)

If you use ranger-git, this is already done by default. But the flag has been renamed from "d" (for detach) to "f" (for fork).


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#1421 2012-08-05 19:59:03

Sirsurthur
Member
Registered: 2009-02-02
Posts: 124

Re: Ranger, a textbased filemanager

Hi Hut,

Just experienced a bug with latest git while using marks with keybinding " ' " :

ranger version: 1.5.4, executed with python 3.2.3
Locale: fr_FR.UTF-8
Current file: /home/julien/dl
Traceback (most recent call last):
  File "/usr/lib/python3.2/site-packages/ranger/core/main.py", line 132, in main
    fm.loop()
  File "/usr/lib/python3.2/site-packages/ranger/core/fm.py", line 258, in loop
    ui.handle_input()
  File "/usr/lib/python3.2/site-packages/ranger/gui/ui.py", line 209, in handle_input
    self.handle_key(key)
  File "/usr/lib/python3.2/site-packages/ranger/gui/ui.py", line 145, in handle_key
    self.press(key)
  File "/usr/lib/python3.2/site-packages/ranger/gui/ui.py", line 160, in press
    quantifier=keybuffer.quantifier)
  File "/usr/lib/python3.2/site-packages/ranger/core/actions.py", line 136, in execute_console
    escape=cmd.escape_macros_for_shell)
  File "/usr/lib/python3.2/site-packages/ranger/core/actions.py", line 151, in substitute_macros
    macros = self._get_macros()
  File "/usr/lib/python3.2/site-packages/ranger/core/actions.py", line 205, in _get_macros
    tab_dir = self.get_directory(tab_dir_path)
  File "/usr/lib/python3.2/site-packages/ranger/core/fm.py", line 202, in get_directory
    path = os.path.abspath(path)
  File "/usr/lib/python3.2/posixpath.py", line 369, in abspath
    if not isabs(path):
  File "/usr/lib/python3.2/posixpath.py", line 64, in isabs
    return s.startswith(sep)
AttributeError: 'Tab' object has no attribute 'startswith'

ranger crashed.  Please report this traceback at:
http://savannah.nongnu.org/bugs/?group= … nc=additem

Offline

#1422 2012-08-06 14:22:30

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

Re: Ranger, a textbased filemanager

Should be gone now.

There were some changes:
- Tabs now have their own history and cursor
- You can restore closed tabs with "uq"
- For developers: the use of the object "fm.env" is deprecated, read more: http://git.savannah.gnu.org/cgit/ranger … 5ee24c3d72


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#1423 2012-08-08 06:56:34

darkfeline
Member
Registered: 2012-02-14
Posts: 94

Re: Ranger, a textbased filemanager

hut wrote:

You'll need to use the program "setsid" for that, it ensures that the program will stay unharmed no matter how badly you torture the ranger.

If you run ranger 1.5.4 (stable):

1. run "ranger --copy-config=apps" to get the current apps.py config file.
2. add this to the class CustomApplications in your newly created ~/.config/ranger/apps.py:

	@depends_on('gimp', 'X')
	def app_gimp(self, c):
		return "setsid", "gimp", c

3. remove the 'gimp' entry at the very bottom of the file, in case it overrides your setting:

CustomApplications.generic(
[...]
	'eog', 'mirage', 'gimp',

(remove 'gimp' there.)

If you use ranger-git, this is already done by default. But the flag has been renamed from "d" (for detach) to "f" (for fork).

Uh, so is detach flag broken?  It seems like you're saying to manually make ranger fork session.  I took a quick look around the ranger files, and it seems like all 'd' flag does (in ranger.core.runner) is make ranger not wait for the opener to terminate (and some other things), and NOT actually fork a new session.  But I could be wrong.

EDIT: I'm using dwm and no DE.  Not sure if DEs have some app opening protocols that work with ranger 'd' flag that I'm missing?

Last edited by darkfeline (2012-08-08 07:10:06)

Offline

#1424 2012-08-08 10:45:20

domac
Member
Registered: 2012-08-06
Posts: 102

Re: Ranger, a textbased filemanager

Hey, I'm having trouble to cut/copy a file, even if I mark the file with <spacebar> or not…
I'm using <F6> to cut, move to dest directory and <F5> to paste… am I missing something?


domac [ git ]

Offline

#1425 2012-08-08 12:33:40

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

Re: Ranger, a textbased filemanager

domac wrote:

Hey, I'm having trouble to cut/copy a file, even if I mark the file with <spacebar> or not…
I'm using <F6> to cut, move to dest directory and <F5> to paste… am I missing something?

You'll find what you need if you search for the word "paste" in the man page.

darkfeline wrote:
hut wrote:

You'll need to use the program "setsid" for that, it ensures that the program will stay unharmed no matter how badly you torture the ranger.

If you run ranger 1.5.4 (stable):

1. run "ranger --copy-config=apps" to get the current apps.py config file.
2. add this to the class CustomApplications in your newly created ~/.config/ranger/apps.py:

	@depends_on('gimp', 'X')
	def app_gimp(self, c):
		return "setsid", "gimp", c

3. remove the 'gimp' entry at the very bottom of the file, in case it overrides your setting:

CustomApplications.generic(
[...]
	'eog', 'mirage', 'gimp',

(remove 'gimp' there.)

If you use ranger-git, this is already done by default. But the flag has been renamed from "d" (for detach) to "f" (for fork).

Uh, so is detach flag broken?  It seems like you're saying to manually make ranger fork session.  I took a quick look around the ranger files, and it seems like all 'd' flag does (in ranger.core.runner) is make ranger not wait for the opener to terminate (and some other things), and NOT actually fork a new session.  But I could be wrong.

EDIT: I'm using dwm and no DE.  Not sure if DEs have some app opening protocols that work with ranger 'd' flag that I'm missing?

Actually ranger implements its own file opening mechanism, simply because I need things like the "d" flag and no file opener I know of supports that. In ranger-git, this file opener was reduced to a 300sloc python script and can also be used externally.

The "d" flag is not broken, but if you use ranger-git, it was renamed to "f". (I thought using f for fork is more intuitive than d for detach.) The man page is outdated in this respect, but it's still in development.


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

Board footer

Powered by FluxBB