Skip to content

jjbailey/browse

Repository files navigation

browse

A simple, unconventional file browser designed for efficient file navigation and viewing.

Description

browse is a minimalist file browser that focuses on essential features while maintaining a user-friendly interface. It's ideal for developers and system administrators who need a lightweight alternative to traditional file viewers.

Features

Navigation

  • Forward and reverse paging
  • Continuous scrolling (forward and reverse)
  • Horizontal scrolling
  • Line jumping
  • Page marking

Search & Filter

  • Forward and reverse regex searches
  • Case-sensitive/case-insensitive search toggle
  • Pattern highlighting

Additional Features

  • Shell escape with command completion
  • Tail -f functionality
  • Line numbers
  • Session saving
  • Help screen

Usage

Command Line Options

Command Line Option

Function

-f, --follow follow file changes
-i, --ignore-case search ignores case
-n, --numbers start with line numbers turned on
-p, --pattern initial search pattern
-t, --title page title, default is filename, blank for stdin
-v, --version print browse version number
-?, --help print browse command line options

Navigation Commands

Pages/Lines

Function

f
[PAGE DOWN]
[SPACE]
Page down toward EOF
b
[PAGE UP]
Page up toward SOF
^F
^D
z
Scroll half page down toward EOF
^B
^U
Z
Scroll half page up toward SOF
+
[RIGHT]
[ENTER]
Scroll one line toward EOF
-
[LEFT]
Scroll one line toward SOF
d
[DOWN]
Toggle continuous scroll toward EOF, follow at EOF
u
[UP]
Toggle continuous scroll toward SOF, stop at SOF
>
[TAB]
Scroll 4 characters right
<
[BACKSPACE]
[DEL]
Scroll 4 characters left
^ Scroll to column 1
$ Scroll to EOL
0
[HOME]
Jump to SOF, column 1
G Jump to EOF
e
[END]
Jump to EOF, follow at EOF
t Jump to EOF, tail at EOF

Search Commands

Searches

Function

/ Regex search forward, empty pattern repeats search or changes search direction
? Regex search reverse, empty pattern repeats search or changes search direction
n Repeat search in the current search direction
N Repeat search in the opposite search direction
i Toggle between case-sensitive and case-insensitive searches
p Print the search pattern
P Clear the search pattern
& Run 'grep -nP' on the current file for search pattern

Miscellaneous Commands

Miscellaneous

Function

# Toggle line numbers on and off
%
^G
Page position
! Run a bash command (expands !, %, &, ~)
B Browse another file (expands %, ~)
q Quit, save .browserc, next file in list
Q Quit, don't save .browserc, next file in list
x Exit list, save .browserc
X Exit list, don't save .browserc

Symbol Expansions

Symbol

Expansions

! Last bash command
% Current file name
& Current search pattern
~ Home directory

Configuration

browse saves sessions in ~/.browserc with the following format:

  1. File name
  2. First line on page
  3. Search pattern
  4. Marks
  5. Page title

browse saves file history in ~/.browse_files.

browse saves command history in ~/.browse_shell.

Limitations

  • Xterm specific
  • Logical lines are truncated to screen width
  • May be US-centric
  • Can be confused by non-printable characters
  • Tabs are converted to spaces
  • Terminal title changes due to go-prompt dependency

License

MIT License - see LICENSE file for details

About

A simple, unconventional file browser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published