Skip to content

Commit

Permalink
[ref] visual mode delete
Browse files Browse the repository at this point in the history
- remove selection array from struct
- remove get_path_dir (no need, we use now fullpath globaly)
- rename funcs to start_vmode exit_vmode
- rename sl to cont_vmode
- selynk use refresh_pane instead of listdir
- seldel don't call delentr, call spawn
  • Loading branch information
afify committed Dec 6, 2020
1 parent 202031b commit 8cae390
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 107 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ $ man sfm
| `p` | paste |
| `P` | move |
| `c` | rename |
| `v` | start visual mode |
| `/` | start filter |
| `ENTER` | find filter |
| `ESC` | exit filter |
Expand All @@ -50,9 +51,11 @@ $ man sfm
**visual mode**
| key | description |
|:---------|:--------------------|
| `v` | enter visual mode |
| `j` | select down |
| `k` | select up |
| `d` | delete selection |
| `v` | exit visual mode |
| `q` | exit visual mode |
| `ESC` | exit visual mode |

Installation
Expand Down
7 changes: 4 additions & 3 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static Key nkeys[] = {
{ {.ch = 'x'}, calcdir },
{ {.ch = '/'}, filter },
{ {.ch = 'q'}, quit },
{ {.ch = 'v'}, selection },
{ {.ch = 'v'}, start_vmode },
{ {.ch = 'y'}, yank },
{ {.ch = 'p'}, selpst },
{ {.ch = 'P'}, selmv },
Expand All @@ -82,8 +82,9 @@ static Key skeys[] = {
{ {.ch = 'a'}, selall },
{ {.ch = 'y'}, selynk },
{ {.ch = 'd'}, seldel },
{ {.ch = 'v'}, selcan },
{ {.key = TB_KEY_ESC}, selcan },
{ {.ch = 'q'}, exit_vmode },
{ {.ch = 'v'}, exit_vmode },
{ {.key = TB_KEY_ESC}, exit_vmode },
};

static const size_t nkeyslen = LEN(nkeys);
Expand Down
15 changes: 12 additions & 3 deletions sfm.1
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ move
.B c
rename
.TP
.B v
start visual mode
.TP
.B /
start filter
.TP
Expand All @@ -76,15 +79,21 @@ exit filter
switch pane
.SS Visual Mode
.TP
.B v
enter visual mode
.TP
.B j
select down
.TP
.B k
select up
.TP
.B d
delete selection
.TP
.B v
exit visual mode
.TP
.B q
exit visual mode
.TP
.B ESC
exit visual mode
.SH CUSTOMIZATION
Expand Down
Loading

0 comments on commit 8cae390

Please sign in to comment.