You are not logged in.
nono...the "Del" key. The normal key to delete files in X11
First put this in your ~/.config/ranger/keys:
from ranger.api.keys import *
map = keymanager.get_context('browser')
Then you can map <DELETE> to some command. Like:
map('<DELETE>', fm.open_console('delete seriously? '))
This will delete anything instantly without confirmation:
map('<DELETE>', fm.execute_console('delete y'))
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
I really like ranger! The only thing I am missing (or overlooking ?) is an incremental search function. I want to be able to type the name of a file or folder and ranger to go there instead of using the arrows to get to it.
Offline
Hit / and then type part of the filename and hit Enter. Works for anything in the current directory That's what you're looking for I hope!
Scott
I really like ranger! The only thing I am missing (or overlooking ?) is an incremental search function. I want to be able to type the name of a file or folder and ranger to go there instead of using the arrows to get to it.
Offline
Hit / and then type part of the filename and hit Enter. Works for anything in the current directory That's what you're looking for I hope!
Scott
Revelation60 wrote:I really like ranger! The only thing I am missing (or overlooking ?) is an incremental search function. I want to be able to type the name of a file or folder and ranger to go there instead of using the arrows to get to it.
I've been wanting the same thing, this will do nicely.
Offline
Also try "f" :-D
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
I was looking for something in between the two With / I have to press enter and thus it is not an incremental search. With f it does do an incremental search but it automatically starts a file when it has resolved which one I want. I just want the cursor to go there.
Offline
No key for that.
Here's how to add one:
~/.config/ranger/commands.py:
from ranger.api.commands import *
from ranger.defaults.commands import search
class inc_search(search):
def quick(self):
if self.line.split(" ", 2)[1]:
search.execute(self)
keys.py:
from ranger.api.keys import *
map = keymanager.get_context('browser')
map('x', fm.open_console('inc_search '))
Last edited by hut (2010-10-31 12:01:47)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
I can't get it to work If I press x it just goes to the next item. You do mean .config/ranger/keys.py, right?
Offline
Oh, sorry, use open_console instead of execute_console.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Thanks! It is working now
I have another question, if you don't mind. What can I do to fix this:
map('<SHIFT><DELETE>', fm.open_console('delete y'))
Offline
Not all keys have a representation in ranger. Just use the key code defined by ncurses. You can find out the codes with the little app in ranger/doc/print_keys.py.
The code for shift+delete is 383, so write:
map(383, ...)
Last edited by hut (2010-10-31 12:23:36)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Thanks! The map is working. It doens't delete the file right away however, you still have to press enter. Can this be changed?
I was also wondering if ranger would implement a real filesystem search like the find command.
Offline
Thanks! The map is working. It doens't delete the file right away however, you still have to press enter. Can this be changed?
I was also wondering if ranger would implement a real filesystem search like the find command.
That's implemented already, type:
#find
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
It doesn't work the way I'd expect it to. I take it you mean with #find :shell -p find.
If you want to find a file in a subdirectory, you have to make a weird regex. For example: say in a subdirectory called foo a file is called bar.txt.
#find bar.txt will not find anything. This is probably because the file gets listed as foo/bar.txt. If you search for that, you'll find it.
But of course, you don't know where the file is. So that's not very helpful
Offline
"#command" is expanded to ":shell -p command", which runs the command and pipes the output to "less". So you can do everything you could do in the shell.
For example, I got this mapping:
map('F', fm.open_console('shell -p find . | grep '))
I can type "Fbar.txt<enter>" to find foo/bar.txt.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
there is anyway to extract and compress files directly from ranger?
Offline
get 'atool' and open archive files with mode 1, by typing 1l, to extract them.
For compressing, use @apack foo.tar<enter>
also: https://bbs.archlinux.org/viewtopic.php … 03#p844503
Last edited by hut (2010-11-01 11:12:19)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Hey Hut, I noticed (fully updated ranger-git as of today) that when doing a :chmod on a directory, the permissions line at the bottom doesn't change and can't be changed even with a refresh. The permissions actually do change, and it also works on files, just not on directories. Actually, I should say it updates....rarely But I can't find a consistent pattern. I haven't used that feature enough to say whether it's worked consistently in the past or not.
Thanks!
Scott
Offline
And this happens only with directories, right?
Thanks for mentioning, I uploaded a fix.
Btw. I'm thinking of removing the :chmod command, since it's easily replaced with @chmod (using /bin/chmod, which is more flexible anyway), I hope you guys don't mind?
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Question (just started using ranger) but is it possible for ranger to default to something like xdg-open in the case that no specific file handler has been defined? Would help out those of us who use Gnome/KDE and already have mimetypes registered....
I'm pretty sure there's a simple way to do this in the current config, but haven't figured out how?
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
1. Put a copy of ranger/defaults/apps.py into ~/.config/ranger/apps.py, for example by typing
ranger --copy-config=apps
2. Edit it. At the bottom of the function "def app_default" it says something about mimeopen, replace that string with xdg-open.
3. I really should've made this configurable through the options.py or something. :X
EDIT:
Indeed I am using scope.sh. By renaiming it, ranger does not crash anymore but it still does not show any preview of this .srt files. For now, I am indeed using ranger with python 3.0.
I guess I will stay with ranger/python3 for now. It's not that a big issue but wanted you to be aware of it.
Thanks for your answers,
Sirsurthur----
Edit : for your information, I also got this crash during a .pdf preview :ranger --debug
Traceback (most recent call last):
File "/usr/lib/python3.1/site-packages/ranger/core/main.py", line 85, in main
fm.loop()
File "/usr/lib/python3.1/site-packages/ranger/core/fm.py", line 190, in loop
loader.work()
File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 234, in work
self.fm.notify(err)
File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 229, in work
next(item.load_generator)
File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 98, in generate
read = read.decode('utf-8')
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 511: unexpected end of data
Can you give me the file for which this error happens?
Last edited by hut (2010-11-06 16:43:09)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Sorry, hut, I must be blind, but I can't see anything referring mimeopen in apps.py. Also, ranger --copy-config doesn't exist .
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
Sorry, hut, I must be blind, but I can't see anything referring mimeopen in apps.py. Also, ranger --copy-config doesn't exist .
Okay, you didn't tell me what version you use so I just guessed
Then just add this at the bottom of the function:
return tup("xdg-open", *c)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Offline
Ranger rocks! Thanks for your great job,hut ^_^ Ranger is the only one file manager i have installed.
Just one question: is it possible to map key to do combined actions,for example,can i map J to firstly move down and then enter ? ( J = j+l )
Offline