diff options
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(.*)?)?)?)?)?/ |