about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-07-20 22:30:49 +0200
committerhut <hut@lavabit.com>2009-07-20 22:30:49 +0200
commit4469f88a6a32191afa8c60bd83075c8058ec94d5 (patch)
tree3d1d784fc984e8ef127b2a60d03e16a8e11a2ddc
parent08a843ec650087653f70c6a33f1b963cad4ab967 (diff)
downloadranger-4469f88a6a32191afa8c60bd83075c8058ec94d5.tar.gz
[gf] searches for files.
-rw-r--r--TODO2
-rw-r--r--code/help.rb1
-rw-r--r--code/keys.rb11
3 files changed, 12 insertions, 2 deletions
diff --git a/TODO b/TODO
index f7799b46..3a4b75e8 100644
--- a/TODO
+++ b/TODO
@@ -51,7 +51,7 @@ Features
    ( ) #20  09/07/19  accelerate mouse wheel scrolling after a while
    ( ) #21  09/07/19  what about a CONSOLE
    ( ) #22  09/07/19  tab-completition for filenames
-   ( ) #25  09/07/20  a command for find . | grep xyz | less
+   (X) #25  09/07/20  a command for find . | grep xyz | less
 
 
 Aesthetics
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(.*)?)?)?)?)?/