From 89f453db286f648dcaf498c32ac37d67ccd90e18 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 25 Aug 2010 03:10:58 +0200 Subject: defaults.keys: added keys gl and gL to resolve links --- ranger/defaults/keys.py | 4 +++- ranger/help/movement.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py index 1f42b6ee..0806a494 100644 --- a/ranger/defaults/keys.py +++ b/ranger/defaults/keys.py @@ -244,7 +244,9 @@ map('gh', fm.cd('~')) map('ge', fm.cd('/etc')) map('gu', fm.cd('/usr')) map('gd', fm.cd('/dev')) -map('gl', fm.cd('/lib')) +map('gl', lambda arg: arg.fm.cd(os.path.realpath(arg.fm.env.cwd.path))) +map('gL', lambda arg: arg.fm.cd( + os.path.dirname(os.path.realpath(arg.fm.env.cf.path)))) map('go', fm.cd('/opt')) map('gv', fm.cd('/var')) map('gr', 'g/', fm.cd('/')) diff --git a/ranger/help/movement.py b/ranger/help/movement.py index 3abec359..564b226b 100644 --- a/ranger/help/movement.py +++ b/ranger/help/movement.py @@ -74,6 +74,9 @@ This keys can be used to make movements beyond the current directory { traverse in the other direction. (not implemented yet, currently this only moves back in history) + gl move to the real path of the current directory (resolving symlinks) + gL move to the real path of the selected file or directory + ============================================================================== 1.2. Browser control -- cgit 1.4.1-2-gfad0