[fix] mvfor save parent_firstrow
[sfm.git] / config.def.h
blob8b3800c11a815909fa3bf312edca001cf24f0748
1 /* See LICENSE file for copyright and license details.*/
3 #ifndef CONFIG_H
4 #define CONFIG_H
6 #include "termbox.h"
8 /* colors fg, bg */
9 static const Cpair cdir = { 33, TB_DEFAULT };
10 static const Cpair cerr = { 124, TB_DEFAULT };
11 static const Cpair cexec = { 2, TB_DEFAULT };
12 static const Cpair cfile = { TB_DEFAULT, TB_DEFAULT };
13 static const Cpair cframe = { TB_DEFAULT, TB_DEFAULT };
14 static const Cpair cother = { 3, TB_DEFAULT };
15 static const Cpair cpanell = { 166, TB_DEFAULT };
16 static const Cpair cpanelr = { 5, TB_DEFAULT };
17 static const Cpair cprompt = { 33, TB_DEFAULT };
18 static const Cpair csearch = { 255, TB_DEFAULT };
19 static const Cpair cstatus = { TB_DEFAULT, TB_DEFAULT };
21 /* bookmarks */
22 static Bookmark bmarks[] = {
23 {'\\', "/root"},
26 /* software */
27 static const char *mpv[] = { "mpv", "--fullscreen", NULL };
28 static const char *sxiv[] = { "sxiv", NULL };
29 static const char *surf[] = { "surf", NULL };
30 static const char *mupdf[] = { "mupdf", "-I", NULL };
31 static const char *libreoffice[] = { "libreoffice", NULL };
32 static const char *gimp[] = { "gimp", NULL };
33 static const char *r2[] = { "r2", "-c", "vv", NULL };
34 static const char *binary[] = { "r2", "-d", "-c", "vv", NULL };
36 /* extension */
37 static const char *images[] = { "bmp", "jpg", "jpeg", "png", "gif", "xpm" };
38 static const char *web[] = { "htm", "html" };
39 static const char *pdf[] = { "epub", "pdf" };
40 static const char *arts[] = { "xcf" };
41 static const char *obj[] = { "o", "a", "so" };
42 static const char *videos[] = { "avi", "flv", "wav", "webm", "wma", "wmv",
43 "m2v", "m4a", "m4v", "mkv", "mov", "mp3",
44 "mp4", "mpeg", "mpg" };
45 static const char *documents[] = { "odt", "doc", "docx", "xls", "xlsx", "odp",
46 "ods", "pptx", "odg" };
48 static Rule rules[] = {
49 {videos, LEN(videos), mpv},
50 {images, LEN(images), sxiv},
51 {web, LEN(web), surf},
52 {pdf, LEN(pdf), mupdf},
53 {documents, LEN(documents), libreoffice},
54 {arts, LEN(arts), gimp},
55 {obj, LEN(obj), r2},
58 static Key nkeys[] = {
59 { {.ch = 'j'}, mvdwn },
60 { {.ch = 'k'}, mvup },
61 { {.ch = 'l'}, mvfor },
62 { {.ch = 'h'}, mvbk },
63 { {.ch = 'g'}, mvtop },
64 { {.ch = 'G'}, mvbtm },
65 { {.ch = 'M'}, mvmid },
66 { {.key = TB_KEY_CTRL_U}, scrup },
67 { {.key = TB_KEY_CTRL_D}, scrdwn },
68 { {.ch = 'n'}, crnf },
69 { {.ch = 'N'}, crnd },
70 { {.ch = 'D'}, delfd },
71 { {.ch = 'x'}, calcdir },
72 { {.ch = '/'}, filter },
73 { {.ch = 'q'}, quit },
74 { {.ch = 'v'}, selection },
75 { {.ch = 'y'}, yank },
76 { {.ch = 'p'}, selpst },
77 { {.ch = 'P'}, selmv },
78 { {.ch = 'r'}, rname },
79 { {.key = TB_KEY_SPACE}, switch_pane },
82 static Key skeys[] = {
83 { {.ch = 'j'}, seldwn },
84 { {.ch = 'k'}, selup },
85 { {.ch = 'a'}, selall },
86 { {.ch = 'y'}, selynk },
87 { {.ch = 'D'}, seldel },
88 { {.key = TB_KEY_ESC}, selcan },
89 { {.ch = 'r'}, selrename },
92 static const size_t nkeyslen = LEN(nkeys);
93 static const size_t skeyslen = LEN(skeys);
95 static const mode_t ndir_perm = S_IRWXU | S_IRWXG |S_IROTH | S_IXOTH;
96 static const mode_t nf_perm = S_IRUSR | S_IWUSR;
98 /* scroll */
99 static const int scrmv = 10; /* ctrl+u, ctrl+d movement */
100 static const int scrsp = 3; /* space before scroll */
102 /* statusbar */
103 static const int show_ug = 1;
104 static const int show_perm = 1;
105 static const int show_dt = 1;
106 static const int show_size = 1;
107 static const char dtfmt[] = "%F %R"; /* date time format */
109 /* unicode chars */
110 #define u_hl 0x2500 /* ─ */
111 #define u_vl 0x2502 /* │ */
112 #define u_cnw 0x250C /* ┌ */
113 #define u_cne 0x2510 /* ┐ */
114 #define u_csw 0x2514 /* └ */
115 #define u_cse 0x2518 /* ┘ */
116 #define u_mn 0x252C /* ┬ */
117 #define u_ms 0x2534 /* ┴ */
119 #endif /* CONFIG_H */