You are not logged in.

#576 2010-10-17 09:42:36

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: Ranger, a textbased filemanager

hut wrote:

I think that was fixed a while ago, try upgrading.

Yep, works now.

hut wrote:

In IRC you asked me if you can use UTF chars for input and I couldn't answer.
Apparently that works only with python2.6, and you gotta add this line at the top of your keys.py if it's not already there:

# -*- coding: utf-8 -*-

If you wanna install ranger with python2.6, edit the PKGBUILD, it gives you some hints.

Thanks! smile

Offline

#577 2010-10-18 21:43:10

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Ranger, a textbased filemanager

I found something strange! I have a simple text file in the following folder: /home/army/Uni/WS10/Fachdidaktik Physik The file is called chef and contains an email adress. File shows me

% file chef
chef: ASCII text

But ranger doesn't preview the text file. When I rename it to something else, e.g. boss or whatever, ranger previews the file.

I don't understand why ranger makes a difference between the same file with different file names.

Offline

#578 2010-10-18 21:55:40

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

Re: Ranger, a textbased filemanager

Army wrote:

I found something strange! I have a simple text file in the following folder: /home/army/Uni/WS10/Fachdidaktik Physik The file is called chef and contains an email adress. File shows me

% file chef
chef: ASCII text

But ranger doesn't preview the text file. When I rename it to something else, e.g. boss or whatever, ranger previews the file.

I don't understand why ranger makes a difference between the same file with different file names.

Have you tried turning it off and on again?
EDIT: I thought the problem is that ranger doesn't update its cache. but I just tried it out and it works (for me). So, I don't really know.

Last edited by hut (2010-10-18 22:15:10)


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

Offline

#579 2010-10-19 08:30:17

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Ranger, a textbased filemanager

I restarted ranger, that didn't help. But after a complete system reboot everything's fine again... Seems like that was just one of these things which happen from time to time... It happens for me about once a year, that when I boot my laptop, nothing seems to work. Then after a reboot everything's fine.

Offline

#580 2010-10-19 13:43:13

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

Re: Ranger, a textbased filemanager

Btw. Army, can you try out tiv again? I recently made changes to ansi.py that might have fixed tiv but I got no 256-color terminal to test it.


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

Offline

#581 2010-10-19 14:17:32

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Ranger, a textbased filemanager

Ah nice! I tried it, but it doesn't work. The normal preview shows nothing at all and when I press F3 I see parts of ansi codes blinking in the terminal.

Could it be that img2txt now produces better previews? I did an update of ranger a few days ago and didn't take a look at the changes, but it seemed to me like those previews look better (more details, better fitting colors). I really like it!

Offline

#582 2010-10-19 14:26:54

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

Re: Ranger, a textbased filemanager

Yeah smile. I doubled the number of background colors.
Or to be honest, I fixed a ranger bug that halved the number of background colors.


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

Offline

#583 2010-10-21 04:33:23

bsdson.tw
Member
From: Taiwan
Registered: 2005-05-06
Posts: 161

Re: Ranger, a textbased filemanager

hi, hut,

After recent upgrade (about python), I can not run ranger anymore.
the error message is:

[~:henry 12:30]$ ranger
Traceback (most recent call last):
  File "/usr/bin/ranger", line 50, in <module>
    import ranger
ImportError: No module named ranger

How can I fix this?

thanks for your help and great works.
BR,
Henry

Offline

#584 2010-10-21 04:58:17

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

Re: Ranger, a textbased filemanager

You can fix this by reinstalling ranger


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

Offline

#585 2010-10-21 19:35:14

zeltak
Member
From: New England
Registered: 2010-08-07
Posts: 168

Re: Ranger, a textbased filemanager

Hi Hut

short stupid Question: is it possible to yank (copy) the path to the clipboard?

thx

zeltak

Last edited by zeltak (2010-10-21 19:35:41)

Offline

#586 2010-10-21 19:45:49

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

Re: Ranger, a textbased filemanager

The path of the file at the cursor? Try this key binding:

map('yp', fm.execute_console('echo %d/%f | xclip -i')

I hope you can figure out how to edit keybindings by yourself. If not, ask again


EDIT:
Sorry that should've been:

map('yp', fm.execute_console('shell echo %d/%f | xclip -i')

And obviously you will need the program "xclip" for that.

EDIT2:
Yes, of course, add another ) at the end.

map('yp', fm.execute_console('shell echo %d/%f | xclip -i'))

Last edited by hut (2010-10-21 21:23:11)


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

Offline

#587 2010-10-21 19:53:15

zeltak
Member
From: New England
Registered: 2010-08-07
Posts: 168

Re: Ranger, a textbased filemanager

thx

ill try that when i get home.

zeltak

Offline

#588 2010-10-21 21:13:47

zeltak
Member
From: New England
Registered: 2010-08-07
Posts: 168

Re: Ranger, a textbased filemanager

Edit:

in the above code it ended with one ) looking at the other examples i saw they ended with )) . added it and ranger starts..but it dosent seem to be copying the path to the clipboard

thx

zeltah




Hi again

putting this line in the keys.py wont let ranger start:

map('yp', fm.execute_console('shell echo %d/%f | xclip -i')

what am i doing wrong (see erroe below)?

Traceback (most recent call last):
  File "/usr/lib/python3.1/site-packages/ranger/core/main.py", line 74, in main
    load_settings(fm, arg.clean)
  File "/usr/lib/python3.1/site-packages/ranger/core/helper.py", line 109, in load_settings
    import keys
  File "/home/zeltak/.config/ranger/keys.py", line 408
   
   ^
SyntaxError: invalid syntax

Last edited by zeltak (2010-10-21 21:20:06)

Offline

#589 2010-10-21 21:24:54

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

Re: Ranger, a textbased filemanager

1. You were right about the ).
2. You put the map(...) at the wrong place. Look for the "browser" context.


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

Offline

#590 2010-10-21 22:25:26

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: Ranger, a textbased filemanager

Here's my .config/ranger/keys.py with the above 'yp' binding to yank the current path (modified to suppress the line feed and to use xsel):

from ranger.api.keys import *
map = keymanager.get_context('browser')
# map 'yp' to yank the current filename path to the clipboard
map('yp', fm.execute_console('shell echo -n %d/%f | xsel -i'))

Scott

Offline

#591 2010-10-21 22:35:04

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

Re: Ranger, a textbased filemanager

Maybe use "shell -d echo -n ..." to avoid the short flicker


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

Offline

#592 2010-10-21 23:37:24

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: Ranger, a textbased filemanager

hut wrote:

Maybe use "shell -d echo -n ..." to avoid the short flicker

ooo..nice!  tongue

Scott

Offline

#593 2010-10-21 23:50:42

zeltak
Member
From: New England
Registered: 2010-08-07
Posts: 168

Re: Ranger, a textbased filemanager

thx hut and scott

works like a charm smile man ranger dosent stop to amaze me of its endless possibilities..

IMHO should be part of base ranger but its pretty easy to add smile

I also added 2 more option in case any one is interested, here is my config


# map 'yp' to yank the current filename path to the clipboard

#copy full path of current dir
map('yp', fm.execute_console('shell -d echo -n %d | xsel -i'))
#copy only file name
map('yn', fm.execute_console('shell -d echo -n %s | xsel -i'))
#copy filename and full path
map('yf', fm.execute_console('shell -d echo -n %d/%f | xsel -i'))



thx again

Zeltak

Last edited by zeltak (2010-10-22 00:06:16)

Offline

#594 2010-10-22 08:21:55

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Ranger, a textbased filemanager

Good job guys!! Hut, I also recommend to include these commands by default, they are VERY handy!

Offline

#595 2010-10-22 20:16:37

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

Re: Ranger, a textbased filemanager

Any words on stability of ranger-git? And the yy/pp mechanism in particular?

include these commands by default

Yeah I can do that.

map('yn', fm.execute_console('shell -d echo -n %s | xsel -i'))

I dunno if you deliberately used %s here but let me warn you that %s represents all selected files, not necessarily the one below the cursor.


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

Offline

#596 2010-10-23 18:57:45

zeltak
Member
From: New England
Registered: 2010-08-07
Posts: 168

Re: Ranger, a textbased filemanager

Hi hut and the rest of the gang

I would love to get suggestions on what people that are using ranger do with archives. I find its really the only missing thing i keep bumping into using ranger. Is there any chance VFS (like in MC, krusader etc..) will be implemented in the future? will there be perhaps a native command to unpack here or unpack to a specific dir?  if VFS will be implemented  i could just use y and p to copy and paste from archives i guess. are there alternative solution? would love to hear how you guys deal with archives

thx in advance

Zeltak

Last edited by zeltak (2010-10-23 19:00:32)

Offline

#597 2010-10-23 19:09:02

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

Re: Ranger, a textbased filemanager

I'm using the default "atool" for displaying and extracting archive content, and thats basically all I need.
For creating archives, there's @apack file.tar.gz

virtual file systems are planned but it's low priority atm.


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

Offline

#598 2010-10-23 20:44:12

sefsinalas
Member
From: Salta - Argentina
Registered: 2010-06-13
Posts: 14
Website

Re: Ranger, a textbased filemanager

there is some cheat sheet for ranger?
I have compiled a few:

/ Used to search
f Quick navigation entering only a part of the file
gg moved to the top
G moves to the end
S open a console in the current directory
y copy what SELECTED
dd cut the selected
pp paste the selected
mX create a bookmark with the name X
'X moves the marker X
m marker opens a popup
Spacebar mark a file
gn open a new tab
gN tab moves N
TAB moves between tabs
:delete Delete a file
:rename Rename a file
Ctrl + H to view hidden files
w see ongoing operations
r opens the file with an application to choose

source: http://paraisolinux.com/administrador-d … la-ranger/

there is any easiest way to delete files than :delete?

Offline

#599 2010-10-23 21:18:53

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

Re: Ranger, a textbased filemanager

You can type :d<tab>
Or maybe <F8>y
Because :delete is dangerous, there is no shorter command

Also, "cw" is faster than ":rename"


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

Offline

#600 2010-10-23 21:40:41

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Ranger, a textbased filemanager

sefsinalas wrote:

y copy what SELECTED

Actually it's yy (was a typo, right?)

Offline

Board footer

Powered by FluxBB