[feat] add threads
[sfm.git] / README.md
blob4697f0ddc484875c9f13cd357a170e391c68d407
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 based on [termbox](https://github.com/nsf/termbox).
13 dual pane, bottom statusbar, bookmarks, open files by extention, vim-like key bindings as default configuration. cwd is left pane dir. No dependencies, static linking, c99.
15 Performance
16 ------------
17 ```sh
18 $ perf stat -r 100 $filemanager
19 ```
20 | filemanager | cycles        | instructions  |
21 |:------------|:--------------|:--------------|
22 | `sfm`       | `1,137,335`   | `1,789,463`   |
23 | `noice`     | `5,380,103`   | `9,214,250`   |
24 | `nnn`       | `5,664,917`   | `9,790,040`   |
25 | `lf`        | `18,874,802`  | `33,281,073`  |
26 | `vifm`      | `38,792,656`  | `93,301,255`  |
27 | `ranger`    | `536,225,530` | `956,977,175` |
29 * Inspired by [vifm](https://vifm.info/) and [noice](https://git.2f30.org/noice/).
30 * Follows the suckless [philosophy](https://suckless.org/philosophy/) and [code style](https://suckless.org/coding_style/).
32 <img src="https://github.com/afify/afify.github.io/raw/main/img/sfm_sc.png" alt="drawing" width="800"/>
34 Options
35 -------
36 ```sh
37 $ sfm [-v]
38 $ man sfm
39 ```
41 **normal mode**
42 | key      | description         |
43 |:---------|:--------------------|
44 | `q`      | quit                |
45 | `h`      | back                |
46 | `j`      | down                |
47 | `k`      | up                  |
48 | `l`      | open                |
49 | `g`      | top                 |
50 | `G`      | bottom              |
51 | `M`      | middle              |
52 | `ctrl+u` | scroll up           |
53 | `ctrl+d` | scroll down         |
54 | `n`      | create new file     |
55 | `N`      | create new dir      |
56 | `d`      | delete file \| dir  |
57 | `y`      | yank                |
58 | `p`      | paste               |
59 | `P`      | move                |
60 | `c`      | rename              |
61 | `v`      | start visual mode   |
62 | `/`      | start filter        |
63 | `ENTER`  | find  filter        |
64 | `ESC`    | exit  filter        |
65 | `SPACE`  | switch pane         |
67 **visual mode**
68 | key      | description         |
69 |:---------|:--------------------|
70 | `j`      | select down         |
71 | `k`      | select up           |
72 | `d`      | delete selection    |
73 | `y`      | yank selection      |
74 | `v`      | exit visual mode    |
75 | `q`      | exit visual mode    |
76 | `ESC`    | exit visual mode    |
78 Installation
79 ------------
80 **current**
81 ```sh
82 git clone https://github.com/afify/sfm.git
83 cd sfm/
84 make
85 make install
86 ```
87 **latest release**
88 ```sh
89 wget --content-disposition $(curl -s https://api.github.com/repos/afify/sfm/releases/latest | tr -d '",' | awk '/tag_name/ {print "https://github.com/afify/sfm/archive/"$2".tar.gz"}')
90 tar -xzf sfm-*.tar.gz && cd sfm-*/
91 make
92 make install
93 ```
94 Run
95 ---
96 ```sh
97 $ sfm
98 ```
100 Configuration
101 -------------
102 The configuration of sfm is done by creating a custom config.h
103 and (re)compiling the source code.