The command line. You either love it or hate it, but if you do anything with a Unix-like system you are going to have to use it eventually. You might find marker — a system billed as a “command palette for the terminal” — a useful program to install. We couldn’t decide if it was like command history on steroids or more of a bookmark system. In a way, it is a little of both.

Your history rolls off eventually and also contains a lot of small commands (although you can use the HISTIGNORE variable to ignore particular commands). With marker, you save specific commands and they stay saved. There are no extra commands nor do the ones you save ever roll off.

Of course, you could just make a shell script or an alias if that’s all there was to it. Marker lets you add a description to the command and then you can search through the commands and the descriptions using a fuzzy incremental search. In addition, you can put placeholders into your command lines that are easily replaced. There are some built-in commands to get you started and the same bookmarks will work in bash and zsh, if you use both.

Installing Marker

Marker is a standalone project which you can install from its Github repo. Installation is easy and doesn’t require root. However, you still have to add a line to your shell initialization file, although it does give you instructions after the install. However, since the default keybindings may not work for you, you might want to just manually source it at first until you are happy with it. Then make the changes to your initialization file. In other words, you might want to wait before issuing the last two commands.

git clone --depth=1 https://github.com/pindexis/marker ~/.marker && ~/.marker/install.py
cp ~/.bashrc ~/.bashrc_backup
echo '[[ -s "$HOME/.local/share/marker/marker.sh" ]] && source "$HOME/.local/share/marker/marker.sh"' >> ~/.bashrc

Depending on your Linux distro there may be a gotcha that you also need to workaround. If typing part of a command and hitting CTRL-Space throws the error bash: bash_execute_unix_command: cannot find keymap for command you’ve encountered a known bug. Solved it by editing ~/.marker/bin/marker.sh according to these instructions. In fact, many of the keybindings may have problems on some systems. It is easier to just issue a “source” command in a shell to activate marker for that shell until you are sure you want to use it all the time:

source ~/.local/share/marker/marker.sh

Then if you get stuck, you can just exit that shell and open another one to recover. Once you are satisfied with your set up, you can follow the instructions to make the change to your .bashrc. Of course, you can always recover by copying .bashrc_backup to .bashrc if you followed the instructions above.

How to Use Marker

Take Marker for a spin by using it to search through your command history. If you’re accustomed to using CTRL-R to reverse search you’ll find this handy. By default you can type part of a command and hit CTRL-Space to search …read more

Source:: Hackaday