1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# Fast Memo Shell
**Fast Memo Shell** is a tool designed to boost productivity when using a ZSH shell.
It allows users to enhance their current shell with a customized list of commands by using the Alt+L key combination or by typing the command 'f'.

## How to install
### Dependencies
FMS (Fast Memo Shell) a ZSH script based on three tools: [skim](https://github.com/lotabout/skim), [yq-go](https://github.com/mikefarah/yq) and [bat](https://github.com/sharkdp/bat).
All of them should be installed and available in your PATH with the commands 'sk', 'yq', and 'bat'.
For example, you can use Nix to install them:
```sh
nix-env -i skim bat yq-go
```
Or use Parabola GNU/Linux-libre binaries (a compatible method for a Kali Linux VM out of the box):
```sh
wget https://www.parabola.nu/packages/extra/x86_64/skim/download/ -O /tmp/skim.tar.zst
sudo tar --zstd -xvf /tmp/skim.tar.zst -C /usr/local/bin --strip-components=2 usr/bin/sk
wget https://www.parabola.nu/packages/extra/x86_64/go-yq/download/ -O /tmp/yq.tar.zst
sudo tar --zstd -xvf /tmp/yq.tar.zst -C /usr/local/bin --strip-components=2 usr/bin/yq
wget https://www.parabola.nu/packages/extra/x86_64/bat/download/ -O /tmp/bat.tar.zst
sudo tar --zstd -xvf /tmp/bat.tar.zst -C /usr/local/bin --strip-components=2 usr/bin/bat
```
### FMS
You should download the latest version and extract it in your home directory:
```sh
wget "https://git.hackade.org/ben/fms/archive/main.tar.gz" -O fms.tar.gz
tar zxvf fms.tar.gz -C ~
```
Then add the following line to your ZSH configuration file:
```sh
echo 'source ~/fms/integration.zsh' >> ~/.zshrc
```
## How to configure
Each command is stored in the file commands.yaml. To add new commands or modify existing ones, edit commands.yaml with the following fields:
```yaml
- cmd: <the command to insert in your prompt>
lang: <the language of your command, sh, ps1>
tags: <a tag reprenting a group of commands>
desc: <the description of the command>
```
The tags and desc fields are only used to provide information to easily find your command when you search for it.
The lang field is used for syntax highlighting.
Here is an example of an entry:
```yaml
- cmd: find / -perm -u=s -type f 2>/dev/null
lang: sh
tags: security
desc: Search for executables with SUID permission
```
Then, to update the database and apply the changes, run the following commands:
```sh
~/fms/fms.sh update
```
Fast Memo Shell comes with a list of commands as examples, but you are highly encouraged to update it according to your needs.
## How to use
To launch Fast Memo Shell, there are two possibilities: press Alt+L or enter the command 'f'.
To select the right command, you can:
* Enter a string to find your command.
* Use the up and down arrow keys.
* Enter '<string>' to display only the commands containing this substring.
* Once you have the desired command selected, just press Enter.
Fast Memo Shell can also display all available manuals. To switch between both modes, use Shift+Left and Shift+Right arrows."
|