You are not logged in.

#676 2010-11-21 10:15:41

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

Re: Ranger, a textbased filemanager

Anyone experienced that "slowness" of Ranger after some time of use without restarting it? I use Ranger in a way that it's opened 24/7, for days, and by time it gets slow while accessing bookmarks, folders and sort of...The thing gets solved when I restart it (or X, which is more often).
Any thoughts on this?

Offline

#677 2010-11-21 10:36:03

golwin
Member
From: Germany, Aachen
Registered: 2009-03-12
Posts: 35

Re: Ranger, a textbased filemanager

Already had it running for weeks (with laptop suspended over night) and everything was fine.


arch64 | awesome | screen | ranger | vim | cmus | weechat | bitlbee

Offline

#678 2010-11-21 14:24:49

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

Re: Ranger, a textbased filemanager

archman-cro wrote:

Anyone experienced that "slowness" of Ranger after some time of use without restarting it? I use Ranger in a way that it's opened 24/7, for days, and by time it gets slow while accessing bookmarks, folders and sort of...The thing gets solved when I restart it (or X, which is more often).
Any thoughts on this?

Did you notice an increase of memory usage?


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

Offline

#679 2010-11-21 16:12:07

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

Re: Ranger, a textbased filemanager

hut wrote:
archman-cro wrote:

Anyone experienced that "slowness" of Ranger after some time of use without restarting it? I use Ranger in a way that it's opened 24/7, for days, and by time it gets slow while accessing bookmarks, folders and sort of...The thing gets solved when I restart it (or X, which is more often).
Any thoughts on this?

Did you notice an increase of memory usage?

I will be testing it. it's 0.9% now and it's performing nice.

Offline

#680 2010-11-21 20:50:06

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

Re: Ranger, a textbased filemanager

It is now at 1.2% memory usage and I start to feel the slower processing (when picking different bookmarks only, though).

Offline

#681 2010-11-21 23:58:15

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

Re: Ranger, a textbased filemanager

Can you please type in the following key sequence and see if it gets better?

oror otob zdzd zszs zhzh

without the spaces. This should clean up the hooks of garbage collected directories.

EDIT: or just update and restart ranger, I patched it.
Dunno if this was the primary cause for the slowdown though.

Last edited by hut (2010-11-22 01:41:31)


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

Offline

#682 2010-11-22 07:54:56

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

Re: Ranger, a textbased filemanager

Ok, I'll be testing the latest version. It definitely gets faster when I restart Ranger.

Offline

#683 2010-11-23 13:48:12

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: Ranger, a textbased filemanager

Hey,

Is there list of all keybinding contexts? I skimmed the pydoc docs, but couldn't find anything (I'm also not familiar with python, so there).

Also, some other things:

1. I'm using a non-QWERTZ keyboard layout (NEO) and need to redefine some keybindings and aliases (main issue: hjkl is now snrt). However, when I tried the open_with command, I couldn't type the snrt keys, because they worked like the arrow keys. This is my keys.py:

from ranger.api.keys import *

# Browser keybindings
map = keymanager.get_context('browser')
map('<C-D>', fm.move(down=0.5, pages=True))
map('<C-U>', fm.move(up=0.5, pages=True))
map('N', fm.history_go(-1))
map('R', fm.history_go(1))
map('t', fm.tag_toggle())
map('T', fm.tag_remove())
#map('S', fm.execute_command(os.environ['SHELL']))
map('.', fm.search())
map(',', fm.search(forward=False))
map('Y', fm.open_console('open_with '))

# Pager keybindings
map = keymanager.get_context('pager')
map('<left>', 's', wdg.move(left=4))
map('<right>', 't', wdg.move(right=4))

# Taskview keybindings
map = keymanager.get_context('taskview')
map('R', wdg.task_move(0))
map('N', wdg.task_move(-1))

# Global keybindings
map = KeyMapWithDirections()
map('n', alias='<down>')
map('r', alias='<up>')
map('s', alias='<left>')
map('t', alias='<right>')

keymanager.merge_all(map)

Redefining the keys in the browser instead of the global context makes them work, but I'm wondering if I'm missing something here—are those keys used in some other context I'm not (yet) aware of?

2. What is the proper way to define global bindings before contextual ones without messing up the config? Again, I'm not familiar with Python. Not at all. smile

3. Is there a way to delete default keybindings? (I'd like to delete the default hjkl aliases, for example).

Last edited by Runiq (2010-11-23 13:51:12)

Offline

#684 2010-11-23 16:52:22

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

Re: Ranger, a textbased filemanager

Runiq wrote:

Hey,

Is there list of all keybinding contexts? I skimmed the pydoc docs, but couldn't find anything (I'm also not familiar with python, so there).

Also, some other things:

1. I'm using a non-QWERTZ keyboard layout (NEO) and need to redefine some keybindings and aliases (main issue: hjkl is now snrt). However, when I tried the open_with command, I couldn't type the snrt keys, because they worked like the arrow keys. This is my keys.py:

from ranger.api.keys import *

# Browser keybindings
map = keymanager.get_context('browser')
map('<C-D>', fm.move(down=0.5, pages=True))
map('<C-U>', fm.move(up=0.5, pages=True))
map('N', fm.history_go(-1))
map('R', fm.history_go(1))
map('t', fm.tag_toggle())
map('T', fm.tag_remove())
#map('S', fm.execute_command(os.environ['SHELL']))
map('.', fm.search())
map(',', fm.search(forward=False))
map('Y', fm.open_console('open_with '))

# Pager keybindings
map = keymanager.get_context('pager')
map('<left>', 's', wdg.move(left=4))
map('<right>', 't', wdg.move(right=4))

# Taskview keybindings
map = keymanager.get_context('taskview')
map('R', wdg.task_move(0))
map('N', wdg.task_move(-1))

# Global keybindings
map = KeyMapWithDirections()
map('n', alias='<down>')
map('r', alias='<up>')
map('s', alias='<left>')
map('t', alias='<right>')

keymanager.merge_all(map)

Redefining the keys in the browser instead of the global context makes them work, but I'm wondering if I'm missing something here—are those keys used in some other context I'm not (yet) aware of?

2. What is the proper way to define global bindings before contextual ones without messing up the config? Again, I'm not familiar with Python. Not at all. smile

3. Is there a way to delete default keybindings? (I'd like to delete the default hjkl aliases, for example).


Hi,

1. The contexts are here:
http://nongnu.org/ranger/pydoc/ranger.c … nment.html
Easy to miss, they're at the very bottom

2. You just merge them in. If you don't want to merge in snrt into the console context, do this:

map = KeyMapWithDirections()
map('n', alias='<down>')
map('r', alias='<up>')
map('s', alias='<left>')
map('t', alias='<right>')

for context in ["browser", "pager", ...]:
    keymanager.get_context(context).directions.merge(map)

rather than merge_all
Not sure if this works but it should give you the idea.

Note that there's a difference between normal mappings and direction mappings. It even confuses myself, and I'm already working on a more simple interface for creating keybindings, similar to a .vimrc

3. There's unmap:

for context in ["browser", "pager", ...]:
   keymanager.get_context(context).unmap('x')
   keymanager.get_context(context).directions.unmap('j')

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

Offline

#685 2010-11-24 10:10:42

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: Ranger, a textbased filemanager

Ah, sorry, didn't see your answer yesterday. Thanks a lot, all problems solved, all questions answered.

Offline

#686 2010-11-24 20:33:48

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

Re: Ranger, a textbased filemanager

@hut: Seems like the update solved my problem. Thank you, doctor!

Offline

#687 2010-12-08 12:48:13

Revelation60
Member
From: The Netherlands
Registered: 2009-03-19
Posts: 158
Website

Re: Ranger, a textbased filemanager

Hi, I have a couple of questions. I want to be able to do the following things:

- Spawn a new terminal at the cwd
- Run a command in such a way that I can see the output, but that I can continue doing other stuff in ranger. For example, if I run unrar on a very large file, I want to be able to see the progress but it in the meanwhile continue with ranger. I tried using the pager, but I didn't find a way of hiding and showing the pager at will.

- A while ago I asked about the incremental search. It is working ok, but when I have found the file and press enter to leave the search, ranger jumps to the next item. I have to press escape instead of enter to kill the search prompt. How can I make enter do the same?

Thanks!

Offline

#688 2010-12-09 10:57:39

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

Re: Ranger, a textbased filemanager

1. the command :terminal runs the program x-terminal-emulator, link this to your favourite terminal emulator or edit the command.
You can also type @urxvt<enter> or something.
2. Better open a new terminal for this. I may implement it in the future though.
3. This sounds ilke a bug


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

Offline

#689 2010-12-09 14:40:16

Revelation60
Member
From: The Netherlands
Registered: 2009-03-19
Posts: 158
Website

Re: Ranger, a textbased filemanager

Ok, thanks! I have another quick question tongue A while ago I asked for a delete function that deletes things right away. This was the answer:

map(383, fm.open_console('delete y'))

This works, but I still need to press enter. How can I make this command get executed right away?

Offline

#690 2010-12-09 15:15:41

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

Re: Ranger, a textbased filemanager

use execute_console instead of open_console smile
you can also try this one:
map(383, fm.execute_console("shell -d rm %s"))
this runs "rm" on all selected files in the background and doesn't block the terminal if you delete a lot at once


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

Offline

#691 2010-12-09 16:12:23

nXqd
Member
Registered: 2010-07-01
Posts: 173

Re: Ranger, a textbased filemanager

Very nice and interesting, I use this one as my main fm instead of vifm smile


When you live for a strong purpose, then hard work isn't an option. It's a necessity. - Steve Pavlina
dotFiles

Offline

#692 2010-12-09 17:26:44

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

Re: Ranger, a textbased filemanager

Any way I can recover deleted files with a ":delete" command? I've tried using lsof, but it doesn't see it... sad

Offline

#693 2010-12-09 21:02:05

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

Re: Ranger, a textbased filemanager


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

Offline

#694 2010-12-10 12:03:48

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

Re: Ranger, a textbased filemanager

Ok, nvm, since I found that the file I accidentally deleted (a "conkeror.install" file that's needed in my custom conkeror package) wasn't actually needed at all. big_smile

Offline

#695 2010-12-10 14:39:41

Revelation60
Member
From: The Netherlands
Registered: 2009-03-19
Posts: 158
Website

Re: Ranger, a textbased filemanager

map(383, fm.execute_console("shell -d rm %s"))

This doesn't seem to work. sad fm.execute('delete y') does work, however.

- A while ago I asked about the incremental search. It is working ok, but when I have found the file and press enter to leave the search, ranger jumps to the next item. I have to press escape instead of enter to kill the search prompt. How can I make enter do the same?
-----
3. This sounds ilke a bug

If you could fix this, that would be great!

Offline

#696 2010-12-10 17:55:34

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

Re: Ranger, a textbased filemanager

Revelation60 wrote:

- A while ago I asked about the incremental search. It is working ok, but when I have found the file and press enter to leave the search, ranger jumps to the next item. I have to press escape instead of enter to kill the search prompt. How can I make enter do the same?
-----
3. This sounds ilke a bug

If you could fix this, that would be great!

I remembered that this incremental search was a custom thing. Can you give me the code of the command or tell me the changes you made?

Also, when you say it "jumps to the next item", do you mean it goes down or right?


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

Offline

#697 2010-12-10 18:27:09

Revelation60
Member
From: The Netherlands
Registered: 2009-03-19
Posts: 158
Website

Re: Ranger, a textbased filemanager

The code is:

class inc_search(search):
  def quick(self):
    if self.line.split(" ", 2)[1]:
      search.execute(self)

When I say jump to the next item, I mean a jump to the next item that fits the search query.

Offline

#698 2010-12-11 12:30:49

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

Re: Ranger, a textbased filemanager

Hi hut,

I switched to ranger recently. Now I'm using "ranger-git". Basically, it works fine, but after I edited a file and back to ranger, it seems get no reflect about the modified file. does ranger have the ability to track file modification?

thanks.
(edit typo)

Last edited by cap_sensitive (2010-12-11 12:32:59)

Offline

#699 2010-12-11 21:26:48

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

Re: Ranger, a textbased filemanager

Revelation60 wrote:

The code is:

class inc_search(search):
  def quick(self):
    if self.line.split(" ", 2)[1]:
      search.execute(self)

When I say jump to the next item, I mean a jump to the next item that fits the search query.

It's no bug after all. It's a flaw in the command. Since inc_search is a subclass of the search command, which does a search when you press enter, this command will also do a search when you press enter.
Try this one:

class inc_search(Command):
    def quick(self):
        split = self.line.split(" ", 2)
        if len(split) > 1 and split[1]:
            self.fm.search_file(split[1], regexp=True)

It also avoids that "list index out of range" error message, perhaps you've noticed it

Here's an alternative; it doesn't jump to the next matching file if the current file is still matching:

class inc_search(Command):
    def quick(self):
        import re
        split = self.line.split(" ", 2)
        if len(split) > 1 and split[1] and not re.match(split[1], self.fm.env.cf.basename):
            self.fm.search_file(split[1], regexp=True)
cap_sensitive wrote:

Hi hut,

I switched to ranger recently. Now I'm using "ranger-git". Basically, it works fine, but after I edited a file and back to ranger, it seems get no reflect about the modified file. does ranger have the ability to track file modification?

thanks.
(edit typo)

New versions of ranger never update previews, unless you press <Ctrl-R> or (under certain conditions) resize the window.
This will be fixed at some point... perhaps now.
Edit: done

Last edited by hut (2010-12-11 21:39:25)


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

Offline

#700 2010-12-12 10:44:27

Revelation60
Member
From: The Netherlands
Registered: 2009-03-19
Posts: 158
Website

Re: Ranger, a textbased filemanager

Thanks hut, it's working now smile Wouldn't this be a nice feature to add by default? I think it is one of the quickest ways to navigate through large directories.

Offline

Board footer

Powered by FluxBB