From 4469f88a6a32191afa8c60bd83075c8058ec94d5 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 20 Jul 2009 22:30:49 +0200 Subject: [gf] searches for files. --- TODO | 2 +- code/help.rb | 1 + code/keys.rb | 11 ++++++++++- 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 Displays text in files matching block Blocks the program, until you write: stop + gf 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(.*)?)?)?)?)?/ -- cgit 1.4.1-2-gfad0