| 1 | # cscroll |
| 2 | |
| 3 | A small and efficient TUI file manager. |
| 4 | |
| 5 | For usage, see [Usage](#usage). For building, see [Building](#building). |
| 6 | |
| 7 | ## Usage |
| 8 | |
| 9 | cscroll 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 | |
| 28 | When deleting a file, a prompt will always be shown. Cycle through the prompt |
| 29 | options using the left and right key binds (same as above). The prompt can be |
| 30 | exited (without selecting an option) by pressing `q` or ESC. |
| 31 | |
| 32 | If the file is either a regular file or an empty directory, cscroll will delete |
| 33 | the file if the prompt is answered "Yes". Otherwise, it will not delete the |
| 34 | file. For non empty directories, the first prompt will show the number of files |
| 35 | inside the directory and, if confirmed, a second prompt will be shown. cscroll |
| 36 | will only delete the directory if the second prompt is also answered "Yes". |
| 37 | |
| 38 | When files are marked, deletion will act on the marked files, ignoring the file |
| 39 | that the cursor is currently on. The marked deletion prompt will list the number |
| 40 | of marked files and also the number of files in any marked directories. Marked |
| 41 | file deletion will always have two prompts. |
| 42 | |
| 43 | ### File Pasting |
| 44 | |
| 45 | When cut files are pasted, first a confirmation prompt is shown. Then, the cut |
| 46 | files will be moved into the current directory. Pasting may fail for various |
| 47 | reasons: |
| 48 | |
| 49 | 1. 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. |
| 52 | 2. One of the origin (cut) directories cannot be opened. |
| 53 | 3. One of the cut files no longer exists. |
| 54 | 4. Pasting would otherwise overwrite an already existing file. |
| 55 | |
| 56 | In the case of 2 through 4, cscroll will skip the error causing file/directory |
| 57 | and continue trying to paste the others. An error message will be shown after |
| 58 | pasting finishes, notifying the user that some files were skipped. |
| 59 | |
| 60 | cscroll will never attempt to overwrite a file by pasting. If this is behavior |
| 61 | you want, you need to manually remove the conflicting file first. If two marked |
| 62 | files have the same name, only one of the files will be pasted assuming the name |
| 63 | does not conflict with any existing files in the paste directory. The paste |
| 64 | order is arbitrary. I.e. if there are multiple marks with the same name, the one |
| 65 | which is pasted can not be determined beforehand. |
| 66 | |
| 67 | ## Building |
| 68 | |
| 69 | cscroll requires libncurses. cscroll can be compiled using any C99 or more |
| 70 | recent C compiler and requires at least POSIX.1-2008. This means that |
| 71 | compilation 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 |
| 73 | does not include the "sticky" bit in file modes. This mode bit is platform |
| 74 | dependent and is rarely used, but can be included in cscroll using the compiler |
| 75 | flag `-D_XOPEN_SOURCE=700`. (Note that `_XOPEN_SOURCE = 700` implies |
| 76 | `_POSIX_C_SOURCE = 200809L`.) |
| 77 | |
| 78 | cscroll can be built using `make`. On some systems, linking against libncurses |
| 79 | may fail. If your system has `libncursesw.so` but not `libncurses.so`, modify |
| 80 | the makefile to link against libncursesw instead. If you do not know what this |
| 81 | means, run `sed -i 's/-lncurses/-lncursesw/g' Makefile` and try `make` again. |
| 82 | |