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
-
#/ ⇒ Object
Search files (grep).
-
#o ⇒ Object
Open with system viewer.
-
#P ⇒ Object
Toggle preview window.
-
#s ⇒ Object
Sort files.
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 |
#o ⇒ Object
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 |
#P ⇒ Object
Toggle preview window.
331 332 333 |
# File 'lib/rfd/commands.rb', line 331 def P preview end |
#s ⇒ Object
Sort files.
341 342 343 |
# File 'lib/rfd/commands.rb', line 341 def s process_command_line preset_command: 'sort' end |