[doc] update clone urls to afify.dev/sfm
[sfm.git] / README.md
blob22c67e6d6a479f81aac22ca765c401eba62775c8
1 ![sfm](https://github.com/afify/sfm/blob/main/sfm.png?raw=true)
3 **simple file manager**
5 [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/afify/sfm.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/afify/sfm/context:cpp)
6 [![Build status](https://ci.appveyor.com/api/projects/status/goq88ahjyvtjrui2?svg=true)](https://ci.appveyor.com/project/afify/sfm)
7 [![code-inspector](https://www.code-inspector.com/project/19656/score/svg)](https://frontend.code-inspector.com/public/project/19656/sfm/dashboard)
8 [![code-inspector](https://www.code-inspector.com/project/19656/status/svg)](https://frontend.code-inspector.com/public/project/19656/sfm/dashboard)
10 Description
11 ------------
12 sfm is a simple file manager for unix-like systems.
14 * Use pthread to read events, no timers.
15 * BSD kqueue(2) - kernel event notification mechanism.
16 * Linux inotify(7) - monitoring filesystem events.
17 * dual pane.
18 * bookmarks.
19 * open files by extension.
20 * bottom statusbar.
21 * vim-like key bindings.
22 * filter.
23 * no dependencies.
24 * c99 static linking.
25 * based on [termbox](https://github.com/nsf/termbox).
26 * Inspired by [vifm](https://vifm.info/) and [noice](https://git.2f30.org/noice/).
27 * Follows the suckless [philosophy](https://suckless.org/philosophy/).
29 Performance
30 ------------
31 ```sh
32 $ perf stat -r 100 $filemanager
33 ```
34 | filemanager | cycles        | instructions  |
35 |:------------|:--------------|:--------------|
36 | `sfm`       | `1,137,335`   | `1,789,463`   |
37 | `noice`     | `5,380,103`   | `9,214,250`   |
38 | `nnn`       | `5,664,917`   | `9,790,040`   |
39 | `lf`        | `18,874,802`  | `33,281,073`  |
40 | `vifm`      | `38,792,656`  | `93,301,255`  |
41 | `ranger`    | `536,225,530` | `956,977,175` |
43 <img src="https://github.com/afify/afify.github.io/raw/main/img/sfm_sc.png" alt="drawing" width="800"/>
45 Options
46 -------
47 ```sh
48 $ sfm [-v]
49 $ man sfm
50 ```
52 **normal mode**
53 | key      | description         |
54 |:---------|:--------------------|
55 | `q`      | quit                |
56 | `h`      | back                |
57 | `j`      | down                |
58 | `k`      | up                  |
59 | `l`      | open                |
60 | `g`      | top                 |
61 | `G`      | bottom              |
62 | `M`      | middle              |
63 | `ctrl+u` | scroll up           |
64 | `ctrl+d` | scroll down         |
65 | `n`      | create new file     |
66 | `N`      | create new dir      |
67 | `d`      | delete file \| dir  |
68 | `y`      | yank                |
69 | `p`      | paste               |
70 | `P`      | move                |
71 | `c`      | rename              |
72 | `.`      | toggle dotfiles     |
73 | `v`      | start visual mode   |
74 | `/`      | start filter        |
75 | `ENTER`  | find  filter        |
76 | `ESC`    | exit  filter        |
77 | `SPACE`  | switch pane         |
79 **visual mode**
80 | key      | description         |
81 |:---------|:--------------------|
82 | `j`      | select down         |
83 | `k`      | select up           |
84 | `d`      | delete selection    |
85 | `y`      | yank selection      |
86 | `v`      | exit visual mode    |
87 | `q`      | exit visual mode    |
88 | `ESC`    | exit visual mode    |
90 Installation
91 ------------
92 **current**
93 ```sh
94 git clone git://git.afify.dev/sfm
95 cd sfm/
96 make
97 make install
98 ```
99 **latest release**
100 ```sh
101 wget $(curl -s https://git.afify.dev/sfm/tags.xml | grep --color=never -m 1 -o "\[v.*\]" | tr -d '[]'| awk '{print "https://git.afify.dev/sfm/releases/sfm-"$1".tar.gz"}')
102 tar -xzf sfm-*.tar.gz && cd sfm-*/
103 make
104 make install
108 ```sh
109 $ sfm
112 Configuration
113 -------------
114 The configuration of sfm is done by creating a custom config.h
115 and (re)compiling the source code. This keeps it fast, secure and simple.