Thumbnail

rani/cscroll.git

Clone URL: https://git.buni.party/rani/cscroll.git

Viewing file on branch master

1# cscroll
2
3A small and efficient TUI file manager.
4
5For usage, see [Usage](#usage). For building, see [Building](#building).
6
7## Usage
8
9cscroll has the following key binds:
10
11* Up/`j`/ctrl+p: Move the cursor up
12* Down/`k`/ctrl+n: Move the cursor down
13* Left/`h`/ctrl+p: Enter the previous directory
14* Right/`l`/ctrl+f: Enter the next directory, or open the current file
15* Home/`g`: Go to the first file in the directory
16* End/`G`: Go to the last file in the directory
17* `.`: Toggle showing/hiding dot files
18* `o`: Cycle through long mode viewing options
19* `/`: Search for a file using a POSIX extended regex
20* `d`: [Delete this file](#file-deletion) or all marked files
21* `m`: Mark a file
22* `c`: Cut marked files
23* `p`: [Paste](#file-pasting) all cut files into the current directory
24* `q`: Quit cscroll
25
26### File Deletion
27
28When deleting a file, a prompt will always be shown. Cycle through the prompt
29options using the left and right key binds (same as above). The prompt can be
30exited (without selecting an option) by pressing `q` or ESC.
31
32If the file is either a regular file or an empty directory, cscroll will delete
33the file if the prompt is answered "Yes". Otherwise, it will not delete the
34file. For non empty directories, the first prompt will show the number of files
35inside the directory and, if confirmed, a second prompt will be shown. cscroll
36will only delete the directory if the second prompt is also answered "Yes".
37
38When files are marked, deletion will act on the marked files, ignoring the file
39that the cursor is currently on. The marked deletion prompt will list the number
40of marked files and also the number of files in any marked directories. Marked
41file deletion will always have two prompts.
42
43### File Pasting
44
45When cut files are pasted, first a confirmation prompt is shown. Then, the cut
46files will be moved into the current directory. Pasting may fail for various
47reasons:
48
491. The paste directory cannot be opened for some reason. This is rare and should
50 only happen if the current directory is removed in between opening it in
51 cscroll and pasting the files.
522. One of the origin (cut) directories cannot be opened.
533. One of the cut files no longer exists.
544. Pasting would otherwise overwrite an already existing file.
55
56In the case of 2 through 4, cscroll will skip the error causing file/directory
57and continue trying to paste the others. An error message will be shown after
58pasting finishes, notifying the user that some files were skipped.
59
60cscroll will never attempt to overwrite a file by pasting. If this is behavior
61you want, you need to manually remove the conflicting file first. If two marked
62files have the same name, only one of the files will be pasted assuming the name
63does not conflict with any existing files in the paste directory. The paste
64order is arbitrary. I.e. if there are multiple marks with the same name, the one
65which is pasted can not be determined beforehand.
66
67## Building
68
69cscroll requires libncurses. cscroll can be compiled using any C99 or more
70recent C compiler and requires at least POSIX.1-2008. This means that
71compilation with a modern C compiler and libc will work with at least
72`-D_POSIX_C_SOURCE=200809L` and `-std=c99`. Note, however, that POSIX.1-2008
73does not include the "sticky" bit in file modes. This mode bit is platform
74dependent and is rarely used, but can be included in cscroll using the compiler
75flag `-D_XOPEN_SOURCE=700`. (Note that `_XOPEN_SOURCE = 700` implies
76`_POSIX_C_SOURCE = 200809L`.)
77
78cscroll can be built using `make`. On some systems, linking against libncurses
79may fail. If your system has `libncursesw.so` but not `libncurses.so`, modify
80the makefile to link against libncursesw instead. If you do not know what this
81means, run `sed -i 's/-lncurses/-lncursesw/g' Makefile` and try `make` again.
82