Module: Rfd::Commands::Viewing

Included in:
Rfd::Commands
Defined in:
lib/rfd/commands.rb

Overview

Viewing commands for displaying file contents.

Instance Method Summary collapse

Instance Method Details

#/Object

Search files (grep).



336
337
338
# File 'lib/rfd/commands.rb', line 336

def /
  process_command_line preset_command: 'grep'
end

#oObject

Open with system viewer.



322
323
324
325
326
327
328
# File 'lib/rfd/commands.rb', line 322

def o
  if selected_items.any?
    system 'open', *selected_items.map(&:path)
  elsif %w(. ..).include? current_item.name
    system 'open', current_item.path
  end
end

#PObject

Toggle preview window.



331
332
333
# File 'lib/rfd/commands.rb', line 331

def P
  preview
end

#sObject

Sort files.



341
342
343
# File 'lib/rfd/commands.rb', line 341

def s
  process_command_line preset_command: 'sort'
end