You are not logged in.

#1501 2012-10-23 19:50:53

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

Re: Ranger, a textbased filemanager

Pranavg1890 wrote:

lfm didn't crash on my system. It was pretty stable and opened ( and opens) several compressed files for me without error.

I got it to crash under one circumstance. The file could have just been bad, but it should have caught that error.

Pranavg1890 wrote:

I believe this is the only option missing in ranger, otherwise it's complete in all aspects.

Fair enough....

Pranavg1890 wrote:

Atleast an option should be given to enable or disable this functionality, so that who want to use it will use it and those who don't want it, they disable it.

I never said I disliked the idea. All I said was that it will take a lot of effort, and no-one's stepped up to help Hut with it.

My aside about lfm's implementation was just that - an aside comment meant to be taken humorously (but with a kernel of point). I have a feeling you took it to mean I don't want the functionality - I do want the functionality, I just don't want to put the effort in (yet; there's always next year :-P).

Pranavg1890 wrote:

I only want to see this option added to ranger otherwise it covers all the functionality needed by me. And, also, i think, many would welcome this functionality if I'm not wrong.

On the basis that others have asked, you are not wrong. I don't use archives that much, though, so it wouldn't be that big of a deal to me.

Offline

#1502 2012-10-25 16:05:15

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

Re: Ranger, a textbased filemanager

Hi,

Just something I ran into, it gets annoying sometimes.  When you yy and pp a directory in its parent directory, it copies itself into itself instead of renaming itself.  Sorry, it's hard to explain in words.

With the example setup

/test/hi

if you are in

/

and you yy

/test

and pp into

/

you end up with

/test/hi
/test/test/hi

instead of

/test/hi
/test.~1~/hi

Is this intended behavior?  It runs contrary to pasting files and is somewhat counterintuitive.

Offline

#1503 2012-10-27 19:38:44

hituni
Member
Registered: 2012-10-27
Posts: 2

Re: Ranger, a textbased filemanager

loop wrote:

Hello!
I rename some files with the "rrname" command from my commands.py:

class rrname(Command):
	def execute(self):
		filenames = [f.basename for f in self.fm.thistab.get_selection()]
		for f in filenames:
			new_name = '-' + f
			self.fm.rename(f, new_name)

		# attempt to do something with renamed files
                self.fm.reload_cwd()
		with open('out', 'w') as log:
			cwd = self.fm.thisdir
			for fileobj in cwd.files:
				filename = fileobj.basename
				log.write(str(filename))

[...]

Thank you as well for this awesome and informative reply! Another question concerning this: Would it be possible to draw small borders between the different file type groups? I'm thinking of something similar to Windows' 'group by file type' option which separates the individual groups by showing small borders: Screenshot (Image found via Google, source is here, I don't own a copy of Windows to reproduce this, sorry.)

Offline

#1504 2012-10-29 17:04:50

PotatoesMaster
Member
From: France
Registered: 2010-08-26
Posts: 54

Re: Ranger, a textbased filemanager

Hi there!

I recently discovered slmenu, a dmenu clone for the console.
I wanted to use it in ranger, in this function I added to my options.py:

class locate(Command):
	"""
	:locate <name_part>

	Search in current directory and subdirs for a file whose name contains the
	given string (case insensitive) and prompt for the one to select in ranger
	using slmenu (press escape 2 times to cancel).
	"""
	def execute(self):
		import subprocess
		from ranger.core.loader import safeDecode
		import sys
		import os.path

		if self.rest(1):
			command = 'find . -iname ' + shell_quote('*' + self.rest(1) + '*') + \
					'| slmenu -t -i -l $(($(tput lines)-1)) -p locate '
			self.fm.ui.suspend()
			try:
				p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
				filename = p.communicate()[0]
			finally:
				self.fm.ui.initialize()
			if p.poll() == 0: # no error returned
				if sys.version >= '3':
					filename = safeDecode(filename)
				# remove the newline
				filename = filename.rstrip('\n')
				# make the path absolute
				filename = os.path.join(self.fm.thisdir.path, filename.lstrip('./'))
				# select the file
				self.fm.select_file(filename)
		else:
			self.fm.notify('usage: locate <name_part>', bad=True)

There is the problem: the line self.fm.select_file(filename) changes the working directory but does not select the file.
Is there something I missed?

Edit: fm.select_file() works better with an absolute path. smile
Code above is fixed.

Last edited by PotatoesMaster (2012-10-30 11:08:41)

Offline

#1505 2012-11-04 19:06:43

ccc1
Member
Registered: 2009-04-16
Posts: 111

Re: Ranger, a textbased filemanager

Hi,

just a quick question:
i use btrfs and copying a file in ranger doesn't use copy-on-write, i.e. the file is just copied and therefore wasting space.
In the terminal, i use the alias 'alias cp="cp --reflink=auto"' in my bashrc to enable copy-on-write.
How can i configure ranger to use the cp option "--reflink=auto"?  I could modify actions.py. But the problem with this solution is that i'll have to modify actions.py everytime ranger is updated.

ccc1

Offline

#1506 2012-11-05 00:00:49

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

Re: Ranger, a textbased filemanager

ccc1 wrote:

Hi,

just a quick question:
i use btrfs and copying a file in ranger doesn't use copy-on-write, i.e. the file is just copied and therefore wasting space.
In the terminal, i use the alias 'alias cp="cp --reflink=auto"' in my bashrc to enable copy-on-write.
How can i configure ranger to use the cp option "--reflink=auto"?  I could modify actions.py. But the problem with this solution is that i'll have to modify actions.py everytime ranger is updated.

The problem here is that Ranger moved to an internal copy system in order to have progress bar support. This would only work if we actually copied. The only option is to make your own command to use the built-in cp.

Fortunately it should be as simple as map pp shell cp --reflink=auto -- %c in your rc.conf [COMPLETELY UNTESTED].

However, you lose a lot of the benefits that the new (and previous implementations) have, so you'd likely want something more complex.

Offline

#1507 2012-11-05 08:22:03

ccc1
Member
Registered: 2009-04-16
Posts: 111

Re: Ranger, a textbased filemanager

Ok, i see. Then i'll just use the command line if i want to copy a file with copy-on-write. Isn't such a big deal.

ccc1

Offline

#1508 2012-11-12 18:19:03

loop
Member
Registered: 2011-05-06
Posts: 58

Re: Ranger, a textbased filemanager

Hello!

First of all, thank you, @hut, for cm/ca key fix, in works perfect.
Also I have to confess, some new "features" drove me here again. Hope my report will help you to make ranger even more better.

1. Strange behaviour of %S:
Conditions:

Have files:
    /tmp/testdir/testfile1
    /tmp/testfile2

Do:
    1. :cd /tmp/testdir/
    2. :tab_new %d
    3. <tab> to get the previous tab back
    4. <h> to uplevel
    5. some <j> of <k> to stay on testfile2
    6. <tab> to switch tabs again
    7. :shell -w echo %S
            got /tmp/testdir/ instead of /tmp/testfile2

2. Not sure if bug, but just in case:
If I do
    :tab_new %%d

ranger crashes:

ranger version: 1.5.5, executed with python 2.7.3rc2
Locale: en_US.UTF-8
Current file: None
Traceback (most recent call last):
  File "/home/loop/.ranger/ranger/core/main.py", line 130, in main
    fm.loop()
  File "/home/loop/.ranger/ranger/core/fm.py", line 263, in loop
    ui.redraw()
  File "/home/loop/.ranger/ranger/gui/ui.py", line 248, in redraw
    self.draw()
  File "/home/loop/.ranger/ranger/gui/ui.py", line 274, in draw
    DisplayableContainer.draw(self)
  File "/home/loop/.ranger/ranger/gui/displayable.py", line 254, in draw
    displayable.draw()
  File "/home/loop/.ranger/ranger/gui/widgets/titlebar.py", line 39, in draw
    self._calc_bar()
  File "/home/loop/.ranger/ranger/gui/widgets/titlebar.py", line 84, in _calc_bar
    self._get_left_part(bar)
  File "/home/loop/.ranger/ranger/gui/widgets/titlebar.py", line 106, in _get_left_part
    self.fm.thisdir.path.startswith(self.fm.home_path):
AttributeError: 'NoneType' object has no attribute 'path'

Offline

#1509 2012-11-24 14:23:46

CREED0R
Member
Registered: 2012-11-24
Posts: 16

Re: Ranger, a textbased filemanager

Hi,
I'm relatively new to textbased file managers but have tested some of them over the last couple of days and I really really like ranger.
Unfortunately (and I know that's contrary to the whole idea) I don't really like editing my code files with vim.

How can I customize ranger to use a different (non terminal based) editor for editing files so that it open's them in a new window?

-CREED0R



@Edit:
Never mind, I figured it out. In 'apps.py' I changed

return self.either(c, 'vim', 'emacs', 'nano')

to

return self.either(c, 'sublime', 'vim', 'emacs', 'nano')

Great FM! smile

Last edited by CREED0R (2012-11-24 14:28:57)

Offline

#1510 2012-11-24 15:11:09

loop
Member
Registered: 2011-05-06
Posts: 58

Re: Ranger, a textbased filemanager

@CREED0R
Also you can use ~/.config/ranger/rifle.conf for filetype associations (development version of ranger).

Last edited by loop (2012-11-24 19:26:00)

Offline

#1511 2012-11-27 09:00:48

ryzion
Member
Registered: 2012-03-20
Posts: 95

Re: Ranger, a textbased filemanager

I'm having trouble cutting(dd) and pasting(pp) large files (>800MB) to a mounted network share. 5-10 % of the file is stored to the new location, the old file still exists after op. any ideas? any information I can provide?

Offline

#1512 2012-11-27 09:55:37

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 455

Re: Ranger, a textbased filemanager

When the option draw_borders is set to True and option padding_right to False, two vertical lines are used to separate columns:
tZ2d2bg

draw_borders = True
padding_right = False

Is it a bug?

Offline

#1513 2012-11-27 10:41:29

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

Re: Ranger, a textbased filemanager

^ Bug or not, it looks cool tongue


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

#1514 2012-11-28 21:48:56

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

Re: Ranger, a textbased filemanager

[marquee][blink]NOTE[/blink][/marquee]: the chances for a quick reply (from me) are higher if you use the "official channels", which are the mailing list ( https://lists.nongnu.org/mailman/listinfo/ranger-users ) and the bug tracker ( http://savannah.nongnu.org/bugs/?group=ranger ).


OK100 wrote:

When the option draw_borders is set to True and option padding_right to False, two vertical lines are used to separate columns:
http://ompldr.org/tZ2d2bg

draw_borders = True
padding_right = False

Is it a bug?

I guess "draw_borders = True" is really only supported with "collapse_preview = False". It looks broken for me if I don't turn off the latter option. (ranger-1.5.5-master). I'll fix it at some point.

ryzion wrote:

I'm having trouble cutting(dd) and pasting(pp) large files (>800MB) to a mounted network share. 5-10 % of the file is stored to the new location, the old file still exists after op. any ideas? any information I can provide?

Does it happen every time? Maybe you stop the transfer with ctrl+C? Does it work with "!cp %c ." (while you are in the target directory in ranger)?


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

Offline

#1515 2012-11-29 07:53:02

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Ranger, a textbased filemanager

Notwithstanding the above message, just a simple question, any way to have completion of shell commands? It seems it SHOULD be supported but the only completions I get are file names, not other shell completion (for example the options for netcfg etc.).


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#1516 2012-11-29 16:18:31

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

Re: Ranger, a textbased filemanager

ngoonee wrote:

Notwithstanding the above message, just a simple question, any way to have completion of shell commands? It seems it SHOULD be supported but the only completions I get are file names, not other shell completion (for example the options for netcfg etc.).

There's no bash (or any other shell) embedded in ranger, so it would have to parse the completion files and make sense of them somehow. The place to put this code in would be the function "tab" of the class "shell" in ~/.config/ranger/commands.py but I wouldn't know what to write since i have no experience with autocompleting options of programs in the shell.


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

Offline

#1517 2012-11-29 22:16:47

antywey
Member
Registered: 2012-11-29
Posts: 2

Re: Ranger, a textbased filemanager

Hello,

I'm trying to open all text file (wich are open with VIM) in another terminal (to keep Ranger open and usable).
For that, I tried to change in apps.py the method app_editor() by adding just before the return line : c += 'td'.

That don't work (as you can guess...), and I don't understand why. Someone can help me?

Thank you in advance,

Denis

Offline

#1518 2012-11-30 00:24:03

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Ranger, a textbased filemanager

hut wrote:
ngoonee wrote:

Notwithstanding the above message, just a simple question, any way to have completion of shell commands? It seems it SHOULD be supported but the only completions I get are file names, not other shell completion (for example the options for netcfg etc.).

There's no bash (or any other shell) embedded in ranger, so it would have to parse the completion files and make sense of them somehow. The place to put this code in would be the function "tab" of the class "shell" in ~/.config/ranger/commands.py but I wouldn't know what to write since i have no experience with autocompleting options of programs in the shell.

Thanks, I guess I'll just keep the shell open elsewhere then. Which makes me think of a feature request, would here be better or the bug tracker?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#1519 2012-11-30 09:40:13

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

Re: Ranger, a textbased filemanager

antywey wrote:

Hello,

I'm trying to open all text file (wich are open with VIM) in another terminal (to keep Ranger open and usable).
For that, I tried to change in apps.py the method app_editor() by adding just before the return line : c += 'td'.

That don't work (as you can guess...), and I don't understand why. Someone can help me?

Thank you in advance,

Denis

Denis, maybe you need to use rifle.conf file instead apps.py

Create the default one:

ranger --copy-config

edit

vim ~/.config/ranger/rifle.conf

find the "text file" part (line 27?)

# Define the "editor" for text files as first action
...

The first command line is the default one.
The other line appear in the menu (when you press "l" for this file type) if conditions are true.

So you can modify the first one to add a flag ft

mime ^text,      label editor, flag ft = "$EDITOR" -- "$@"

Offline

#1520 2012-11-30 10:10:13

antywey
Member
Registered: 2012-11-29
Posts: 2

Re: Ranger, a textbased filemanager

Thanks!

I finally achieve my goal by chaging in rifle.conf the mime line :
mime ^text,  label editor, flag f = xterm -e vim "$@"

Offline

#1521 2012-11-30 18:58:25

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

Re: Ranger, a textbased filemanager

ngoonee wrote:
hut wrote:
ngoonee wrote:

Notwithstanding the above message, just a simple question, any way to have completion of shell commands? It seems it SHOULD be supported but the only completions I get are file names, not other shell completion (for example the options for netcfg etc.).

There's no bash (or any other shell) embedded in ranger, so it would have to parse the completion files and make sense of them somehow. The place to put this code in would be the function "tab" of the class "shell" in ~/.config/ranger/commands.py but I wouldn't know what to write since i have no experience with autocompleting options of programs in the shell.

Thanks, I guess I'll just keep the shell open elsewhere then. Which makes me think of a feature request, would here be better or the bug tracker?

Go ahead and abuse the bug tracker as feature request tracker wink


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

Offline

#1522 2012-12-03 12:36:06

ryzion
Member
Registered: 2012-03-20
Posts: 95

Re: Ranger, a textbased filemanager

hut wrote:

[marquee]

I guess "draw_borders = True" is really only supported with "collapse_preview = False". It looks broken for me if I don't turn off the latter option. (ranger-1.5.5-master). I'll fix it at some point.

ryzion wrote:

I'm having trouble cutting(dd) and pasting(pp) large files (>800MB) to a mounted network share. 5-10 % of the file is stored to the new location, the old file still exists after op. any ideas? any information I can provide?

Does it happen every time? Maybe you stop the transfer with ctrl+C? Does it work with "!cp %c ." (while you are in the target directory in ranger)?


The error seemed to occur due to false permissions. The target directory was ro ... still don't understand why ranger copied the first 10%....

Something completely different: Is it possible to yank a selection in multiple directories? eg: file "foo" in home and file "bar" in /home/dir?(booth files are selected via <space>

Offline

#1523 2012-12-03 13:43:37

loop
Member
Registered: 2011-05-06
Posts: 58

Re: Ranger, a textbased filemanager

ryzion wrote:

Something completely different: Is it possible to yank a selection in multiple directories? eg: file "foo" in home and file "bar" in /home/dir?(booth files are selected via <space>

Yes it is possible with 'ya' hotkey (yank add). Same way you can use 'da' to add files for mooving. wink

Offline

#1524 2012-12-03 19:17:13

cap_sensitive
Member
Registered: 2010-04-05
Posts: 35

Re: Ranger, a textbased filemanager

Hi,

Ranger seems unable to sort 'week10' after 'week9' (both of them are directories). I've tried

toggle_option sort_directories_first

Offline

#1525 2012-12-03 19:33:00

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

Re: Ranger, a textbased filemanager

cap_sensitive wrote:

Hi,

Ranger seems unable to sort 'week10' after 'week9' (both of them are directories). I've tried

toggle_option sort_directories_first

make sure that this is in your options.py (it's there by default in recent versions):

sort = "natural"

"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