markdown · 6240 bytes Raw Blame History

FORTRESS

(noun) : all your base are belong to us

A command-line file explorer written in modern Fortran with fzf integration and git binds for fast staging and committing.

Installation

From AUR (Arch Linux)

yay -S fortress
# or
paru -S fortress

Shell integration is automatically set up for bash and fish. Zsh users need to add to ~/.zshrc:

source /usr/share/fortress/fortress.sh

Homebrew

brew tap FortranGoingOnForty/fortress
brew install fortress

Follow the caveats or quick directory jump won't work!

From Source

Prerequisites

  • gfortran 10+ or ifort
  • fpm (Fortran Package Manager)

Install fpm

# Using cargo (if you have Rust)
cargo install fpm

# Or download from GitHub releases
# https://github.com/fortran-lang/fpm/releases

Build & Run

# Build the project
fpm build

# Run FORTRESS
fpm run

# Or build and run in one command
fpm run --flag "-O2"

Shell Integration (Optional)

To enable the "cd on exit" feature (press 'c' to navigate your shell to a directory):

# Add to your .bashrc or .zshrc:
source /path/to/fortress/fortress.sh

# Then use:
fortress  # instead of 'fpm run'

This allows you to navigate to directories and have your shell follow when you press 'c'.

Development

# Run tests
fpm test

# Build with debug flags
fpm build --flag "-g -Wall -Wextra"

Features

File Explorer

  • Dual-pane display inspired by Ranger/MC (parent dir 30% | current dir 70%)
  • Real filesystem navigation with directory reading
  • Smart selection memory - remembers position when navigating
  • Visual hierarchy - dimmed parent pane, active current pane
  • Color-coded files:
    • Directories: Blue + bold
    • Executable files: Green
    • Dotfiles: Grey
    • Regular files: White
  • Smooth scrolling - viewport follows cursor automatically
  • Fuzzy finding with fzf - press 's' to search recursively and jump to files
  • CD on exit - press 'c' to navigate your shell to selected directory
  • Dotfiles toggle - press '.' to show/hide dotfiles

File Operations

  • Move mode - press 'v' to enter move mode, navigate to destination, 'v' to confirm, 'q' to cancel
  • Rename - press 'n' to rename files or directories
  • Delete - press 'r' to remove/delete with confirmation prompt
    • Shows yellow warning for directories
    • Requires explicit 'y' confirmation
    • Handles both files and directories recursively
  • Open files - press 'o' to open with default application (respects $EDITOR/$VISUAL)
  • Clipboard operations (vim-style):
    • Copy - press 'y' to yank (copy) file/directory to clipboard
    • Cut - press 'x' to cut file/directory to clipboard
    • Paste - press 'p' to paste:
      • On directory: pastes INTO that directory
      • On file: pastes NEXT TO that file (into current directory)
      • On ".": pastes into current directory
      • On "..": pastes into parent directory
    • Copy clipboard persists for multiple pastes
    • Cut clipboard auto-clears after paste
    • Smart duplicate handling - automatically appends -1, -2, etc. if destination exists
      • USAGE.mdUSAGE-1.md, USAGE-2.md, etc.
      • Works with any file extension or directories
  • Works on files AND directories - all operations support recursive directory handling

Git Integration (inspired by fuss)

  • Recursive git status indicators:
    • (green) = Staged changes
    • (red) = Modified/unstaged changes
    • (grey) = Untracked files
    • (yellow) = Incoming changes from remote
    • Directories show indicators if they contain dirty files at any depth
    • Indicators persist across subdirectory navigation
  • Batch operations - stage/unstage entire directories recursively
  • Repo name and branch in status bar
  • Full git workflow:
    • Stage, unstage, commit, fetch, pull, push, tag
    • View diffs with color output
    • Incoming change detection
  • Real-time updates - indicators refresh after git operations
  • Smart upstream handling - interactive branch selection when no upstream configured

Controls

  • ↑/↓: Navigate up/down
  • : Enter directory
  • : Go back to parent directory
  • ~: Jump to home directory
  • /: Jump to root directory
  • s: Search files with fzf (fuzzy find recursively)
  • c: CD to selected directory and exit (requires shell integration)
  • q: Quit (or exit move mode if active)
  • .: Toggle dotfiles visibility

File Operations

  • v: Enter move mode / confirm move
  • y: Yank (copy) to clipboard
  • x: Cut to clipboard
  • p: Paste from clipboard
  • n: Rename file/directory
  • r: Remove/delete file/directory (with confirmation)
  • o: Open file with default application

Git Commands (when in a git repository)

  • a: Stage file/directory (batch stages directories recursively)
  • u: Unstage file/directory (batch unstages directories recursively)
  • m: Commit with message prompt
  • d: Show git diff for selected file
  • f: Fetch from remote
  • l: Pull from remote
  • h: Push to remote
  • t: Create git tag

Visual Feedback

FORTRESS provides clear visual feedback for all operations:

Header Status

  • Normal: Shows current directory path
  • Move mode: Shows MOVE: filename in red
  • Copy clipboard: Shows COPY: filename in green
  • Cut clipboard: Shows CUT: filename in yellow

Move Mode

When in move mode (press 'v'):

  • Source file/directory appears in red bold
  • Destination cursor has white background
  • Footer shows move mode controls
  • Press 'q' to cancel, 'v' to confirm

Clipboard Visual Feedback

  • Copied files: Normal appearance, shown in header as green COPY: filename
  • Cut files: Appear in dark red (dimmed) to indicate they will be moved
  • Cut file selected: Shows with red background instead of normal selection color
  • Visual indication persists until paste operation completes

Operation Feedback

All file operations (move, copy, cut, paste, rename) display:

  • Success/failure status with ✓/✗ indicators
  • Source and destination paths
  • 2-second pause to review before returning to navigation

License

MIT

View source
1 # FORTRESS
2 (noun) : all your base are belong to us
3
4 A command-line file explorer written in modern Fortran with fzf integration and git binds for fast staging and committing.
5
6 ## Installation
7
8 ### From AUR (Arch Linux)
9
10 ```bash
11 yay -S fortress
12 # or
13 paru -S fortress
14 ```
15
16 Shell integration is automatically set up for bash and fish. Zsh users need to add to `~/.zshrc`:
17 ```bash
18 source /usr/share/fortress/fortress.sh
19 ```
20
21 ### Homebrew
22 ```bash
23 brew tap FortranGoingOnForty/fortress
24 brew install fortress
25 ```
26 Follow the caveats or quick directory jump won't work!
27
28 ### From Source
29
30 #### Prerequisites
31
32 - gfortran 10+ or ifort
33 - fpm (Fortran Package Manager)
34
35 ### Install fpm
36
37 ```bash
38 # Using cargo (if you have Rust)
39 cargo install fpm
40
41 # Or download from GitHub releases
42 # https://github.com/fortran-lang/fpm/releases
43 ```
44
45 ### Build & Run
46
47 ```bash
48 # Build the project
49 fpm build
50
51 # Run FORTRESS
52 fpm run
53
54 # Or build and run in one command
55 fpm run --flag "-O2"
56 ```
57
58 ### Shell Integration (Optional)
59
60 To enable the "cd on exit" feature (press 'c' to navigate your shell to a directory):
61
62 ```bash
63 # Add to your .bashrc or .zshrc:
64 source /path/to/fortress/fortress.sh
65
66 # Then use:
67 fortress # instead of 'fpm run'
68 ```
69
70 This allows you to navigate to directories and have your shell follow when you press 'c'.
71
72 ### Development
73
74 ```bash
75 # Run tests
76 fpm test
77
78 # Build with debug flags
79 fpm build --flag "-g -Wall -Wextra"
80 ```
81
82 ## Features
83
84 ### File Explorer
85 - **Dual-pane display** inspired by Ranger/MC (parent dir 30% | current dir 70%)
86 - **Real filesystem navigation** with directory reading
87 - **Smart selection memory** - remembers position when navigating
88 - **Visual hierarchy** - dimmed parent pane, active current pane
89 - **Color-coded files**:
90 - Directories: Blue + bold
91 - Executable files: Green
92 - Dotfiles: Grey
93 - Regular files: White
94 - **Smooth scrolling** - viewport follows cursor automatically
95 - **Fuzzy finding with fzf** - press 's' to search recursively and jump to files
96 - **CD on exit** - press 'c' to navigate your shell to selected directory
97 - **Dotfiles toggle** - press '.' to show/hide dotfiles
98
99 ### File Operations
100 - **Move mode** - press 'v' to enter move mode, navigate to destination, 'v' to confirm, 'q' to cancel
101 - **Rename** - press 'n' to rename files or directories
102 - **Delete** - press 'r' to remove/delete with confirmation prompt
103 - Shows yellow warning for directories
104 - Requires explicit 'y' confirmation
105 - Handles both files and directories recursively
106 - **Open files** - press 'o' to open with default application (respects $EDITOR/$VISUAL)
107 - **Clipboard operations** (vim-style):
108 - **Copy** - press 'y' to yank (copy) file/directory to clipboard
109 - **Cut** - press 'x' to cut file/directory to clipboard
110 - **Paste** - press 'p' to paste:
111 - On directory: pastes INTO that directory
112 - On file: pastes NEXT TO that file (into current directory)
113 - On ".": pastes into current directory
114 - On "..": pastes into parent directory
115 - Copy clipboard persists for multiple pastes
116 - Cut clipboard auto-clears after paste
117 - **Smart duplicate handling** - automatically appends `-1`, `-2`, etc. if destination exists
118 - `USAGE.md``USAGE-1.md`, `USAGE-2.md`, etc.
119 - Works with any file extension or directories
120 - **Works on files AND directories** - all operations support recursive directory handling
121
122 ### Git Integration (inspired by fuss)
123 - **Recursive git status indicators**:
124 - `↑` (green) = Staged changes
125 - `✗` (red) = Modified/unstaged changes
126 - `✗` (grey) = Untracked files
127 - `↓` (yellow) = Incoming changes from remote
128 - **Directories show indicators** if they contain dirty files at any depth
129 - **Indicators persist** across subdirectory navigation
130 - **Batch operations** - stage/unstage entire directories recursively
131 - **Repo name and branch** in status bar
132 - **Full git workflow**:
133 - Stage, unstage, commit, fetch, pull, push, tag
134 - View diffs with color output
135 - Incoming change detection
136 - **Real-time updates** - indicators refresh after git operations
137 - **Smart upstream handling** - interactive branch selection when no upstream configured
138
139 ## Controls
140
141 ### Navigation
142 - `↑/↓`: Navigate up/down
143 - `→`: Enter directory
144 - `←`: Go back to parent directory
145 - `~`: Jump to home directory
146 - `/`: Jump to root directory
147 - `s`: Search files with fzf (fuzzy find recursively)
148 - `c`: CD to selected directory and exit (requires shell integration)
149 - `q`: Quit (or exit move mode if active)
150 - `.`: Toggle dotfiles visibility
151
152 ### File Operations
153 - `v`: Enter move mode / confirm move
154 - `y`: Yank (copy) to clipboard
155 - `x`: Cut to clipboard
156 - `p`: Paste from clipboard
157 - `n`: Rename file/directory
158 - `r`: Remove/delete file/directory (with confirmation)
159 - `o`: Open file with default application
160
161 ### Git Commands (when in a git repository)
162 - `a`: Stage file/directory (batch stages directories recursively)
163 - `u`: Unstage file/directory (batch unstages directories recursively)
164 - `m`: Commit with message prompt
165 - `d`: Show git diff for selected file
166 - `f`: Fetch from remote
167 - `l`: Pull from remote
168 - `h`: Push to remote
169 - `t`: Create git tag
170
171 ## Visual Feedback
172
173 FORTRESS provides clear visual feedback for all operations:
174
175 ### Header Status
176 - **Normal**: Shows current directory path
177 - **Move mode**: Shows `MOVE: filename` in red
178 - **Copy clipboard**: Shows `COPY: filename` in green
179 - **Cut clipboard**: Shows `CUT: filename` in yellow
180
181 ### Move Mode
182 When in move mode (press 'v'):
183 - Source file/directory appears in **red bold**
184 - Destination cursor has **white background**
185 - Footer shows move mode controls
186 - Press 'q' to cancel, 'v' to confirm
187
188 ### Clipboard Visual Feedback
189 - **Copied files**: Normal appearance, shown in header as green `COPY: filename`
190 - **Cut files**: Appear in **dark red** (dimmed) to indicate they will be moved
191 - **Cut file selected**: Shows with **red background** instead of normal selection color
192 - Visual indication persists until paste operation completes
193
194 ### Operation Feedback
195 All file operations (move, copy, cut, paste, rename) display:
196 - Success/failure status with ✓/✗ indicators
197 - Source and destination paths
198 - 2-second pause to review before returning to navigation
199
200 ## License
201
202 MIT