diff options
author | hut <hut@lavabit.com> | 2009-07-20 22:30:49 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2009-07-20 22:30:49 +0200 |
commit | 4469f88a6a32191afa8c60bd83075c8058ec94d5 (patch) | |
tree | 3d1d784fc984e8ef127b2a60d03e16a8e11a2ddc /code | |
parent | 08a843ec650087653f70c6a33f1b963cad4ab967 (diff) | |
download | ranger-4469f88a6a32191afa8c60bd83075c8058ec94d5.tar.gz |
[gf] searches for files.
Diffstat (limited to 'code')
-rw-r--r-- | code/help.rb | 1 | ||||
-rw-r--r-- | code/keys.rb | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/code/help.rb b/code/help.rb index c386f8c5..23fdb266 100644 --- a/code/help.rb +++ b/code/help.rb @@ -229,6 +229,7 @@ module Fm tar Packs the selection into the file pack.tar grep<str> Displays text in files matching <str> block Blocks the program, until you write: stop + gf<X> Finds files containing X in their filename - or = decreases or increases audio volume (alsa) diff --git a/code/keys.rb b/code/keys.rb index 6abcfcd4..22a65527 100644 --- a/code/keys.rb +++ b/code/keys.rb @@ -316,6 +316,15 @@ module Fm end end + when /^gf\s?(.*)$/ + if_enter_pressed($1) do |arg| + grep = 'grep --color=always' + less = 'less' + externally do + system "find . | #{grep} #{arg} | #{less}" + end + end + when 'du' externally do system "du --max-depth=1 -h | less" @@ -565,7 +574,7 @@ module Fm /:[^<]*/ /[fF/!].*/ /r\d*\w*[^r]/ - /(c[wmo]|cd|mv).*/ + /(c[wmo]|cd|mv|gf).*/ /b(l(o(c(k(.*)?)?)?)?)?/ /g(r(e(p(.*)?)?)?)?/ /m(k(d(i(r(.*)?)?)?)?)?/ |